Browse Source

Merging in latest from upstream (VISUAL/fineui:refs/heads/master)

* commit '2154234a0825ebc15604b0f83a8464de8e01d853': (97 commits)
  auto upgrade version to 2.0.20221027160615
  KERNEL-13158: 包裹BI.Widget.pushContext()
  KERNEL-13158: 包裹BI.Widget.pushContext()
  auto upgrade version to 2.0.20221027152436
  无jira fix: less中 .hover-visible mixin也处理一下combo
  auto upgrade version to 2.0.20221027142438
  无JIRA refactor(日期控件): 修改ts声明
  auto upgrade version to 2.0.20221027121605
  auto upgrade version to 2.0.20221027095512
  KERNEL-13232 feat: 复选树的连接线之类的不再用图片了
  无JIRA refactor(widget/year): ts声明补充
  BI-116019 fix: 【6.0.4冒烟】区间滑块不绑定字段,鼠标悬浮组件应该会有提示
  auto upgrade version to 2.0.20221026151459
  KERNEL-13193 style: 调一下checobox的样式
  KERNEL-13193 style: 调一下checobox的样式
  KERNEL-13158: 优化button
  KERNEL-13193 style: 调一下checobox的样式
  auto upgrade version to 2.0.20221025175433
  无jira fix: 修复BI.isWidthOrHeight
  无jira fix: 修复BI.isWidthOrHeight
  ...
es6
windy-许昊 2 years ago
parent
commit
2e68c55c3a
  1. 2
      demo/js/config/widget.js
  2. 4
      dist/fix/fix.compact.js
  3. 99
      examples/ThemeProvider.html
  4. 59
      examples/useContext.html
  5. 2
      package.json
  6. 19
      src/base/collection/collection.js
  7. 9
      src/base/combination/group.button.js
  8. 16
      src/base/combination/navigation.js
  9. 15
      src/base/combination/tab.js
  10. 20
      src/base/context.js
  11. 19
      src/base/grid/grid.js
  12. 16
      src/base/layer/layer.popup.js
  13. 4
      src/base/list/virtualgrouplist.js
  14. 4
      src/base/list/virtuallist.js
  15. 14
      src/base/single/1.text.js
  16. 23
      src/base/single/button/button.basic.js
  17. 2
      src/base/single/button/buttons/button.icon.js
  18. 18
      src/base/single/button/buttons/button.js
  19. 5
      src/base/single/editor/editor.js
  20. 15
      src/base/single/html/html.js
  21. 8
      src/base/single/label/abstract.label.js
  22. 2
      src/base/single/label/icon.label.js
  23. 4
      src/base/single/tip/tip.toast.js
  24. 2
      src/base/single/tip/tip.tooltip.js
  25. 6
      src/case/button/node/siwtcher.tree.node.js
  26. 6
      src/case/button/treeitem/treeitem.js
  27. 2
      src/case/calendar/calendar.date.item.js
  28. 2
      src/case/calendar/calendar.js
  29. 4
      src/case/colorchooser/colorchooser.js
  30. 6
      src/case/combo/icontextvaluecombo/combo.icontextvalue.js
  31. 9
      src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js
  32. 6
      src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js
  33. 6
      src/case/combo/textvaluecombo/combo.textvalue.js
  34. 24
      src/case/editor/editor.shelter.js
  35. 24
      src/case/editor/editor.sign.js
  36. 24
      src/case/editor/editor.state.js
  37. 4
      src/case/layer/panel.js
  38. 2
      src/case/linearsegment/button.linear.segment.js
  39. 2
      src/case/list/list.select.js
  40. 3
      src/case/segment/button.segment.js
  41. 2
      src/case/segment/segment.js
  42. 4
      src/case/tree/treeexpander/tree.expander.popup.js
  43. 8
      src/case/trigger/trigger.editor.js
  44. 20
      src/case/trigger/trigger.icon.text.js
  45. 5
      src/case/trigger/trigger.text.js
  46. 3
      src/case/trigger/trigger.text.select.small.js
  47. 2
      src/case/trigger/trigger.text.small.js
  48. 2
      src/core/2.base.js
  49. 44
      src/core/4.widget.js
  50. 26
      src/core/constant/var.js
  51. 5
      src/core/controller/controller.popover.js
  52. 5
      src/core/controller/controller.tooltips.js
  53. 2
      src/core/utils/events/mousemovetracker.js
  54. 10
      src/core/wrapper/layout.js
  55. 8
      src/core/wrapper/layout/layout.flow.js
  56. 8
      src/core/wrapper/layout/layout.inline.js
  57. 4
      src/core/wrapper/layout/layout.tape.js
  58. 2
      src/core/wrapper/layout/responsive/responsive.flex.horizontal.js
  59. 22
      src/core/wrapper/layout/sticky/sticky.horizontal.js
  60. 22
      src/core/wrapper/layout/sticky/sticky.vertical.js
  61. 11
      src/less/base/single/button/button.half.less
  62. 5
      src/less/base/single/editor/editor.textarea.less
  63. 13
      src/less/base/single/input/checkbox.less
  64. 13
      src/less/base/single/input/radio.less
  65. 296
      src/less/base/tree/ztree.less
  66. 90
      src/less/case/tree/tree.item.less
  67. 22
      src/less/core/utils/common.less
  68. 66
      src/less/resource/background.less
  69. 2
      src/less/visual.less
  70. 27
      src/less/widget/singleslider/slider/widget.slider.less
  71. 1
      src/less/widget/year/popup.year.less
  72. 4
      src/widget/date/calendar/popup.month.js
  73. 10
      src/widget/dynamicdate/dynamicdate.combo.js
  74. 2
      src/widget/dynamicdate/dynamicdate.param.item.js
  75. 6
      src/widget/dynamicdate/dynamicdate.popup.js
  76. 3
      src/widget/dynamicdate/dynamicdate.trigger.js
  77. 8
      src/widget/dynamicdatetime/dynamicdatetime.combo.js
  78. 6
      src/widget/dynamicdatetime/dynamicdatetime.popup.js
  79. 40
      src/widget/dynamicdatetime/dynamicdatetime.trigger.js
  80. 4
      src/widget/editor/editor.search.js
  81. 12
      src/widget/editor/editor.text.js
  82. 116
      src/widget/intervalslider/intervalslider.js
  83. 20
      src/widget/multilayerselecttree/multilayerselecttree.combo.js
  84. 2
      src/widget/multilayerselecttree/multilayerselecttree.popup.js
  85. 17
      src/widget/multilayersingletree/multilayersingletree.combo.js
  86. 2
      src/widget/multilayersingletree/multilayersingletree.popup.js
  87. 2
      src/widget/multiselect/multiselect.combo.js
  88. 2
      src/widget/multiselect/multiselect.combo.nobar.js
  89. 2
      src/widget/multiselect/multiselect.insert.combo.js
  90. 2
      src/widget/multiselect/multiselect.insert.combo.nobar.js
  91. 2
      src/widget/multiselect/multiselect.loader.nobar.js
  92. 4
      src/widget/multiselect/search/multiselect.search.insert.pane.js
  93. 7
      src/widget/multiselectlist/multiselectlist.insert.js
  94. 4
      src/widget/multiselecttree/multiselecttree.js
  95. 2
      src/widget/multitree/multi.tree.combo.js
  96. 2
      src/widget/multitree/multi.tree.insert.combo.js
  97. 2
      src/widget/multitree/multi.tree.list.combo.js
  98. 4
      src/widget/numbereditor/number.editor.js
  99. 102
      src/widget/numberinterval/numberinterval.js
  100. 2
      src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js
  101. Some files were not shown because too many files have changed in this diff Show More

2
demo/js/config/widget.js

@ -192,7 +192,7 @@ Demo.WIDGET_CONFIG = [{
value: "demo.number_interval" value: "demo.number_interval"
}, { }, {
id: 420, id: 420,
text: "滚动sliders", text: "数值滑块sliders",
value: "demo.slider" value: "demo.slider"
}, { }, {
pId: 4, pId: 4,

4
dist/fix/fix.compact.js vendored

@ -78,7 +78,7 @@
}, options); }, options);
}; };
function findStore (widget) { BI.Widget.findStore = function findStore (widget) {
if (target != null) { if (target != null) {
return target; return target;
} }
@ -110,7 +110,7 @@
return true; return true;
} }
if (this._store) { if (this._store) {
var store = findStore(this.options.context || this._parent || this.options.element || this._context); var store = BI.Widget.findStore(this.options.context || this._parent || this.options.element || this._context);
if (store) { if (store) {
pushTarget(store); pushTarget(store);
needPop = true; needPop = true;

99
examples/ThemeProvider.html

@ -0,0 +1,99 @@
<html>
<head>
<meta charset="utf-8">
<title></title>
<!-- <link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.min.css"/>
<script src="../dist/2.0/fineui.js"></script> -->
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css"/>
<!-- <script src="http://fanruan.design/fineui/2.0/fineui.min.js"></script>-->
<script src="http://localhost:9001/fineui.js"></script>
</head>
<body>
<div id="wrapper"></div>
<script>
var Model = BI.inherit(BI.Model, {
state: function () {
return {
theme: "light"
};
},
childContext: ["theme"],
actions: {
toggle: function () {
this.model.theme = this.model.theme === "light" ? "dark" : "light";
}
}
});
BI.model("demo.model", Model);
var Child = BI.inherit(BI.Widget, {
render: function () {
var label;
return {
type: "bi.context",
context: "theme",
watch: function (newValue, oldValue) {
label.setText(newValue);
},
items: [(context) => {
return {
type: "bi.label",
height: 30,
ref: function (_ref) {
label = _ref;
},
text: context.model.theme
}
}]
};
}
});
BI.shortcut("demo.child", Child);
var Widget = BI.inherit(BI.Widget, {
props: {
baseCls: "my-parent"
},
_store: function () {
return BI.Models.getModel("demo.model");
},
setup: function () {
var child;
var store = BI.useStore();
return function () {
return {
type: "bi.vertical",
vgap: 20,
items: [{
type: "demo.child",
ref: function (_ref) {
child = _ref;
}
}, {
type: "bi.button",
text: "改变主题",
handler: function () {
store.toggle();
}
}]
};
};
}
});
BI.shortcut("demo.parent", Widget);
BI.createWidget({
type: "bi.absolute",
items: [{
el: {
type: "demo.parent"
},
top: 100,
left: 100
}],
element: "#wrapper"
});
</script>
</body>
</html>

59
examples/useContext.html

@ -5,8 +5,15 @@
<!-- <link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.min.css"/> <!-- <link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.min.css"/>
<script src="../dist/2.0/fineui.js"></script> --> <script src="../dist/2.0/fineui.js"></script> -->
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css"/> <link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css"/>
<script src="http://fanruan.design/fineui/2.0/fineui.min.js"></script> <!-- <script src="http://fanruan.design/fineui/2.0/fineui.min.js"></script>-->
<script src="http://localhost:9001/fineui.js"></script>
</head> </head>
<style>
.my-parent {
--css-scale: 1;
font-size: calc(var(--css-scale) * 14px);
}
</style>
<body> <body>
<div id="wrapper"></div> <div id="wrapper"></div>
<script> <script>
@ -14,7 +21,8 @@
var Model = BI.inherit(BI.Model, { var Model = BI.inherit(BI.Model, {
state: function () { state: function () {
return { return {
expand: false expand: false,
cssScale: 2.0
}; };
}, },
childContext: ["text"], childContext: ["text"],
@ -33,6 +41,36 @@
}); });
BI.model("demo.model", Model); BI.model("demo.model", Model);
var oldFormat = BI.pixFormat;
BI.pixFormat = function (pix, border) {
var context = BI.useContext("cssScale");
if (!context) {
return oldFormat.apply(this, arguments);
}
if (!BI.isNumber(pix)) {
return pix;
}
if (border > 0) {
return "calc(var(--css-scale) * " + pix + "px" + " - " + border + "px"+")";
}
return "calc(var(--css-scale) * " + pix + "px)";
};
var oldPix = BI.toPix;
BI.toPix = function (pix, border) {
var context = BI.useContext("cssScale");
if (!context) {
return oldPix.apply(this, arguments);
}
if (!BI.isNumber(pix)) {
return pix;
}
if (border > 0) {
return "calc(var(--css-scale) * " + pix + "px" + " - " + border + "px"+")";
}
return "calc(var(--css-scale) * " + pix + "px)";
};
var Child = BI.inherit(BI.Widget, { var Child = BI.inherit(BI.Widget, {
render: function () { render: function () {
var label; var label;
@ -45,6 +83,7 @@
// }); // });
return { return {
type: "bi.label", type: "bi.label",
height: 30,
ref: function (_ref) { ref: function (_ref) {
label = _ref; label = _ref;
}, },
@ -60,6 +99,9 @@
BI.shortcut("demo.child", Child); BI.shortcut("demo.child", Child);
var Widget = BI.inherit(BI.Widget, { var Widget = BI.inherit(BI.Widget, {
props: {
baseCls: "my-parent"
},
_store: function () { _store: function () {
return BI.Models.getModel("demo.model"); return BI.Models.getModel("demo.model");
}, },
@ -67,6 +109,7 @@
var child; var child;
var store = BI.useStore(); var store = BI.useStore();
return function () { return function () {
this.element[0].style.setProperty('--css-scale', store.model.cssScale);
return { return {
type: "bi.vertical", type: "bi.vertical",
vgap: 20, vgap: 20,
@ -75,6 +118,18 @@
ref: function (_ref) { ref: function (_ref) {
child = _ref; child = _ref;
} }
}, {
type: "bi.dynamic_date_combo",
supportDynamic: false,
width: 200,
value: {
type: 1,
value: {
year: 2012,
month: 3,
day: 15
}
}
}] }]
}; };
}; };

2
package.json

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

19
src/base/collection/collection.js

@ -187,20 +187,11 @@ BI.CollectionView = BI.inherit(BI.Widget, {
var index = this.renderedKeys[datum.index] && this.renderedKeys[datum.index][1]; var index = this.renderedKeys[datum.index] && this.renderedKeys[datum.index][1];
var child; var child;
if (index >= 0) { if (index >= 0) {
// if (datum.width !== this.renderedCells[index]._width) {
// this.renderedCells[index]._width = datum.width;
this.renderedCells[index].el.setWidth(datum.width); this.renderedCells[index].el.setWidth(datum.width);
// }
// if (datum.height !== this.renderedCells[index]._height) {
// this.renderedCells[index]._height = datum.height;
this.renderedCells[index].el.setHeight(datum.height); this.renderedCells[index].el.setHeight(datum.height);
// } // 这里只使用px
// if (this.renderedCells[index]._left !== datum.x) { this.renderedCells[index].el.element.css("left", datum.x + "px");
this.renderedCells[index].el.element.css("left", datum.x / BI.pixRatio + BI.pixUnit); this.renderedCells[index].el.element.css("top", datum.y + "px");
// }
// if (this.renderedCells[index]._top !== datum.y) {
this.renderedCells[index].el.element.css("top", datum.y / BI.pixRatio + BI.pixUnit);
// }
renderedCells.push(child = this.renderedCells[index]); renderedCells.push(child = this.renderedCells[index]);
} else { } else {
var item = o.itemFormatter(o.items[datum.index], datum.index); var item = o.itemFormatter(o.items[datum.index], datum.index);
@ -215,8 +206,8 @@ BI.CollectionView = BI.inherit(BI.Widget, {
})); }));
renderedCells.push({ renderedCells.push({
el: child, el: child,
left: datum.x, left: datum.x + "px",
top: datum.y, top: datum.y + "px",
_left: datum.x, _left: datum.x,
_top: datum.y, _top: datum.y,
// _width: datum.width, // _width: datum.width,

9
src/base/combination/group.button.js

@ -42,9 +42,14 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
}, },
_createBtns: function (items) { _createBtns: function (items) {
return BI.createWidgets(BI.createItems(items, { var btns;
BI.Widget.execWithContext(this, function () {
btns = BI.createWidgets(BI.createItems(items, {
type: "bi.text_button", type: "bi.text_button",
}), this); }));
});
return btns;
}, },
_btnsCreator: function (items) { _btnsCreator: function (items) {

16
src/base/combination/navigation.js

@ -43,10 +43,10 @@ BI.Navigation = BI.inherit(BI.Widget, {
return self.showIndex + v; return self.showIndex + v;
}, },
cardCreator: function (v) { cardCreator: function (v) {
var card = o.cardCreator(v); BI.Widget.execWithContext(self, function () {
self.cardMap[v] = card; self.cardMap[v] = o.cardCreator(v);
});
return card; return self.cardMap[v];
}, },
afterCardCreated: BI.bind(this.afterCardCreated, this), afterCardCreated: BI.bind(this.afterCardCreated, this),
afterCardShow: BI.bind(this.afterCardShow, this), afterCardShow: BI.bind(this.afterCardShow, this),
@ -103,10 +103,12 @@ BI.Navigation = BI.inherit(BI.Widget, {
}, },
_assertCard: function (v) { _assertCard: function (v) {
var self = this, o = this.options;
if (!this.layout.isCardExisted(v)) { if (!this.layout.isCardExisted(v)) {
var card = this.options.cardCreator(v); BI.Widget.execWithContext(self, function () {
this.cardMap[v] = card; self.cardMap[v] = o.cardCreator(v);
this.layout.addCardByName(v, card); });
this.layout.addCardByName(v, this.cardMap[v]);
this.afterCardCreated(v); this.afterCardCreated(v);
} }
}, },

15
src/base/combination/tab.js

@ -43,10 +43,11 @@ BI.Tab = BI.inherit(BI.Widget, {
eventObj: this.tab, eventObj: this.tab,
cardLayout: this.layout, cardLayout: this.layout,
cardCreator: function (v) { cardCreator: function (v) {
var card = o.cardCreator.apply(self, arguments); BI.Widget.execWithContext(self, function () {
self.cardMap[v] = card; self.cardMap[v] = o.cardCreator.apply(self, arguments);
});
return card; return self.cardMap[v];
}, },
afterCardShow: function (v) { afterCardShow: function (v) {
self._deleteOtherCards(v); self._deleteOtherCards(v);
@ -71,10 +72,12 @@ BI.Tab = BI.inherit(BI.Widget, {
}, },
_assertCard: function (v) { _assertCard: function (v) {
var self = this, o = this.options;
if (!this.layout.isCardExisted(v)) { if (!this.layout.isCardExisted(v)) {
var card = this.options.cardCreator(v); BI.Widget.execWithContext(this, function () {
this.cardMap[v] = card; self.cardMap[v] = o.cardCreator.apply(self, arguments);
this.layout.addCardByName(v, card); });
this.layout.addCardByName(v, this.cardMap[v]);
} }
}, },

20
src/base/context.js

@ -15,31 +15,33 @@ BI.Context = BI.inherit(BI.Widget, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
this.context = BI.createWidget(o.items[0] || o.el, { if (o.context) {
this.context = BI.useContext(o.context);
}
this.widget = BI.createWidget((o.items[0] || o.el)(this.context), {
element: this, element: this,
}); });
this.context.on(BI.Controller.EVENT_CHANGE, function () { this.widget.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}); });
}, },
created: function () { __initWatch: function () {
BI.Context.superclass.__initWatch.call(this);
var o = this.options; var o = this.options;
if (o.context) { BI.watch(this.context, o.context, o.watch);
BI.watch(o.context, o.watch);
}
}, },
setValue: function (v) { setValue: function (v) {
this.context.setValue(v); this.widget.setValue(v);
}, },
getValue: function () { getValue: function () {
return this.context.getValue(); return this.widget.getValue();
}, },
populate: function () { populate: function () {
this.context.populate.apply(this, arguments); this.widget.populate.apply(this, arguments);
}, },
}); });
BI.shortcut("bi.context", BI.Context); BI.shortcut("bi.context", BI.Context);

19
src/base/grid/grid.js

@ -185,20 +185,11 @@ BI.GridView = BI.inherit(BI.Widget, {
var index = this.renderedKeys[key] && this.renderedKeys[key][2]; var index = this.renderedKeys[key] && this.renderedKeys[key][2];
var child; var child;
if (index >= 0) { if (index >= 0) {
// if (columnDatum.size !== this.renderedCells[index]._width) {
// this.renderedCells[index]._width = columnDatum.size;
this.renderedCells[index].el.setWidth(columnDatum.size); this.renderedCells[index].el.setWidth(columnDatum.size);
// }
// if (rowDatum.size !== this.renderedCells[index]._height) {
// this.renderedCells[index]._height = rowDatum.size;
this.renderedCells[index].el.setHeight(rowDatum.size); this.renderedCells[index].el.setHeight(rowDatum.size);
// } // 这里只使用px
// if (this.renderedCells[index]._left !== columnDatum.offset + horizontalOffsetAdjustment) { this.renderedCells[index].el.element.css("left", columnDatum.offset + horizontalOffsetAdjustment + "px");
this.renderedCells[index].el.element.css("left", (columnDatum.offset + horizontalOffsetAdjustment) / BI.pixRatio + BI.pixUnit); this.renderedCells[index].el.element.css("top", rowDatum.offset + verticalOffsetAdjustment + "px");
// }
// if (this.renderedCells[index]._top !== rowDatum.offset + verticalOffsetAdjustment) {
this.renderedCells[index].el.element.css("top", (rowDatum.offset + verticalOffsetAdjustment) / BI.pixRatio + BI.pixUnit);
// }
child = this.renderedCells[index].el; child = this.renderedCells[index].el;
renderedCells.push(this.renderedCells[index]); renderedCells.push(this.renderedCells[index]);
} else { } else {
@ -216,8 +207,8 @@ BI.GridView = BI.inherit(BI.Widget, {
}), this); }), this);
renderedCells.push({ renderedCells.push({
el: child, el: child,
left: columnDatum.offset + horizontalOffsetAdjustment, left: columnDatum.offset + horizontalOffsetAdjustment + "px",
top: rowDatum.offset + verticalOffsetAdjustment, top: rowDatum.offset + verticalOffsetAdjustment + "px",
_left: columnDatum.offset + horizontalOffsetAdjustment, _left: columnDatum.offset + horizontalOffsetAdjustment,
_top: rowDatum.offset + verticalOffsetAdjustment, _top: rowDatum.offset + verticalOffsetAdjustment,
// _width: columnDatum.size, // _width: columnDatum.size,

16
src/base/layer/layer.popup.js

@ -60,8 +60,8 @@ BI.PopupView = BI.inherit(BI.Widget, {
} }
this.element.css({ this.element.css({
"z-index": BI.zIndex_popup, "z-index": BI.zIndex_popup,
"min-width": BI.isNumeric(o.minWidth) ? (o.minWidth / BI.pixRatio + BI.pixUnit) : o.minWidth, "min-width": BI.pixFormat(o.minWidth),
"max-width": BI.isNumeric(o.maxWidth) ? (o.maxWidth / BI.pixRatio + BI.pixUnit) : o.maxWidth, "max-width": BI.pixFormat(o.maxWidth),
}).bind({ click: fn }); }).bind({ click: fn });
this.element.bind("mousewheel", fn); this.element.bind("mousewheel", fn);
@ -135,11 +135,11 @@ BI.PopupView = BI.inherit(BI.Widget, {
var o = this.options; var o = this.options;
this.button_group = BI.createWidget(o.el, { type: "bi.button_group", value: o.value }); this.button_group = BI.createWidget(o.el, { type: "bi.button_group", value: o.value });
this.button_group.element.css({ this.button_group.element.css({
"min-height": BI.isNumeric(o.minHeight) ? (o.minHeight / BI.pixRatio + BI.pixUnit) : o.minHeight, "min-height": BI.pixFormat(o.minHeight),
"padding-top": o.innerVgap / BI.pixRatio + BI.pixUnit, "padding-top": BI.pixFormat(o.innerVgap),
"padding-bottom": o.innerVgap / BI.pixRatio + BI.pixUnit, "padding-bottom": BI.pixFormat(o.innerVgap),
"padding-left": o.innerHgap / BI.pixRatio + BI.pixUnit, "padding-left": BI.pixFormat(o.innerHgap),
"padding-right": o.innerHgap / BI.pixRatio + BI.pixUnit, "padding-right": BI.pixFormat(o.innerHgap),
}); });
return this.button_group; return this.button_group;
@ -411,7 +411,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
toolHeight = ((this.tool && this.tool.attr("height")) || 24) * ((this.tool && this.tool.isVisible()) ? 1 : 0); toolHeight = ((this.tool && this.tool.attr("height")) || 24) * ((this.tool && this.tool.isVisible()) ? 1 : 0);
var resetHeight = h - tbHeight - tabHeight - toolHeight - 2 * this.options.innerVgap; var resetHeight = h - tbHeight - tabHeight - toolHeight - 2 * this.options.innerVgap;
this.view.resetHeight ? this.view.resetHeight(resetHeight) : this.view.resetHeight ? this.view.resetHeight(resetHeight) :
this.view.element.css({ "max-height": resetHeight / BI.pixRatio + BI.pixUnit }); this.view.element.css({ "max-height": BI.pixFormat(resetHeight) });
}, },
setValue: function (selectedValues) { setValue: function (selectedValues) {

4
src/base/list/virtualgrouplist.js

@ -117,7 +117,7 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, {
var end = this.tree.leastUpperBound(minContentHeightTo); var end = this.tree.leastUpperBound(minContentHeightTo);
var items = []; var items = [];
var topHeight = this.tree.sumTo(Math.max(-1, start - 1)); var topHeight = this.tree.sumTo(Math.max(-1, start - 1));
this.topBlank.setHeight(topHeight); this.topBlank.setHeight(topHeight + "px");
if (this._isAutoHeight()) { if (this._isAutoHeight()) {
for (var i = (start < 0 ? 0 : start); i <= end && i <= this.renderedIndex; i++) { for (var i = (start < 0 ? 0 : start); i <= end && i <= this.renderedIndex; i++) {
var index = i * o.blockSize; var index = i * o.blockSize;
@ -125,7 +125,7 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, {
items.push(o.items[j]); items.push(o.items[j]);
} }
} }
this.bottomBlank.setHeight(this.tree.sumTo(this.renderedIndex) - this.tree.sumTo(Math.min(end, this.renderedIndex))); this.bottomBlank.setHeight(this.tree.sumTo(this.renderedIndex) - this.tree.sumTo(Math.min(end, this.renderedIndex)) + "px");
this.container.populate(items.map(function (item, i) { this.container.populate(items.map(function (item, i) {
return o.itemFormatter(item, (start < 0 ? 0 : start) * o.blockSize + i); return o.itemFormatter(item, (start < 0 ? 0 : start) * o.blockSize + i);
})); }));

4
src/base/list/virtuallist.js

@ -146,8 +146,8 @@ BI.VirtualList = BI.inherit(BI.Widget, {
} }
this.container.element.prepend(firstFragment); this.container.element.prepend(firstFragment);
this.container.element.append(lastFragment); this.container.element.append(lastFragment);
this.topBlank.setHeight(this.tree.sumTo(Math.max(-1, start - 1))); this.topBlank.setHeight(this.tree.sumTo(Math.max(-1, start - 1)) + "px");
this.bottomBlank.setHeight(this.tree.sumTo(this.renderedIndex) - this.tree.sumTo(Math.min(end, this.renderedIndex))); this.bottomBlank.setHeight(this.tree.sumTo(this.renderedIndex) - this.tree.sumTo(Math.min(end, this.renderedIndex)) + "px");
BI.each(needMount, function (i, child) { BI.each(needMount, function (i, child) {
child && child._mount(); child && child._mount();
}); });

14
src/base/single/1.text.js

@ -26,32 +26,32 @@
var self = this, o = this.options; var self = this, o = this.options;
if (o.hgap + o.lgap > 0) { if (o.hgap + o.lgap > 0) {
this.element.css({ this.element.css({
"padding-left": (o.hgap + o.lgap) / BI.pixRatio + BI.pixUnit, "padding-left": BI.pixFormat(o.hgap + o.lgap),
}); });
} }
if (o.hgap + o.rgap > 0) { if (o.hgap + o.rgap > 0) {
this.element.css({ this.element.css({
"padding-right": (o.hgap + o.rgap) / BI.pixRatio + BI.pixUnit, "padding-right": BI.pixFormat(o.hgap + o.rgap),
}); });
} }
if (o.vgap + o.tgap > 0) { if (o.vgap + o.tgap > 0) {
this.element.css({ this.element.css({
"padding-top": (o.vgap + o.tgap) / BI.pixRatio + BI.pixUnit, "padding-top": BI.pixFormat(o.vgap + o.tgap),
}); });
} }
if (o.vgap + o.bgap > 0) { if (o.vgap + o.bgap > 0) {
this.element.css({ this.element.css({
"padding-bottom": (o.vgap + o.bgap) / BI.pixRatio + BI.pixUnit, "padding-bottom": BI.pixFormat(o.vgap + o.bgap),
}); });
} }
if (BI.isWidthOrHeight(o.height)) { if (BI.isWidthOrHeight(o.height)) {
this.element.css({ lineHeight: BI.isNumber(o.height) ? (o.height / BI.pixRatio + BI.pixUnit) : o.height }); this.element.css({ lineHeight: BI.pixFormat(o.height) });
} }
if (BI.isWidthOrHeight(o.lineHeight)) { if (BI.isWidthOrHeight(o.lineHeight)) {
this.element.css({ lineHeight: BI.isNumber(o.lineHeight) ? (o.lineHeight / BI.pixRatio + BI.pixUnit) : o.lineHeight }); this.element.css({ lineHeight: BI.pixFormat(o.lineHeight) });
} }
if (BI.isWidthOrHeight(o.maxWidth)) { if (BI.isWidthOrHeight(o.maxWidth)) {
this.element.css({ maxWidth: BI.isNumber(o.maxWidth) ? (o.maxWidth / BI.pixRatio + BI.pixUnit) : o.maxWidth }); this.element.css({ maxWidth: BI.pixFormat(o.maxWidth) });
} }
this.element.css({ this.element.css({
textAlign: o.textAlign, textAlign: o.textAlign,

23
src/base/single/button/button.basic.js

@ -184,7 +184,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
var mouseDown = false; var mouseDown = false;
var interval; var interval;
hand.mousedown(function (e) { hand.mousedown(function (e) {
BI.Widget._renderEngine.createElement(document).bind("mouseup." + self.getName(), function (e) { BI.Widget._renderEngine.createElement(document).bind("mouseup." + self.getName(), function () {
interval && clearInterval(interval); interval && clearInterval(interval);
interval = null; interval = null;
mouseDown = false; mouseDown = false;
@ -193,13 +193,14 @@ BI.BasicButton = BI.inherit(BI.Single, {
if (mouseDown === true) { if (mouseDown === true) {
return; return;
} }
if (!self.isEnabled() || (self.isOnce() && self.isSelected())) { if (!self.isEnabled() || !self.isValid()) {
return; return;
} }
interval = setInterval(function () { if (self.isOnce() && self.isSelected()) {
if (self.isEnabled()) { return;
self.doClick();
} }
interval = setInterval(function () {
clk(e)
}, 180); }, 180);
mouseDown = true; mouseDown = true;
ev(e); ev(e);
@ -239,7 +240,10 @@ BI.BasicButton = BI.inherit(BI.Single, {
function clk(e) { function clk(e) {
ev(e); ev(e);
if (!self.isEnabled() || (self.isOnce() && self.isSelected())) { if (!self.isEnabled() || !self.isValid()) {
return;
}
if (self.isOnce() && self.isSelected()) {
return; return;
} }
if (BI.isKey(o.bubble) || BI.isFunction(o.bubble)) { if (BI.isKey(o.bubble) || BI.isFunction(o.bubble)) {
@ -335,16 +339,17 @@ BI.BasicButton = BI.inherit(BI.Single, {
}, },
_doClick: function (e) { _doClick: function (e) {
if (this.isValid()) { if (!this.isEnabled() || !this.isValid()) {
return;
}
var isIntercepted = this.beforeClick(e); var isIntercepted = this.beforeClick(e);
// 如果事件已经被消费掉了,就不再触发点击事件 // 如果事件已经被消费掉了,就不再触发点击事件
if (isIntercepted) { if (isIntercepted) {
return; return;
} }
}
this._trigger(e); this._trigger(e);
if (this.isValid()) { if (this.isEnabled() && this.isValid()) {
this.doClick(e); this.doClick(e);
} }
}, },

2
src/base/single/button/buttons/button.icon.js

@ -31,7 +31,7 @@ BI.IconButton = BI.inherit(BI.BasicButton, {
height: o.iconHeight, height: o.iconHeight,
}); });
if (BI.isNumber(o.height) && o.height > 0 && BI.isNull(o.iconWidth) && BI.isNull(o.iconHeight)) { if (BI.isNumber(o.height) && o.height > 0 && BI.isNull(o.iconWidth) && BI.isNull(o.iconHeight)) {
this.element.css("lineHeight", o.height / BI.pixRatio + BI.pixUnit); this.element.css("lineHeight", BI.pixFormat(o.height));
BI.createWidget({ BI.createWidget({
type: "bi.default", type: "bi.default",
element: this, element: this,

18
src/base/single/button/buttons/button.js

@ -73,13 +73,13 @@
// 由于button默认情况下有个边框,所以要主动算行高 // 由于button默认情况下有个边框,所以要主动算行高
var lineHeight, textHeight = o.textHeight; var lineHeight, textHeight = o.textHeight;
var hasBorder = false
if (BI.isNumber(o.height)) { if (BI.isNumber(o.height)) {
if (!isVertical(o.iconPosition)) { if (!isVertical(o.iconPosition)) {
if (o.clear || o.block || o.light) { if (!(o.clear && o.block && o.light)) {
lineHeight = o.height; hasBorder = true;
} else {
lineHeight = o.height - 2;
} }
lineHeight = o.height;
} else { } else {
lineHeight = textHeight; lineHeight = textHeight;
} }
@ -98,8 +98,8 @@
type: "bi.icon_label", type: "bi.icon_label",
cls: o.loading ? loadingCls : (o.iconCls || o.icon), cls: o.loading ? loadingCls : (o.iconCls || o.icon),
width: this._const.iconWidth, width: this._const.iconWidth,
height: lineHeight, height: BI.toPix(lineHeight, hasBorder ? 2 : 0),
lineHeight: lineHeight, lineHeight: BI.toPix(lineHeight, hasBorder ? 2 : 0),
// 不设置,自定义按钮无法居中 // 不设置,自定义按钮无法居中
iconWidth: o.iconWidth, iconWidth: o.iconWidth,
iconHeight: o.iconHeight, iconHeight: o.iconHeight,
@ -120,8 +120,8 @@
whiteSpace: o.whiteSpace, whiteSpace: o.whiteSpace,
textAlign: o.textAlign, textAlign: o.textAlign,
textWidth: textWidth, textWidth: textWidth,
textHeight: textHeight, textHeight: BI.toPix(textHeight, hasBorder ? 2 : 0),
height: lineHeight, height: BI.toPix(lineHeight, hasBorder ? 2 : 0),
value: o.value, value: o.value,
title: null, title: null,
}); });
@ -163,7 +163,7 @@
}); });
if (o.minWidth > 0) { if (o.minWidth > 0) {
this.element.css({ "min-width": o.minWidth / BI.pixRatio + BI.pixUnit }); this.element.css({ "min-width": BI.pixFormat(o.minWidth) });
} }
}, },

5
src/base/single/editor/editor.js

@ -344,6 +344,11 @@ BI.Editor = BI.inherit(BI.Single, {
return this.editor.isValid(); return this.editor.isValid();
}, },
setValid: function (b) {
this.editor.setValid(b);
this._checkError();
},
destroyed: function () { destroyed: function () {
BI.Bubbles.remove(this.getName()); BI.Bubbles.remove(this.getName());
}, },

15
src/base/single/html/html.js

@ -25,33 +25,36 @@ BI.Html = BI.inherit(BI.Single, {
var self = this, o = this.options; var self = this, o = this.options;
if (o.hgap + o.lgap > 0) { if (o.hgap + o.lgap > 0) {
this.element.css({ this.element.css({
"padding-left": (o.hgap + o.lgap) / BI.pixRatio + BI.pixUnit, "padding-left": BI.pixFormat(o.hgap + o.lgap),
}); });
} }
if (o.hgap + o.rgap > 0) { if (o.hgap + o.rgap > 0) {
this.element.css({ this.element.css({
"padding-right": (o.hgap + o.rgap) / BI.pixRatio + BI.pixUnit, "padding-right": BI.pixFormat(o.hgap + o.rgap),
}); });
} }
if (o.vgap + o.tgap > 0) { if (o.vgap + o.tgap > 0) {
this.element.css({ this.element.css({
"padding-top": (o.vgap + o.tgap) / BI.pixRatio + BI.pixUnit, "padding-top": BI.pixFormat(o.vgap + o.tgap),
}); });
} }
if (o.vgap + o.bgap > 0) { if (o.vgap + o.bgap > 0) {
this.element.css({ this.element.css({
"padding-bottom": (o.vgap + o.bgap) / BI.pixRatio + BI.pixUnit, "padding-bottom": BI.pixFormat(o.vgap + o.bgap),
}); });
} }
if (BI.isNumber(o.height)) { if (BI.isNumber(o.height)) {
this.element.css({ lineHeight: o.height / BI.pixRatio + BI.pixUnit }); this.element.css({ lineHeight: BI.pixFormat(o.height) });
} }
if (BI.isNumber(o.lineHeight)) { if (BI.isNumber(o.lineHeight)) {
this.element.css({ lineHeight: o.lineHeight / BI.pixRatio + BI.pixUnit }); this.element.css({ lineHeight: BI.pixFormat(o.lineHeight) });
} }
if (BI.isWidthOrHeight(o.maxWidth)) { if (BI.isWidthOrHeight(o.maxWidth)) {
this.element.css({ maxWidth: o.maxWidth }); this.element.css({ maxWidth: o.maxWidth });
} }
if (BI.isNumber(o.maxWidth)) {
this.element.css({ maxWidth: BI.pixFormat(o.maxWidth) })
}
this.element.css({ this.element.css({
textAlign: o.textAlign, textAlign: o.textAlign,
whiteSpace: o.whiteSpace, whiteSpace: o.whiteSpace,

8
src/base/single/label/abstract.label.js

@ -109,7 +109,7 @@
} }
if (BI.isNumber(o.height) && o.height > 0) { // 1.4 if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({ this.element.css({
"line-height": o.height / BI.pixRatio + BI.pixUnit, "line-height": BI.pixFormat(o.height),
}); });
json.textAlign = o.textAlign; json.textAlign = o.textAlign;
delete json.maxWidth; delete json.maxWidth;
@ -183,7 +183,7 @@
} }
if (BI.isNumber(o.height) && o.height > 0) { // 1.8 if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({ this.element.css({
"line-height": o.height / BI.pixRatio + BI.pixUnit, "line-height": BI.pixFormat(o.height),
}); });
json.textAlign = o.textAlign; json.textAlign = o.textAlign;
delete json.maxWidth; delete json.maxWidth;
@ -263,7 +263,7 @@
if (BI.isNumber(o.height) && o.height > 0) { // 2.3 if (BI.isNumber(o.height) && o.height > 0) { // 2.3
if (o.whiteSpace !== "normal") { if (o.whiteSpace !== "normal") {
this.element.css({ this.element.css({
"line-height": (o.height - (o.vgap * 2)) / BI.pixRatio + BI.pixUnit, "line-height": BI.pixFormat(o.height - (o.vgap * 2)),
}); });
} }
delete json.maxWidth; delete json.maxWidth;
@ -325,7 +325,7 @@
if (BI.isNumber(o.height) && o.height > 0) { if (BI.isNumber(o.height) && o.height > 0) {
if (o.whiteSpace !== "normal") { if (o.whiteSpace !== "normal") {
this.element.css({ this.element.css({
"line-height": (o.height - (o.vgap * 2)) / BI.pixRatio + BI.pixUnit, "line-height": BI.pixFormat(o.height - (o.vgap * 2)),
}); });
} }
delete json.maxWidth; delete json.maxWidth;

2
src/base/single/label/icon.label.js

@ -29,7 +29,7 @@ BI.IconLabel = BI.inherit(BI.Single, {
height: o.iconHeight, height: o.iconHeight,
}); });
if (BI.isNumber(o.height) && o.height > 0 && BI.isNull(o.iconWidth) && BI.isNull(o.iconHeight)) { if (BI.isNumber(o.height) && o.height > 0 && BI.isNull(o.iconWidth) && BI.isNull(o.iconHeight)) {
this.element.css("lineHeight", (o.lineHeight || o.height) / BI.pixRatio + BI.pixUnit); this.element.css("lineHeight", BI.pixFormat(o.lineHeight || o.height));
BI.createWidget({ BI.createWidget({
type: "bi.default", type: "bi.default",
element: this, element: this,

4
src/base/single/tip/tip.toast.js

@ -30,8 +30,8 @@ BI.Toast = BI.inherit(BI.Tip, {
render: function () { render: function () {
var self = this, o = this.options, c = this._const; var self = this, o = this.options, c = this._const;
this.element.css({ this.element.css({
minWidth: (o.closable ? c.closableMinWidth : c.minWidth) / BI.pixRatio + BI.pixUnit, minWidth: BI.pixFormat(o.closable ? c.closableMinWidth : c.minWidth),
maxWidth: (o.closable ? c.closableMaxWidth : c.maxWidth) / BI.pixRatio + BI.pixUnit, maxWidth: BI.pixFormat(o.closable ? c.closableMaxWidth : c.maxWidth),
}); });
this.element.addClass("toast-" + o.level); this.element.addClass("toast-" + o.level);
function fn(e) { function fn(e) {

2
src/base/single/tip/tip.tooltip.js

@ -73,7 +73,7 @@ BI.Tooltip = BI.inherit(BI.Tip, {
}, },
setWidth: function (width) { setWidth: function (width) {
this.element.width(width - 2 * this._const.hgap); this.element.width(BI.pixFormat(width - 2 * this._const.hgap));
}, },
setText: function (text) { setText: function (text) {

6
src/case/button/node/siwtcher.tree.node.js

@ -29,13 +29,13 @@ BI.TreeNodeSwitcher = BI.inherit(BI.NodeButton, {
return BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? ["tree-solid-collapse-icon-type1", "tree-solid-expand-icon-type1"] : ["tree-collapse-icon-type1", "tree-expand-icon-type1"]; return BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? ["tree-solid-collapse-icon-type1", "tree-solid-expand-icon-type1"] : ["tree-collapse-icon-type1", "tree-expand-icon-type1"];
} else if (options.layer === 0 && options.isFirstNode) { } else if (options.layer === 0 && options.isFirstNode) {
// 第一层,并且是第一个节点 // 第一层,并且是第一个节点
return BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? ["tree-solid-collapse-icon-type2", "tree-solid-expand-icon-type2"] : ["tree-collapse-icon-type2", "tree-expand-icon-type2"]; return BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? ["tree-solid-collapse-icon-type1", "tree-solid-expand-icon-type1"] : ["tree-collapse-icon-type2", "tree-expand-icon-type2"];
} else if (options.isLastNode) { } else if (options.isLastNode) {
// 最后一个节点 // 最后一个节点
return BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? ["tree-solid-collapse-icon-type4", "tree-solid-expand-icon-type4"] : ["tree-collapse-icon-type4", "tree-expand-icon-type4"]; return BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? ["tree-solid-collapse-icon-type1", "tree-solid-expand-icon-type1"] : ["tree-collapse-icon-type3", "tree-expand-icon-type3"];
} else { } else {
// 其他情况 // 其他情况
return BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? ["tree-solid-collapse-icon-type3", "tree-solid-expand-icon-type3"] : ["tree-collapse-icon-type3", "tree-expand-icon-type3"]; return BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? ["tree-solid-collapse-icon-type1", "tree-solid-expand-icon-type1"] : ["tree-collapse-icon-type4", "tree-expand-icon-type4"];
} }
}, },

6
src/case/button/treeitem/treeitem.js

@ -57,11 +57,11 @@ BI.BasicTreeItem = BI.inherit(BI.NodeButton, {
if (options.layer === 0 && options.isFirstNode && options.isLastNode) { if (options.layer === 0 && options.isFirstNode && options.isLastNode) {
return ""; return "";
} else if (options.layer === 0 && options.isFirstNode) { } else if (options.layer === 0 && options.isFirstNode) {
return BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? "first-solid-line-conn-background" : "first-line-conn-background"; return BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? "tree-first-solid-line-conn-background" : "first-line-conn-background";
} else if (options.isLastNode) { } else if (options.isLastNode) {
return BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? "last-solid-line-conn-background" : "last-line-conn-background"; return BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? "tree-last-solid-line-conn-background" : "last-line-conn-background";
} else { } else {
return BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? "mid-solid-line-conn-background" : "mid-line-conn-background"; return BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? "tree-mid-solid-line-conn-background" : "mid-line-conn-background";
} }
}, },

2
src/case/calendar/calendar.date.item.js

@ -4,6 +4,7 @@
BI.CalendarDateItem = BI.inherit(BI.BasicButton, { BI.CalendarDateItem = BI.inherit(BI.BasicButton, {
props: function() { props: function() {
return { return {
baseCls: "bi-calendar-date-item",
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT + 8, height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT + 8,
} }
}, },
@ -17,7 +18,6 @@ BI.CalendarDateItem = BI.inherit(BI.BasicButton, {
type: "bi.text_item", type: "bi.text_item",
cls: "bi-border-radius bi-list-item-select", cls: "bi-border-radius bi-list-item-select",
textAlign: "center", textAlign: "center",
whiteSpace: "normal",
text: o.text, text: o.text,
value: o.value, value: o.value,
ref: function () { ref: function () {

2
src/case/calendar/calendar.js

@ -158,8 +158,6 @@ BI.Calendar = BI.inherit(BI.Widget, {
var month = td.lastMonth ? o.month - 1 : (td.nextMonth ? o.month + 1 : o.month); var month = td.lastMonth ? o.month - 1 : (td.nextMonth ? o.month + 1 : o.month);
return BI.extend(td, { return BI.extend(td, {
type: "bi.calendar_date_item", type: "bi.calendar_date_item",
textAlign: "center",
whiteSpace: "normal",
once: false, once: false,
forceSelected: true, forceSelected: true,
value: o.year + "-" + month + "-" + td.text, value: o.year + "-" + month + "-" + td.text,

4
src/case/colorchooser/colorchooser.js

@ -36,8 +36,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
self.trigger = _ref; self.trigger = _ref;
}, },
value: o.value, value: o.value,
width: o.el.type ? o.width : o.width - 2, width: o.el.type ? o.width : BI.toPix(o.width, 2),
height: o.el.type ? o.height : o.height - 2 height: o.el.type ? o.height : BI.toPix(o.height, 2)
}, o.el), }, o.el),
popup: () => ({ popup: () => ({
el: BI.extend({ el: BI.extend({

6
src/case/combo/icontextvaluecombo/combo.icontextvalue.js

@ -15,8 +15,6 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, {
_init: function () { _init: function () {
var self = this, o = this.options; var self = this, o = this.options;
BI.isNumeric(o.width) && (o.width -= 2);
BI.isNumeric(o.height) && (o.height -= 2);
o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) {
self.setValue(newValue); self.setValue(newValue);
}) : o.value; }) : o.value;
@ -28,7 +26,7 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, {
type: "bi.select_icon_text_trigger", type: "bi.select_icon_text_trigger",
cls: "icon-text-value-trigger", cls: "icon-text-value-trigger",
items: o.items, items: o.items,
height: o.height, height: BI.toPix(o.height, 2),
text: o.text, text: o.text,
iconCls: o.iconCls, iconCls: o.iconCls,
value: o.value, value: o.value,
@ -56,6 +54,8 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, {
}); });
this.textIconCombo = BI.createWidget({ this.textIconCombo = BI.createWidget({
type: "bi.combo", type: "bi.combo",
height: BI.toPix(o.height, 2),
width: BI.toPix(o.width, 2),
element: this, element: this,
container: o.container, container: o.container,
direction: o.direction, direction: o.direction,

9
src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js

@ -23,16 +23,13 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
self.populate(newValue); self.populate(newValue);
}) : o.items; }) : o.items;
var height = BI.isNumeric(o.height) ? (o.height - (o.simple ? 1 : 2)) : o.height;
var width = BI.isNumeric(o.width) ? (o.width - 2) : o.width;
return { return {
type: "bi.combo", type: "bi.combo",
cls: (o.simple ? "bi-border-bottom" : "bi-border bi-border-radius") + " bi-focus-shadow", cls: (o.simple ? "bi-border-bottom" : "bi-border bi-border-radius") + " bi-focus-shadow",
container: o.container, container: o.container,
adjustLength: 2, adjustLength: 2,
height: height, height: BI.toPix(o.height, o.simple ? 1 : 2),
width: width, width: BI.toPix(o.width, 2),
ref: function () { ref: function () {
self.combo = this; self.combo = this;
}, },
@ -44,7 +41,7 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
self.trigger = this; self.trigger = this;
}, },
items: o.items, items: o.items,
height: height, height: BI.toPix(o.height, o.simple ? 1 : 2),
text: o.text, text: o.text,
defaultText: o.defaultText, defaultText: o.defaultText,
value: o.value, value: o.value,

6
src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js

@ -16,8 +16,6 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
_init: function () { _init: function () {
var self = this, o = this.options; var self = this, o = this.options;
BI.isNumeric(o.width) && (o.width -= 2);
BI.isNumeric(o.height) && (o.height -= 2);
o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) {
self.setValue(newValue); self.setValue(newValue);
}) : o.value; }) : o.value;
@ -29,7 +27,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
type: "bi.select_text_trigger", type: "bi.select_text_trigger",
cls: "text-value-trigger", cls: "text-value-trigger",
items: o.items, items: o.items,
height: o.height, height: BI.toPix(o.height, 2),
text: o.text, text: o.text,
value: o.value value: o.value
}); });
@ -52,6 +50,8 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
container: o.container, container: o.container,
direction: o.direction, direction: o.direction,
element: this, element: this,
width: BI.toPix(o.width, 2),
height: BI.toPix(o.height, 2),
adjustLength: 2, adjustLength: 2,
el: this.trigger, el: this.trigger,
popup: { popup: {

6
src/case/combo/textvaluecombo/combo.textvalue.js

@ -22,8 +22,6 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
_init: function () { _init: function () {
var self = this, o = this.options; var self = this, o = this.options;
BI.isNumeric(o.width) && (o.width -= (o.simple ? 0 : 2));
BI.isNumeric(o.height) && (o.height -= (o.simple ? 1 : 2));
o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) {
self.setValue(newValue); self.setValue(newValue);
}) : o.value; }) : o.value;
@ -57,7 +55,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
ref: ref => this.trigger = ref, ref: ref => this.trigger = ref,
cls: "text-value-trigger", cls: "text-value-trigger",
items: o.items, items: o.items,
height: o.height, height: BI.toPix(o.height, o.simple ? 1 : 2),
text: o.text, text: o.text,
value: o.value, value: o.value,
title, title,
@ -118,6 +116,8 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
return { return {
type: "bi.combo", type: "bi.combo",
height: BI.toPix(o.height, 2),
width: BI.toPix(o.width, 2),
ref: ref => this.combo = ref, ref: ref => this.combo = ref,
container: o.container, container: o.container,
direction: o.direction, direction: o.direction,

24
src/case/editor/editor.shelter.js

@ -58,17 +58,6 @@ BI.ShelterEditor = BI.inherit(BI.Widget, {
height: o.height, height: o.height,
hgap: o.hgap + 2 hgap: o.hgap + 2
}); });
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.text,
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
this.text.on(BI.Controller.EVENT_CHANGE, function () { this.text.on(BI.Controller.EVENT_CHANGE, function () {
arguments[2] = self; arguments[2] = self;
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -134,10 +123,17 @@ BI.ShelterEditor = BI.inherit(BI.Widget, {
self.fireEvent(BI.ShelterEditor.EVENT_EMPTY, arguments); self.fireEvent(BI.ShelterEditor.EVENT_EMPTY, arguments);
}); });
BI.createWidget({ BI.createWidget({
type: "bi.vertical", type: "bi.absolute",
scrolly: false,
element: this, element: this,
items: [this.editor] items: [
{
el: this.text,
inset: 0,
}, {
el: this.editor,
inset: 0,
}
]
}); });
this._showHint(); this._showHint();
self._checkText(); self._checkText();

24
src/case/editor/editor.sign.js

@ -68,17 +68,6 @@ BI.SignEditor = BI.inherit(BI.Widget, {
self.fireEvent(BI.SignEditor.EVENT_CLICK_LABEL); self.fireEvent(BI.SignEditor.EVENT_CLICK_LABEL);
}); });
}); });
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.text,
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () { this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}); });
@ -137,10 +126,17 @@ BI.SignEditor = BI.inherit(BI.Widget, {
self.fireEvent(BI.SignEditor.EVENT_EMPTY, arguments); self.fireEvent(BI.SignEditor.EVENT_EMPTY, arguments);
}); });
BI.createWidget({ BI.createWidget({
type: "bi.vertical", type: "bi.absolute",
scrolly: false,
element: this, element: this,
items: [this.editor] items: [
{
el: this.text,
inset: 0,
}, {
el: this.editor,
inset: 0,
}
]
}); });
this._showHint(); this._showHint();
self._checkText(); self._checkText();

24
src/case/editor/editor.state.js

@ -77,17 +77,6 @@ BI.StateEditor = BI.inherit(BI.Widget, {
self.fireEvent(BI.StateEditor.EVENT_CLICK_LABEL); self.fireEvent(BI.StateEditor.EVENT_CLICK_LABEL);
}); });
}); });
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.text,
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () { this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}); });
@ -143,10 +132,17 @@ BI.StateEditor = BI.inherit(BI.Widget, {
self.fireEvent(BI.StateEditor.EVENT_EMPTY, arguments); self.fireEvent(BI.StateEditor.EVENT_EMPTY, arguments);
}); });
BI.createWidget({ BI.createWidget({
type: "bi.vertical", type: "bi.absolute",
scrolly: false,
element: this, element: this,
items: [this.editor] items: [
{
el: this.text,
inset: 0,
}, {
el: this.editor,
inset: 0,
}
]
}); });
this._showHint(); this._showHint();
if (BI.isNotNull(o.text)) { if (BI.isNotNull(o.text)) {

4
src/case/layer/panel.js

@ -59,7 +59,7 @@ BI.Panel = BI.inherit(BI.Widget, {
el: { el: {
type: "bi.left_right_vertical_adapt", type: "bi.left_right_vertical_adapt",
cls: "panel-title bi-header-background bi-border-bottom", cls: "panel-title bi-header-background bi-border-bottom",
height: o.titleHeight - 1, height: BI.toPix(o.titleHeight, 1),
items: { items: {
left: [this.text], left: [this.text],
right: [this.button_group] right: [this.button_group]
@ -67,7 +67,7 @@ BI.Panel = BI.inherit(BI.Widget, {
lhgap: 10, lhgap: 10,
rhgap: 10 rhgap: 10
}, },
height: o.titleHeight - 1 height: BI.toPix(o.titleHeight, 1)
}; };
}, },

2
src/case/linearsegment/button.linear.segment.js

@ -15,7 +15,7 @@ BI.LinearSegmentButton = BI.inherit(BI.BasicButton, {
type: "bi.label", type: "bi.label",
text: o.text, text: o.text,
height: o.height, height: o.height,
textHeight: o.height - 2, textHeight: BI.toPix(o.height, 2),
value: o.value, value: o.value,
hgap: o.hgap, hgap: o.hgap,
ref: function () { ref: function () {

2
src/case/list/list.select.js

@ -192,7 +192,7 @@ BI.SelectList = BI.inherit(BI.Widget, {
resetHeight: function (h) { resetHeight: function (h) {
var toolHeight = ( this.toolbar.element.outerHeight() || 25) * ( this.toolbar.isVisible() ? 1 : 0); var toolHeight = ( this.toolbar.element.outerHeight() || 25) * ( this.toolbar.isVisible() ? 1 : 0);
this.list.resetHeight ? this.list.resetHeight(h - toolHeight) : this.list.resetHeight ? this.list.resetHeight(h - toolHeight) :
this.list.element.css({"max-height": (h - toolHeight) / BI.pixRatio + BI.pixUnit}); this.list.element.css({"max-height": BI.pixFormat(h - toolHeight)});
}, },
setNotSelectedValue: function () { setNotSelectedValue: function () {

3
src/case/segment/button.segment.js

@ -20,9 +20,6 @@ BI.SegmentButton = BI.inherit(BI.BasicButton, {
_init: function () { _init: function () {
BI.SegmentButton.superclass._init.apply(this, arguments); BI.SegmentButton.superclass._init.apply(this, arguments);
var opts = this.options, self = this; var opts = this.options, self = this;
// if (BI.isNumber(opts.height) && BI.isNull(opts.lineHeight)) {
// this.element.css({lineHeight : (opts.height - 2) + 'px'});
// }
this.text = BI.createWidget({ this.text = BI.createWidget({
type: "bi.label", type: "bi.label",
element: this, element: this,

2
src/case/segment/segment.js

@ -22,7 +22,7 @@ BI.Segment = BI.inherit(BI.Widget, {
value: o.value, value: o.value,
items: BI.createItems(o.items, { items: BI.createItems(o.items, {
type: "bi.segment_button", type: "bi.segment_button",
height: o.height - 2, height: BI.toPix(o.height, 2),
whiteSpace: o.whiteSpace whiteSpace: o.whiteSpace
}), }),
layout: [ layout: [

4
src/case/tree/treeexpander/tree.expander.popup.js

@ -25,8 +25,8 @@
}); });
if (o.showLine) { if (o.showLine) {
this.popupView.element.css("margin-left", -offset * (o.layer + 1) / BI.pixRatio + BI.pixUnit); this.popupView.element.css("margin-left", BI.pixFormat(-offset * (o.layer + 1)));
this.element.css("margin-left", offset * (o.layer + 1) / BI.pixRatio + BI.pixUnit); this.element.css("margin-left", BI.pixFormat(offset * (o.layer + 1)));
} }
return { return {

8
src/case/trigger/trigger.editor.js

@ -20,12 +20,11 @@ BI.EditorTrigger = BI.inherit(BI.Trigger, {
}, },
_init: function () { _init: function () {
this.options.height -= 2;
BI.EditorTrigger.superclass._init.apply(this, arguments); BI.EditorTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options, c = this._const; var self = this, o = this.options, c = this._const;
this.editor = BI.createWidget({ this.editor = BI.createWidget({
type: "bi.sign_editor", type: "bi.sign_editor",
height: o.height, height: BI.toPix(o.height, 2),
value: o.value, value: o.value,
validationChecker: o.validationChecker, validationChecker: o.validationChecker,
quitChecker: o.quitChecker, quitChecker: o.quitChecker,
@ -58,6 +57,7 @@ BI.EditorTrigger = BI.inherit(BI.Trigger, {
BI.createWidget({ BI.createWidget({
element: this, element: this,
type: "bi.horizontal_fill", type: "bi.horizontal_fill",
height: BI.toPix(o.height, 2),
items: [ items: [
{ {
el: this.editor, el: this.editor,
@ -65,9 +65,9 @@ BI.EditorTrigger = BI.inherit(BI.Trigger, {
}, { }, {
el: { el: {
type: "bi.trigger_icon_button", type: "bi.trigger_icon_button",
width: o.triggerWidth || o.height width: o.triggerWidth || BI.toPix(o.height, 2)
}, },
width: o.triggerWidth || o.height width: ""
} }
] ]
}); });

20
src/case/trigger/trigger.icon.text.js

@ -42,7 +42,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
BI.createWidget({ BI.createWidget({
element: this, element: this,
type: "bi.horizontal_fill", type: "bi.horizontal_fill",
columnSize: [BI.isEmptyString(o.iconCls) ? 0 : (o.iconWrapperWidth || o.height), "fill", o.triggerWidth || o.height], columnSize: ["", "fill", ""],
ref: function (_ref) { ref: function (_ref) {
self.wrapper = _ref; self.wrapper = _ref;
}, },
@ -50,7 +50,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
el: { el: {
type: "bi.icon_change_button", type: "bi.icon_change_button",
cls: "icon-combo-trigger-icon", cls: "icon-combo-trigger-icon",
width: o.triggerWidth || o.height,
iconCls: o.iconCls, iconCls: o.iconCls,
invisible: !o.iconCls,
ref: function (_ref) { ref: function (_ref) {
self.icon = _ref; self.icon = _ref;
}, },
@ -74,21 +76,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
setIcon: function (iconCls) { setIcon: function (iconCls) {
var o = this.options; var o = this.options;
this.icon.setIcon(iconCls); this.icon.setIcon(iconCls);
var iconItem = this.wrapper.attr("items")[0]; this.icon.setVisible(!!iconCls);
var textItem = this.wrapper.attr("items")[1];
if (BI.isNull(iconCls) || BI.isEmptyString(iconCls)) {
if (iconItem.width !== 0) {
iconItem.width = 0;
textItem.lgap = 5;
this.wrapper.resize();
}
} else {
if (iconItem.width !== (o.iconWrapperWidth || o.height)) {
iconItem.width = (o.iconWrapperWidth || o.height);
textItem.lgap = 0;
this.wrapper.resize();
}
}
}, },
setTextCls: function (cls) { setTextCls: function (cls) {

5
src/case/trigger/trigger.text.js

@ -60,7 +60,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
return ({ return ({
type: "bi.horizontal_fill", type: "bi.horizontal_fill",
columnSize: ["fill", o.triggerWidth || o.height], columnSize: ["fill", ""],
items: [ items: [
{ {
el: label, el: label,
@ -68,6 +68,8 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
}, { }, {
el: o.allowClear ? { el: o.allowClear ? {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
width: o.triggerWidth || o.height,
height: o.height,
horizontalAlign: "left", horizontalAlign: "left",
scrollable: false, scrollable: false,
items: [ items: [
@ -80,7 +82,6 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
cls: "close-h-font " + (o.allowClear ? "clear-button" : ""), cls: "close-h-font " + (o.allowClear ? "clear-button" : ""),
stopPropagation: true, stopPropagation: true,
width: o.triggerWidth || o.height, width: o.triggerWidth || o.height,
height: o.height,
invisible: !BI.isNotEmptyString(o.text), invisible: !BI.isNotEmptyString(o.text),
handler: function () { handler: function () {
self.fireEvent(BI.TextTrigger.EVENT_CLEAR); self.fireEvent(BI.TextTrigger.EVENT_CLEAR);

3
src/case/trigger/trigger.text.select.small.js

@ -14,14 +14,13 @@ BI.SmallSelectTextTrigger = BI.inherit(BI.Trigger, {
}, },
_init: function () { _init: function () {
this.options.height -= 2;
BI.SmallSelectTextTrigger.superclass._init.apply(this, arguments); BI.SmallSelectTextTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
var obj = this._digest(o.value, o.items); var obj = this._digest(o.value, o.items);
this.trigger = BI.createWidget({ this.trigger = BI.createWidget({
type: "bi.small_text_trigger", type: "bi.small_text_trigger",
element: this, element: this,
height: o.height, height: BI.toPix(o.height, 2),
text: obj.text, text: obj.text,
cls: obj.cls, cls: obj.cls,
textHgap: o.textHgap, textHgap: o.textHgap,

2
src/case/trigger/trigger.text.small.js

@ -43,7 +43,7 @@ BI.SmallTextTrigger = BI.inherit(BI.Trigger, {
width: "fill" width: "fill"
}, { }, {
el: this.trigerButton, el: this.trigerButton,
width: o.triggerWidth || o.height width: ""
} }
] ]
}); });

2
src/core/2.base.js

@ -486,7 +486,7 @@
if (typeof w === "number") { if (typeof w === "number") {
return w >= 0; return w >= 0;
} else if (typeof w === "string") { } else if (typeof w === "string") {
return /^\d{1,3}(\.\d)?%$/.test(w) || w === "auto" || /^\d+px$/.test(w) || /^calc/.test(w); return /^\d{1,3}(\.\d)?%$/.test(w) || w === "auto" || /^\d+(\.\d+)?px$/.test(w) || /^calc/.test(w);
} }
}, },

44
src/core/4.widget.js

@ -116,8 +116,6 @@
_init: function () { _init: function () {
BI.Widget.superclass._init.apply(this, arguments); BI.Widget.superclass._init.apply(this, arguments);
this._initElementWidth();
this._initElementHeight();
this._initVisual(); this._initVisual();
this._initState(); this._initState();
this._initRender(); this._initRender();
@ -203,6 +201,8 @@
_initCurrent: function () { _initCurrent: function () {
var self = this, o = this.options; var self = this, o = this.options;
this._initElementWidth();
this._initElementHeight();
if (o._baseCls || o.baseCls || o.extraCls) { if (o._baseCls || o.baseCls || o.extraCls) {
this.element.addClass((o._baseCls || "") + " " + (o.baseCls || "") + " " + (o.extraCls || "")); this.element.addClass((o._baseCls || "") + " " + (o.baseCls || "") + " " + (o.extraCls || ""));
} }
@ -289,14 +289,14 @@
_initElementWidth: function () { _initElementWidth: function () {
var o = this.options; var o = this.options;
if (BI.isWidthOrHeight(o.width)) { if (BI.isWidthOrHeight(o.width)) {
this.element.css("width", BI.isNumber(o.width) ? o.width / BI.pixRatio + BI.pixUnit : o.width); this.element.css("width", BI.pixFormat(o.width));
} }
}, },
_initElementHeight: function () { _initElementHeight: function () {
var o = this.options; var o = this.options;
if (BI.isWidthOrHeight(o.height)) { if (BI.isWidthOrHeight(o.height)) {
this.element.css("height", BI.isNumber(o.height) ? o.height / BI.pixRatio + BI.pixUnit : o.height); this.element.css("height", BI.pixFormat(o.height));
} }
}, },
@ -857,6 +857,17 @@
BI.Widget.context = context = contextStack.pop(); BI.Widget.context = context = contextStack.pop();
}; };
BI.Widget.execWithContext = function (context, execFunc) {
BI.Widget.pushContext(context);
try {
execFunc();
} catch (e) {
throw e;
} finally {
BI.Widget.popContext();
}
};
function pushTarget(_current) { function pushTarget(_current) {
if (current) currentStack.push(current); if (current) currentStack.push(current);
BI.Widget.current = current = _current; BI.Widget.current = current = _current;
@ -902,18 +913,29 @@
}; };
BI.useContext = function (inject) { BI.useContext = function (inject) {
if (BI.Model.target) { // 通过组件找最近的store
var p = BI.Model.target; var vm = BI.Widget.findStore(BI.Widget.current || BI.Widget.context);
if (vm) {
if (inject) { if (inject) {
while (p) { if (vm.$$computed && inject in vm.$$computed) {
if (p.$$context && inject in p.$$context) { return vm;
return p; }
if (vm.$$state && inject in vm.$$state) {
return vm;
}
if (vm.$$model && inject in vm.$$model) {
return vm;
}
while (vm) {
if (vm.$$context && inject in vm.$$context) {
return vm;
} }
p = p._parent; vm = vm._parent;
} }
return null;
} }
} }
return BI.Model.target; return vm;
}; };
BI.watch = function (vm, watch, handler) { BI.watch = function (vm, watch, handler) {

26
src/core/constant/var.js

@ -15,6 +15,32 @@ BI._.extend(BI, {
emptyStr: "", emptyStr: "",
pixUnit: "px", pixUnit: "px",
pixRatio: 1, pixRatio: 1,
// 一定返回最终的单位
pixFormat: function (pix, border) {
if (!BI.isNumber(pix)) {
return pix;
}
if (BI.pixUnit === "px") {
return (pix / BI.pixRatio - (border || 0)) + BI.pixUnit;
}
var length = pix / BI.pixRatio + BI.pixUnit;
if (border > 0) {
return `calc(${length} - ${border + "px"})`;
}
return length;
},
toPix: function (pix, border) {
if (!BI.isNumber(pix)) {
return pix;
}
if (BI.pixUnit === "px") {
return pix - (border || 0) * BI.pixRatio;
}
if (border > 0) {
return `calc(${pix / BI.pixRatio + BI.pixUnit} - ${border + "px"})`;
}
return pix;
},
emptyFn: function () { emptyFn: function () {
}, },
empty: null, empty: null,

5
src/core/controller/controller.popover.js

@ -59,8 +59,9 @@ BI.PopoverController = BI.inherit(BI.Controller, {
top = 0; top = 0;
} }
popover.element.css({ popover.element.css({
left: left / BI.pixRatio + BI.pixUnit, // 这里直接用px就可以
top: top / BI.pixRatio + BI.pixUnit left: left + "px",
top: top + "px"
}); });
} }
return this; return this;

5
src/core/controller/controller.tooltips.js

@ -71,8 +71,9 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
!opt.belowMouse && (y = Math.max(y, top)); !opt.belowMouse && (y = Math.max(y, top));
} }
tooltip.element.css({ tooltip.element.css({
left: x < 0 ? 0 : x / BI.pixRatio + BI.pixUnit, // 这里直接用px就可以
top: y < 0 ? 0 : y / BI.pixRatio + BI.pixUnit left: x < 0 ? 0 : x + "px",
top: y < 0 ? 0 : y + "px"
}); });
tooltip.element.hover(function () { tooltip.element.hover(function () {
self.remove(name); self.remove(name);

2
src/core/utils/events/mousemovetracker.js

@ -44,7 +44,7 @@
this._x = event.clientX; this._x = event.clientX;
this._y = event.clientY; this._y = event.clientY;
} }
event.preventDefault ? event.preventDefault() : (event.returnValue = false); // event.preventDefault ? event.preventDefault() : (event.returnValue = false);
}, },
releaseMouseMoves: function () { releaseMouseMoves: function () {

10
src/core/wrapper/layout.js

@ -42,16 +42,16 @@ BI.Layout = BI.inherit(BI.Widget, {
_init4Margin: function () { _init4Margin: function () {
if (this.options.top) { if (this.options.top) {
this.element.css("top", BI.isNumber(this.options.top) ? this.options.top / BI.pixRatio + BI.pixUnit : this.options.top); this.element.css("top", BI.pixFormat(this.options.top));
} }
if (this.options.left) { if (this.options.left) {
this.element.css("left", BI.isNumber(this.options.left) ? this.options.left / BI.pixRatio + BI.pixUnit : this.options.left); this.element.css("left", BI.pixFormat(this.options.left));
} }
if (this.options.bottom) { if (this.options.bottom) {
this.element.css("bottom", BI.isNumber(this.options.bottom) ? this.options.bottom / BI.pixRatio + BI.pixUnit : this.options.bottom); this.element.css("bottom", BI.pixFormat(this.options.bottom));
} }
if (this.options.right) { if (this.options.right) {
this.element.css("right", BI.isNumber(this.options.right) ? this.options.right / BI.pixRatio + BI.pixUnit : this.options.right); this.element.css("right", BI.pixFormat(this.options.right));
} }
}, },
@ -289,7 +289,7 @@ BI.Layout = BI.inherit(BI.Widget, {
}, },
_optimiseGap: function (gap) { _optimiseGap: function (gap) {
return (gap > 0 && gap < 1) ? (gap * 100).toFixed(1) + "%" : gap / BI.pixRatio + BI.pixUnit; return (gap > 0 && gap < 1) ? (gap * 100).toFixed(1) + "%" : BI.pixFormat(gap);
}, },
_optimiseItemLgap: function (item) { _optimiseItemLgap: function (item) {

8
src/core/wrapper/layout/layout.flow.js

@ -137,16 +137,16 @@ BI.FloatRightLayout = BI.inherit(BI.Layout, {
var w = BI.FloatRightLayout.superclass._addElement.apply(this, arguments); var w = BI.FloatRightLayout.superclass._addElement.apply(this, arguments);
w.element.css({position: "relative", float: "right"}); w.element.css({position: "relative", float: "right"});
if (BI.isNotNull(item.left)) { if (BI.isNotNull(item.left)) {
w.element.css({left: BI.isNumber(item.left) ? item.left / BI.pixRatio + BI.pixUnit : item.left}); w.element.css({left: BI.pixFormat(item.left)});
} }
if (BI.isNotNull(item.right)) { if (BI.isNotNull(item.right)) {
w.element.css({right: BI.isNumber(item.right) ? item.right / BI.pixRatio + BI.pixUnit : item.right}); w.element.css({right: BI.pixFormat(item.right)});
} }
if (BI.isNotNull(item.top)) { if (BI.isNotNull(item.top)) {
w.element.css({top: BI.isNumber(item.top) ? item.top / BI.pixRatio + BI.pixUnit : item.top}); w.element.css({top: BI.pixFormat(item.top)});
} }
if (BI.isNotNull(item.bottom)) { if (BI.isNotNull(item.bottom)) {
w.element.css({bottom: BI.isNumber(item.bottom) ? item.bottom / BI.pixRatio + BI.pixUnit : item.bottom}); w.element.css({bottom: BI.pixFormat(item.bottom)});
} }
if (o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { if (o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) {
var top = o.vgap / 2 + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); var top = o.vgap / 2 + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item);

8
src/core/wrapper/layout/layout.inline.js

@ -47,7 +47,7 @@ BI.InlineLayout = BI.inherit(BI.Layout, {
} }
} }
if (columnSize > 0) { if (columnSize > 0) {
w.element.width(columnSize < 1 ? ((columnSize * 100).toFixed(1) + "%") : (columnSize / BI.pixRatio + BI.pixUnit)); w.element.width(columnSize < 1 ? ((columnSize * 100).toFixed(1) + "%") : BI.pixFormat(columnSize));
} }
w.element.css({ w.element.css({
position: "relative", position: "relative",
@ -69,8 +69,8 @@ BI.InlineLayout = BI.inherit(BI.Layout, {
gap += o.hgap + o.lgap + o.rgap + this._optimiseItemLgap(o.items[k]) + this._optimiseItemRgap(o.items[k]) + this._optimiseItemHgap(o.items[k]); gap += o.hgap + o.lgap + o.rgap + this._optimiseItemLgap(o.items[k]) + this._optimiseItemRgap(o.items[k]) + this._optimiseItemHgap(o.items[k]);
length += cz; length += cz;
} }
length = length > 0 && length < 1 ? (length * 100).toFixed(1) + "%" : length / BI.pixRatio + BI.pixUnit; length = length > 0 && length < 1 ? (length * 100).toFixed(1) + "%" : BI.pixFormat(length);
gap = gap > 0 && gap < 1 ? (gap * 100).toFixed(1) + "%" : gap / BI.pixRatio + BI.pixUnit; gap = gap > 0 && gap < 1 ? (gap * 100).toFixed(1) + "%" : BI.pixFormat(gap);
if (columnSize === "fill") { if (columnSize === "fill") {
w.element.css("min-width", "calc((100% - " + length + " - " + gap + ")" + (fillCount > 1 ? "/" + fillCount : "") + ")"); w.element.css("min-width", "calc((100% - " + length + " - " + gap + ")" + (fillCount > 1 ? "/" + fillCount : "") + ")");
} }
@ -86,7 +86,7 @@ BI.InlineLayout = BI.inherit(BI.Layout, {
if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) { if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) {
var top = o.innerVgap + o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item), var top = o.innerVgap + o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item),
bottom = o.innerVgap + o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); bottom = o.innerVgap + o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item);
var gap = (top + bottom) > 0 && (top + bottom) < 1 ? ((top + bottom) * 100).toFixed(1) + "%" : (top + bottom) / BI.pixRatio + BI.pixUnit; var gap = (top + bottom) > 0 && (top + bottom) < 1 ? ((top + bottom) * 100).toFixed(1) + "%" : BI.pixFormat(top + bottom);
w.element.css("height", "calc(100% - " + gap + ")"); w.element.css("height", "calc(100% - " + gap + ")");
} }
return w; return w;

4
src/core/wrapper/layout/layout.tape.js

@ -92,7 +92,7 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
left: self._optimiseGap(left[i] + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) + o.hgap + o.lgap) left: self._optimiseGap(left[i] + self._optimiseItemLgap(item) + self._optimiseItemHgap(item) + o.hgap + o.lgap)
}); });
if (columnSize === "" || columnSize === "fill") { if (BI.isNull(columnSize) || columnSize === "" || columnSize === "fill") {
return true; return true;
} }
}); });
@ -110,7 +110,7 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
right: self._optimiseGap(right[i] + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) + o.hgap + o.rgap) right: self._optimiseGap(right[i] + self._optimiseItemRgap(item) + self._optimiseItemHgap(item) + o.hgap + o.rgap)
}); });
if (columnSize === "" || columnSize === "fill") { if (BI.isNull(columnSize) || columnSize === "" || columnSize === "fill") {
return true; return true;
} }
}); });

2
src/core/wrapper/layout/responsive/responsive.flex.horizontal.js

@ -51,7 +51,7 @@ BI.ResponsiveFlexHorizontalLayout = BI.inherit(BI.FlexHorizontalLayout, {
}, },
destroyed: function () { destroyed: function () {
this.unResize(); this.unResize?.();
} }
}); });
BI.shortcut("bi.responsive_flex_horizontal", BI.ResponsiveFlexHorizontalLayout); BI.shortcut("bi.responsive_flex_horizontal", BI.ResponsiveFlexHorizontalLayout);

22
src/core/wrapper/layout/sticky/sticky.horizontal.js

@ -21,13 +21,29 @@ BI.HorizontalStickyLayout = BI.inherit(BI.FlexHorizontalLayout, {
} }
} }
if (columnSize !== "fill") { if (columnSize !== "fill") {
var firstItemFill = o.columnSize[0] === "fill" || o.items[0].width === "fill"; var fillIndex;
BI.count(0, o.items.length - 1, index => {
if (BI.isNotNull(fillIndex)) {
return;
}
if ((o.columnSize[index] === "fill" || o.items[index].width === "fill")) {
fillIndex = index;
}
});
if (fillIndex > i) {
w.element.css({
position: "sticky",
zIndex: 1,
left: 0,
});
} else {
w.element.css({ w.element.css({
position: "sticky", position: "sticky",
zIndex: 1, zIndex: 1,
left: firstItemFill ? "" : 0, right: 0
right: firstItemFill ? 0 : ""
}); });
}
} else { } else {
w.element.css({ w.element.css({
overflow: "" overflow: ""

22
src/core/wrapper/layout/sticky/sticky.vertical.js

@ -21,13 +21,29 @@ BI.VerticalStickyLayout = BI.inherit(BI.FlexVerticalLayout, {
} }
} }
if (rowSize !== "fill") { if (rowSize !== "fill") {
var firstItemFill = o.rowSize[0] === "fill" || o.items[0].height === "fill"; var fillIndex;
BI.count(0, o.items.length - 1, index => {
if (BI.isNotNull(fillIndex)) {
return;
}
if ((o.rowSize[index] === "fill" || o.items[index].height === "fill")) {
fillIndex = index;
}
});
if (fillIndex > i) {
w.element.css({
position: "sticky",
zIndex: 1,
top: 0,
});
} else {
w.element.css({ w.element.css({
position: "sticky", position: "sticky",
zIndex: 1, zIndex: 1,
top: firstItemFill ? "" : 0, bottom: 0
bottom: firstItemFill ? 0 : ""
}); });
}
} else { } else {
w.element.css({ w.element.css({
overflow: "" overflow: ""

11
src/less/base/single/button/button.half.less

@ -6,10 +6,13 @@
&:after { &:after {
position: absolute; position: absolute;
left: 2px; .border-radius(2px);
top: 2px; display: table;
width: 8px; left: 50%;
height: 8px; top: 50%;
width: 70%;
height: 70%;
.transform(translate(-50%, -50%));
background-color: @color-bi-background-half-button-content; background-color: @color-bi-background-half-button-content;
content: ''; content: '';
} }

5
src/less/base/single/editor/editor.textarea.less

@ -6,11 +6,12 @@
white-space: pre-wrap; white-space: pre-wrap;
word-break: break-all; word-break: break-all;
font-size: @font-size-12; font-size: @font-size-12;
font-size: calc(var(--css-scale, 1) * @font-size-12);
line-height: 21px; line-height: 21px;
& { line-height: calc(var(--css-scale, 1) * 21px);
border: none; border: none;
} }
}
& .textarea-watermark{ & .textarea-watermark{
max-height: 100%; max-height: 100%;
} }

13
src/less/base/single/input/checkbox.less

@ -6,20 +6,21 @@
border: 1px solid @color-bi-border-checkbox; border: 1px solid @color-bi-border-checkbox;
.box-sizing(border-box); .box-sizing(border-box);
.transition(all .1s); .transition(all .1s);
&:after { &:after {
position: absolute; position: absolute;
display: table; display: table;
// 百分比会出现像素误差 top: 45%;
top: 6px; left: 18%;
left: 2px;
border: 2px solid transparent; border: 2px solid transparent;
border: calc(var(--css-scale, 1) * 2px) solid transparent;
border-top: 0; border-top: 0;
border-left: 0; border-left: 0;
width: 6px; width: 50%;
height: 9px; height: 75%;
.box-sizing(border-box); .box-sizing(border-box);
.transform(rotate(45deg) scale(1) translate(-50%, -50%)); .transform(rotate(45deg) scale(1) translate(-50%, -50%));
@transition: all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s; @transition: all .1s cubic-bezier(.71, -.46, .88, .6), opacity .1s;
.transition(@transition); .transition(@transition);
content: ''; content: '';
} }

13
src/less/base/single/input/radio.less

@ -2,13 +2,15 @@
.bi-radio { .bi-radio {
& .radio-content, &.radio-content { & .radio-content, &.radio-content {
.border-radius(8px); .border-radius(50%);
border: 1px solid @color-bi-border-radio; border: 1px solid @color-bi-border-radio;
.box-sizing(border-box); .box-sizing(border-box);
.transition(all .1s); .transition(all .1s);
&:after { &:after {
content: ""; content: "";
} }
&.hover, &:hover { &.hover, &:hover {
border-color: @color-bi-border-hover-active-radio; border-color: @color-bi-border-hover-active-radio;
} }
@ -18,16 +20,15 @@
border-color: @color-bi-border-hover-active-radio; border-color: @color-bi-border-hover-active-radio;
background-color: @color-bi-background-active-radio; background-color: @color-bi-background-active-radio;
&:after { &:after {
width: 8px; width: 50%;
height: 8px; height: 50%;
display: table;
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
.border-radius(4px); .border-radius(50%);
background-color: @color-bi-background-active-radio-content; background-color: @color-bi-background-active-radio-content;
.transform(translate(-50%, -50%)); .transform(translate(-50%, -50%));
@transition: all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s; @transition: all .1s cubic-bezier(.71, -.46, .88, .6), opacity .1s;
.transition(@transition); .transition(@transition);
} }
} }

296
src/less/base/tree/ztree.less

@ -1,5 +1,10 @@
@import "../../index.less"; @import "../../index.less";
.use-scale(@property, @pix) {
@{property} : @pix; //不支持css变量的浏览器
@{property} : calc(var(--css-scale, 1) * @pix);
}
.ztree * { .ztree * {
padding: 0; padding: 0;
margin: 0; margin: 0;
@ -27,7 +32,7 @@
.ztree.solid li ul { .ztree.solid li ul {
margin: 0; margin: 0;
padding: 0 0 0 24px .use-scale(padding-left, 24px);
} }
// 此处不用2倍图,改用css画虚线 // 此处不用2倍图,改用css画虚线
@ -50,7 +55,7 @@
&:before { &:before {
border-left: 1px solid @border-color-dark-gray-line; border-left: 1px solid @border-color-dark-gray-line;
height: 100%; height: 100%;
left: 14px; .use-scale(left, 14px);
margin-top: 0; margin-top: 0;
} }
} }
@ -67,6 +72,27 @@
border-left: 1px solid @border-color-dark-gray-line-theme-dark; border-left: 1px solid @border-color-dark-gray-line-theme-dark;
} }
} }
&.bi-checkbox {
border: 1px solid @color-bi-border-checkbox-theme-dark;
&.active {
background-color: @color-bi-background-active-checkbox-theme-dark;
border-color: @color-bi-border-hover-active-checkbox-theme-dark;
}
&.disabled {
background-color: @color-bi-background-disabled-checkbox-theme-dark;
&.active {
border-color: @color-bi-border-disabled-checkbox-theme-dark;
}
}
}
&.bi-half-button {
border: 1px solid @color-bi-border-hover-active-checkbox-theme-dark;
}
} }
.ztree li a { .ztree li a {
@ -92,35 +118,8 @@
} }
.ztree.solid li a { .ztree.solid li a {
height: 30px; //height: 30px;
} .use-scale(height, 30px);
.ztree li a.curSelectedNode {
}
.ztree li a.curSelectedNode_Edit {
padding-top: 0px;
background-color: #FFE6B0;
color: black;
height: 16px;
border: 1px #FFB951 solid;
opacity: 0.8;
}
.ztree li a.tmpTargetNode_inner {
padding-top: 0px;
background-color: #316AC5;
color: white;
height: 16px;
border: 1px #316AC5 solid;
opacity: 0.8;
filter: alpha(opacity=80)
}
.ztree li a.tmpTargetNode_prev {
}
.ztree li a.tmpTargetNode_next {
} }
.ztree li a input.rename { .ztree li a input.rename {
@ -142,7 +141,8 @@
} }
.ztree.solid li span { .ztree.solid li span {
line-height: 30px; //line-height: 30px;
.use-scale(line-height, 30px);
} }
.ztree li span.icon { .ztree li span.icon {
@ -162,10 +162,6 @@
vertical-align: middle; vertical-align: middle;
border: 0 none; border: 0 none;
cursor: pointer; cursor: pointer;
outline: none;
background-color: transparent;
background-repeat: no-repeat;
background-attachment: scroll;
} }
.ztree li span.button.chk { .ztree li span.button.chk {
@ -194,57 +190,100 @@
} }
} }
.ztree.solid li span.button.roots_docu {
.ztree li span.button.chk { background: none;
position: relative; position: relative;
width: 14px;
height: 14px;
margin: 0 3px 0 0;
cursor: auto
}
.ztree li span.button.chk.checkbox_false_disable { &:before {
background-position: 0 -56px position: absolute;
} bottom: 0;
left: -1px;
width: 50%;
height: 50%;
border-right: 1px solid @border-color-dark-gray-line;
content: '';
}
.ztree li span.button.chk.checkbox_true_disable { &:after {
background-position: -14px -56px position: absolute;
top: 0;
right: 0;
height: 50%;
width: 50%;
border-bottom: 1px solid @border-color-dark-gray-line;
content: '';
}
} }
.ztree li span.button.chk.radio_false_full { .ztree.solid li span.button.center_docu {
background-position: -28px 0 background: none;
} position: relative;
.ztree li span.button.chk.radio_false_full_focus { &:before {
background-position: -28px -14px position: absolute;
} top: 0;
left: -1px;
width: 50%;
height: 100%;
border-right: 1px solid @border-color-dark-gray-line;
content: '';
}
.ztree li span.button.chk.radio_false_part { &:after {
background-position: -28px -28px position: absolute;
top: 0;
right: 0;
height: 50%;
width: 50%;
border-bottom: 1px solid @border-color-dark-gray-line;
content: '';
}
} }
.ztree li span.button.chk.radio_false_part_focus { .ztree.solid li span.button.bottom_docu {
background-position: -28px -42px background: none;
} position: relative;
.ztree li span.button.chk.radio_false_disable { &:before {
background-position: -28px -56px position: absolute;
} top: 0;
left: -1px;
width: 50%;
height: 50%;
border-right: 1px solid @border-color-dark-gray-line;
content: '';
}
.ztree li span.button.chk.radio_true_full { &:after {
background-position: -42px 0 position: absolute;
top: 0;
right: 1px;
height: 50%;
width: 50%;
border-bottom: 1px solid @border-color-dark-gray-line;
content: '';
}
} }
.ztree li span.button.chk.radio_true_full_focus { .bi-theme-dark {
background-position: -42px -14px; .ztree.solid li span.button.center_docu, .ztree.solid li span.button.bottom_docu {
} &:before {
border-right: 1px solid @border-color-dark-gray-line-theme-dark;
}
.ztree li span.button.chk.radio_true_part { &:after {
background-position: -42px -28px border-bottom: 1px solid @border-color-dark-gray-line-theme-dark;
}
}
} }
.ztree li span.button.chk.radio_true_part_focus {
background-position: -42px -42px .ztree li span.button.chk {
position: relative;
.use-scale(width, 14px);
.use-scale(height, 14px);
margin: 0 3px 0 0;
cursor: auto
} }
.ztree li span.button.chk.checkbox_true_full { .ztree li span.button.chk.checkbox_true_full {
@ -271,73 +310,16 @@
} }
} }
.ztree li span.button.chk.radio_true_disable {
background-position: -42px -56px
}
.ztree li span.button.switch { .ztree li span.button.switch {
width: 24px; width: 24px;
height: 24px height: 24px
} }
.ztree.solid li span.button.switch { .ztree.solid li span.button.switch {
width: 30px; .use-scale(width, 30px);
height: 30px .use-scale(height, 30px);
} //width: 30px;
//height: 30px;
.ztree li span.button.switch.noline_open {
width: 0;
}
.ztree li span.button.switch.noline_close {
width: 0;
}
.ztree li span.button.noline_open {
background-position: -92px -72px
}
.ztree li span.button.noline_close {
background-position: -74px -72px
}
.ztree li span.button.root_docu {
background: none;
}
.ztree li span.button.noline_docu {
background: none;
width: 0;
}
.ztree li span.button.ico_open {
margin-right: 2px;
background-position: -110px -16px;
vertical-align: top;
}
.ztree li span.button.ico_close {
margin-right: 2px;
background-position: -110px 0;
vertical-align: top;
}
.ztree li span.button.ico_docu {
margin-right: 2px;
background-position: -110px -32px;
vertical-align: top;
}
.ztree li span.button.edit {
margin-right: 2px;
background-position: -110px -48px;
vertical-align: top;
}
.ztree li span.button.remove {
margin-right: 2px;
background-position: -110px -64px;
vertical-align: top;
} }
.ztree li span.button.ico_loading { .ztree li span.button.ico_loading {
@ -345,53 +327,3 @@
margin-right: 2px; margin-right: 2px;
vertical-align: top; vertical-align: top;
} }
ul.tmpTargetzTree {
background-color: #FFE6B0;
opacity: 0.8;
filter: alpha(opacity=80)
}
span.tmpzTreeMove_arrow {
width: 16px;
height: 16px;
display: inline-block;
padding: 0;
margin: 2px 0 0 1px;
border: 0 none;
position: absolute;
background-color: transparent;
background-repeat: no-repeat;
background-attachment: scroll;
background-position: -110px -80px;
}
ul.ztree.zTreeDragUL {
margin: 0;
padding: 0;
position: absolute;
width: auto;
height: auto;
overflow: hidden;
background-color: #cfcfcf;
border: 1px #00B83F dotted;
opacity: 0.8;
filter: alpha(opacity=80)
}
.zTreeMask {
z-index: 10000;
background-color: #cfcfcf;
opacity: 0.0;
filter: alpha(opacity=0);
position: absolute
}
/* level style*/
/*.ztree li span.button.level0 {
display:none;
}
.ztree li ul.level0 {
padding:0;
background:none;
}*/

90
src/less/case/tree/tree.item.less

@ -0,0 +1,90 @@
@import "../../index.less";
.tree-first-solid-line-conn-background {
&:before {
position: absolute;
bottom: 0;
left: -1px;
width: 50%;
height: 50%;
border-right: 1px solid @border-color-dark-gray-line;
content: '';
}
&:after {
position: absolute;
top: 0;
right: 0;
height: 50%;
width: 50%;
border-bottom: 1px solid @border-color-dark-gray-line;
content: '';
}
}
.tree-mid-solid-line-conn-background {
&:before {
position: absolute;
top: 0;
left: -1px;
width: 50%;
height: 100%;
border-right: 1px solid @border-color-dark-gray-line;
content: '';
}
&:after {
position: absolute;
top: 0;
right: 0;
height: 50%;
width: 50%;
border-bottom: 1px solid @border-color-dark-gray-line;
content: '';
}
}
.tree-last-solid-line-conn-background {
&:before {
position: absolute;
top: 0;
left: -1px;
width: 50%;
height: 50%;
border-right: 1px solid @border-color-dark-gray-line;
content: '';
}
&:after {
position: absolute;
top: 0;
right: 1px;
height: 50%;
width: 50%;
border-bottom: 1px solid @border-color-dark-gray-line;
content: '';
}
}
.bi-theme-dark {
.tree-first-solid-line-conn-background, .tree-mid-solid-line-conn-background {
&:before {
border-right: 1px solid @border-color-dark-gray-line-theme-dark;
}
&:after {
border-bottom: 1px solid @border-color-dark-gray-line-theme-dark;
}
}
.tree-last-solid-line-conn-background {
&:before {
border-right: 1px solid @border-color-dark-gray-line-theme-dark;
}
&:after {
border-bottom: 1px solid @border-color-dark-gray-line-theme-dark;
}
}
}

22
src/less/core/utils/common.less

@ -74,9 +74,10 @@
border-color: @color-bi-border-highlight; border-color: @color-bi-border-highlight;
} }
// ie下不支持focus-within, 和上面写在一起会导致ie下:hover不生效 // ie下不支持focus-within, 和上面写在一起会导致ie下:hover不生效
&:focus-within{ &:focus-within {
border-color: @color-bi-border-highlight; border-color: @color-bi-border-highlight;
} }
&.disabled { &.disabled {
&:hover { &:hover {
border-color: @border-color-line; border-color: @border-color-line;
@ -84,6 +85,14 @@
} }
} }
.base-disabled {
.bi-focus-shadow {
&:hover {
border-color: @border-color-line;
}
}
}
.bi-theme-dark { .bi-theme-dark {
.bi-focus-shadow { .bi-focus-shadow {
&.disabled { &.disabled {
@ -94,6 +103,16 @@
} }
} }
.bi-theme-dark {
.base-disabled {
.bi-focus-shadow {
&:hover {
border-color: @border-color-line-theme-dark;
}
}
}
}
.clearfix { .clearfix {
.clearfix(); .clearfix();
} }
@ -102,6 +121,7 @@
.bi-background { .bi-background {
background-color: @color-bi-background-normal; background-color: @color-bi-background-normal;
color: @color-bi-text-background; color: @color-bi-text-background;
& .bi-input { & .bi-input {
color: @color-bi-text-background; color: @color-bi-text-background;
} }

66
src/less/resource/background.less

@ -43,6 +43,7 @@
.ztree li span.button.root_open { .ztree li span.button.root_open {
.image2xPath(@icon-tree-expand-type1-theme-dark); .image2xPath(@icon-tree-expand-type1-theme-dark);
} }
.ztree.solid li span.button.root_open { .ztree.solid li span.button.root_open {
.image2xPath(@icon-tree-solid-expand-type1-theme-dark); .image2xPath(@icon-tree-solid-expand-type1-theme-dark);
} }
@ -60,6 +61,7 @@
.ztree li span.button.root_close { .ztree li span.button.root_close {
.image2xPath(@icon-tree-collapse-type1-theme-dark); .image2xPath(@icon-tree-collapse-type1-theme-dark);
} }
.ztree.solid li span.button.root_close { .ztree.solid li span.button.root_close {
.image2xPath(@icon-tree-solid-collapse-type1-theme-dark); .image2xPath(@icon-tree-solid-collapse-type1-theme-dark);
} }
@ -70,15 +72,16 @@
} }
.ztree.solid li span.button.roots_open { .ztree.solid li span.button.roots_open {
.image2xPath(@icon-tree-solid-expand-type2); .image2xPath(@icon-tree-solid-expand-type1);
} }
.bi-theme-dark { .bi-theme-dark {
.ztree li span.button.roots_open { .ztree li span.button.roots_open {
.image2xPath(@icon-tree-expand-type2-theme-dark); .image2xPath(@icon-tree-expand-type2-theme-dark);
} }
.ztree.solid li span.button.roots_open { .ztree.solid li span.button.roots_open {
.image2xPath(@icon-tree-solid-expand-type2-theme-dark); .image2xPath(@icon-tree-solid-expand-type1-theme-dark);
} }
} }
@ -87,15 +90,16 @@
} }
.ztree.solid li span.button.roots_close { .ztree.solid li span.button.roots_close {
.image2xPath(@icon-tree-solid-collapse-type2); .image2xPath(@icon-tree-solid-collapse-type1);
} }
.bi-theme-dark { .bi-theme-dark {
.ztree li span.button.roots_close { .ztree li span.button.roots_close {
.image2xPath(@icon-tree-collapse-type2-theme-dark); .image2xPath(@icon-tree-collapse-type2-theme-dark);
} }
.ztree.solid li span.button.roots_close { .ztree.solid li span.button.roots_close {
.image2xPath(@icon-tree-solid-collapse-type2-theme-dark); .image2xPath(@icon-tree-solid-collapse-type1-theme-dark);
} }
} }
@ -104,15 +108,16 @@
} }
.ztree.solid li span.button.center_open { .ztree.solid li span.button.center_open {
.image2xPath(@icon-tree-solid-expand-type3); .image2xPath(@icon-tree-solid-expand-type1);
} }
.bi-theme-dark { .bi-theme-dark {
.ztree li span.button.center_open { .ztree li span.button.center_open {
.image2xPath(@icon-tree-expand-type3-theme-dark); .image2xPath(@icon-tree-expand-type3-theme-dark);
} }
.ztree.solid li span.button.center_open { .ztree.solid li span.button.center_open {
.image2xPath(@icon-tree-solid-expand-type3-theme-dark); .image2xPath(@icon-tree-solid-expand-type1-theme-dark);
} }
} }
@ -121,15 +126,16 @@
} }
.ztree.solid li span.button.center_close { .ztree.solid li span.button.center_close {
.image2xPath(@icon-tree-solid-collapse-type3); .image2xPath(@icon-tree-solid-collapse-type1);
} }
.bi-theme-dark { .bi-theme-dark {
.ztree li span.button.center_close { .ztree li span.button.center_close {
.image2xPath(@icon-tree-collapse-type3-theme-dark); .image2xPath(@icon-tree-collapse-type3-theme-dark);
} }
.ztree.solid li span.button.center_close { .ztree.solid li span.button.center_close {
.image2xPath(@icon-tree-solid-collapse-type3-theme-dark); .image2xPath(@icon-tree-solid-collapse-type1-theme-dark);
} }
} }
@ -138,15 +144,16 @@
} }
.ztree.solid li span.button.bottom_open { .ztree.solid li span.button.bottom_open {
.image2xPath(@icon-tree-solid-expand-type4); .image2xPath(@icon-tree-solid-expand-type1);
} }
.bi-theme-dark { .bi-theme-dark {
.ztree li span.button.bottom_open { .ztree li span.button.bottom_open {
.image2xPath(@icon-tree-expand-type4-theme-dark); .image2xPath(@icon-tree-expand-type4-theme-dark);
} }
.ztree.solid li span.button.bottom_open { .ztree.solid li span.button.bottom_open {
.image2xPath(@icon-tree-solid-expand-type4-theme-dark); .image2xPath(@icon-tree-solid-expand-type1-theme-dark);
} }
} }
@ -155,15 +162,16 @@
} }
.ztree.solid li span.button.bottom_close { .ztree.solid li span.button.bottom_close {
.image2xPath(@icon-tree-solid-collapse-type4); .image2xPath(@icon-tree-solid-collapse-type1);
} }
.bi-theme-dark { .bi-theme-dark {
.ztree li span.button.bottom_close { .ztree li span.button.bottom_close {
.image2xPath(@icon-tree-collapse-type4-theme-dark); .image2xPath(@icon-tree-collapse-type4-theme-dark);
} }
.ztree.solid li span.button.bottom_close { .ztree.solid li span.button.bottom_close {
.image2xPath(@icon-tree-solid-collapse-type4-theme-dark); .image2xPath(@icon-tree-solid-collapse-type1-theme-dark);
} }
} }
@ -171,51 +179,31 @@
.image2xPath(@icon-tree-vertical-line-2); .image2xPath(@icon-tree-vertical-line-2);
} }
.ztree.solid li span.button.roots_docu {
.image2xPath(@icon-tree-solid-vertical-line-2);
}
.bi-theme-dark { .bi-theme-dark {
.ztree li span.button.roots_docu { .ztree li span.button.roots_docu {
.image2xPath(@icon-tree-vertical-line-2-theme-dark); .image2xPath(@icon-tree-vertical-line-2-theme-dark);
} }
.ztree.solid li span.button.roots_docu {
.image2xPath(@icon-tree-solid-vertical-line-2-theme-dark);
}
} }
.ztree li span.button.center_docu { .ztree li span.button.center_docu {
.image2xPath(@icon-tree-vertical-line-3); .image2xPath(@icon-tree-vertical-line-3);
} }
.ztree.solid li span.button.center_docu {
.image2xPath(@icon-tree-solid-vertical-line-3);
}
.bi-theme-dark { .bi-theme-dark {
.ztree li span.button.center_docu { .ztree li span.button.center_docu {
.image2xPath(@icon-tree-vertical-line-3-theme-dark); .image2xPath(@icon-tree-vertical-line-3-theme-dark);
} }
.ztree.solid li span.button.center_docu {
.image2xPath(@icon-tree-solid-vertical-line-3-theme-dark);
}
} }
.ztree li span.button.bottom_docu { .ztree li span.button.bottom_docu {
.image2xPath(@icon-tree-vertical-line-4); .image2xPath(@icon-tree-vertical-line-4);
} }
.ztree.solid li span.button.bottom_docu {
.image2xPath(@icon-tree-solid-vertical-line-4);
}
.bi-theme-dark { .bi-theme-dark {
.ztree li span.button.bottom_docu { .ztree li span.button.bottom_docu {
.image2xPath(@icon-tree-vertical-line-4-theme-dark); .image2xPath(@icon-tree-vertical-line-4-theme-dark);
} }
.ztree.solid li span.button.bottom_docu {
.image2xPath(@icon-tree-solid-vertical-line-4-theme-dark);
}
} }
.ztree li span.button.ico_loading { .ztree li span.button.ico_loading {
@ -335,43 +323,43 @@
} }
.auto-color-background { .auto-color-background {
&.hack{ &.hack {
.imagePath(@background-auto-color); .imagePath(@background-auto-color);
} }
} }
.auto-color-normal-background { .auto-color-normal-background {
&.hack{ &.hack {
.imagePath(@background-auto-color-normal); .imagePath(@background-auto-color-normal);
} }
} }
.auto-color-normal-disabled-background { .auto-color-normal-disabled-background {
&.hack{ &.hack {
.imagePath(@background-auto-color-disabled); .imagePath(@background-auto-color-disabled);
} }
} }
.auto-color-square-normal-background { .auto-color-square-normal-background {
&.hack{ &.hack {
.imagePath(@background-auto-color-square-normal); .imagePath(@background-auto-color-square-normal);
} }
} }
.auto-color-no-square-normal-background { .auto-color-no-square-normal-background {
&.hack{ &.hack {
.imagePath(@background-auto-color-no-square-normal); .imagePath(@background-auto-color-no-square-normal);
} }
} }
.trans-color-background { .trans-color-background {
&.hack{ &.hack {
.imagePath(@background-trans-color); .imagePath(@background-trans-color);
} }
} }
.trans-color-disabled-background { .trans-color-disabled-background {
&.hack{ &.hack {
.imagePath(@background-trans-color-disabled); .imagePath(@background-trans-color-disabled);
} }
} }

2
src/less/visual.less

@ -339,7 +339,7 @@
} }
.hover-visible(@cls) { .hover-visible(@cls) {
& .@{cls} { & .@{cls}:not(.bi-combo-popup) {
visibility: hidden; visibility: hidden;
} }
&:hover { &:hover {

27
src/less/widget/singleslider/slider/widget.slider.less

@ -1,41 +1,31 @@
@import "../../../index.less"; @import "../../../index.less";
.bi-single-slider-button { .bi-single-slider-button {
& .slider-button { transform: translateX(-50%);
cursor: ew-resize; cursor: ew-resize;
border-width: 2px; border-width: 2px;
border-style: solid; border-style: solid;
.border-radius(8px); .border-radius(50%);
background-color: @color-bi-background-slider-button; background-color: @color-bi-background-slider-button;
height: 8px;
width: 8px;
top: 8px;
left: -6px;
&:hover, &.hover { &:hover, &.hover {
.border-radius(10px);
background-color: @color-bi-background-hover-slider-button; background-color: @color-bi-background-hover-slider-button;
width: 12px; transform: scale(1.2) translateX(-50%);
height: 12px; .box-shadow(0 2px 4px 1px, rgba(0, 35, 11, 20%));
top: 6px;
left: -8px;
.box-shadow(0 2px 4px 1px,rgba(0, 35, 11, 20%));
} }
&.disabled { &.disabled {
border-color: @color-bi-border-disabled-slider-button; border-color: @color-bi-border-disabled-slider-button;
&:hover, &.hover { &:hover, &.hover {
background-color: @color-bi-background-hover-disabled-slider-button; background-color: @color-bi-background-hover-disabled-slider-button;
width: 12px;
height: 12px;
top: 6px;
left: -8px;
}
} }
} }
} }
.bi-theme-dark { .bi-theme-dark {
.bi-single-slider-button { .bi-single-slider-button {
& .slider-button {
background-color: @color-bi-background-slider-button; background-color: @color-bi-background-slider-button;
&:hover, &.hover { &:hover, &.hover {
background-color: @color-bi-background-hover-slider-button-theme-dark; background-color: @color-bi-background-hover-slider-button-theme-dark;
@ -46,5 +36,4 @@
} }
} }
} }
}
} }

1
src/less/widget/year/popup.year.less

@ -2,7 +2,6 @@
.bi-year-popup { .bi-year-popup {
& .year-popup-navigation { & .year-popup-navigation {
line-height: 30px;
& > .center-element { & > .center-element {
border-left: 1px solid @color-bi-border-year-popup; border-left: 1px solid @color-bi-border-year-popup;
} }

4
src/widget/date/calendar/popup.month.js

@ -49,6 +49,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
}, },
_getItems: function(m) { _getItems: function(m) {
BI.Widget.pushContext(this);
// 纵向排列月 // 纵向排列月
var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12]; var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12];
var items = []; var items = [];
@ -67,7 +68,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
whiteSpace: "nowrap", whiteSpace: "nowrap",
once: false, once: false,
forceSelected: true, forceSelected: true,
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT - 1, height: BI.toPix(BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, 1),
width: 30, width: 30,
value: td, value: td,
text: td, text: td,
@ -75,6 +76,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
}; };
}); });
}); });
BI.Widget.popContext();
return items; return items;
}, },

10
src/widget/dynamicdate/dynamicdate.combo.js

@ -50,13 +50,13 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
el: { el: {
type: "bi.horizontal_fill", type: "bi.horizontal_fill",
columnSize: [this.constants.iconWidth, "fill"], columnSize: [this.constants.iconWidth, "fill"],
height: opts.height - border, height: BI.toPix(opts.height, border),
items: [{ items: [{
el: { el: {
type: "bi.icon_button", type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font", cls: "bi-trigger-icon-button date-change-h-font",
width: opts.height - border, width: BI.toPix(opts.height, border),
height: opts.height - border, height: BI.toPix(opts.height, border),
ref: function () { ref: function () {
self.changeIcon = this; self.changeIcon = this;
} }
@ -69,8 +69,8 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
format: opts.format, format: opts.format,
allowEdit: opts.allowEdit, allowEdit: opts.allowEdit,
watermark: opts.watermark, watermark: opts.watermark,
iconWidth: opts.height - border, iconWidth: BI.toPix(opts.height, border),
height: opts.height - border, height: BI.toPix(opts.height, border),
value: opts.value, value: opts.value,
ref: function () { ref: function () {
self.trigger = this; self.trigger = this;

2
src/widget/dynamicdate/dynamicdate.param.item.js

@ -21,7 +21,7 @@ BI.DynamicDateParamItem = BI.inherit(BI.Widget, {
el: { el: {
type: "bi.sign_editor", type: "bi.sign_editor",
cls: "bi-border bi-focus-shadow bi-border-radius", cls: "bi-border bi-focus-shadow bi-border-radius",
height: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 2, height: BI.toPix(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 2),
validationChecker: function (v) { validationChecker: function (v) {
return BI.isNaturalNumber(v); return BI.isNaturalNumber(v);
}, },

6
src/widget/dynamicdate/dynamicdate.popup.js

@ -26,7 +26,7 @@ BI.DynamicDatePopup = BI.inherit(BI.Widget, {
cls: "bi-high-light bi-split-top", cls: "bi-high-light bi-split-top",
shadow: true, shadow: true,
text: BI.i18nText("BI-Basic_Clear"), text: BI.i18nText("BI-Basic_Clear"),
textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, textHeight: BI.toPix(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1),
listeners: [{ listeners: [{
eventName: BI.TextButton.EVENT_CHANGE, eventName: BI.TextButton.EVENT_CHANGE,
action: function () { action: function () {
@ -37,7 +37,7 @@ BI.DynamicDatePopup = BI.inherit(BI.Widget, {
type: "bi.text_button", type: "bi.text_button",
cls: "bi-split-left bi-split-right bi-high-light bi-split-top", cls: "bi-split-left bi-split-right bi-high-light bi-split-top",
shadow: true, shadow: true,
textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, textHeight: BI.toPix(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1),
text: BI.i18nText("BI-Multi_Date_Today"), text: BI.i18nText("BI-Multi_Date_Today"),
disabled: this._checkTodayValid(), disabled: this._checkTodayValid(),
ref: function () { ref: function () {
@ -52,7 +52,7 @@ BI.DynamicDatePopup = BI.inherit(BI.Widget, {
}, { }, {
type: "bi.text_button", type: "bi.text_button",
cls: "bi-high-light bi-split-top", cls: "bi-high-light bi-split-top",
textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, textHeight: BI.toPix(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1),
shadow: true, shadow: true,
text: BI.i18nText("BI-Basic_OK"), text: BI.i18nText("BI-Basic_OK"),
listeners: [{ listeners: [{

3
src/widget/dynamicdate/dynamicdate.trigger.js

@ -152,6 +152,9 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
_getTitle: function () { _getTitle: function () {
var storeValue = this.storeValue || {}; var storeValue = this.storeValue || {};
if (BI.isEmptyObject(storeValue)) {
return this.options.watermark;
}
var type = storeValue.type || BI.DynamicDateCombo.Static; var type = storeValue.type || BI.DynamicDateCombo.Static;
var value = storeValue.value; var value = storeValue.value;
switch (type) { switch (type) {

8
src/widget/dynamicdatetime/dynamicdatetime.combo.js

@ -8,7 +8,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
}, },
props: { props: {
baseCls: "bi-dynamic-date-combo", baseCls: "bi-dynamic-date--time-combo",
height: 24, height: 24,
minDate: "1900-01-01", minDate: "1900-01-01",
maxDate: "2099-12-31", maxDate: "2099-12-31",
@ -50,13 +50,13 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
el: { el: {
type: "bi.horizontal_fill", type: "bi.horizontal_fill",
columnSize: [this.constants.iconWidth, "fill"], columnSize: [this.constants.iconWidth, "fill"],
height: opts.height - border, height: BI.toPix(opts.height, border),
items: [{ items: [{
el: { el: {
type: "bi.icon_button", type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font", cls: "bi-trigger-icon-button date-change-h-font",
width: this.constants.iconWidth, width: this.constants.iconWidth,
height: opts.height - border, height: BI.toPix(opts.height, border),
ref: function () { ref: function () {
self.changeIcon = this; self.changeIcon = this;
} }
@ -70,7 +70,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
watermark: opts.watermark, watermark: opts.watermark,
format: opts.format, format: opts.format,
iconWidth: this.constants.iconWidth, iconWidth: this.constants.iconWidth,
height: opts.height - border, height: BI.toPix(opts.height, border),
value: opts.value, value: opts.value,
ref: function () { ref: function () {
self.trigger = this; self.trigger = this;

6
src/widget/dynamicdatetime/dynamicdatetime.popup.js

@ -25,7 +25,7 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, {
items: [[{ items: [[{
type: "bi.text_button", type: "bi.text_button",
cls: "bi-high-light bi-split-top", cls: "bi-high-light bi-split-top",
textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, textHeight: BI.toPix(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1),
shadow: true, shadow: true,
text: BI.i18nText("BI-Basic_Clear"), text: BI.i18nText("BI-Basic_Clear"),
listeners: [{ listeners: [{
@ -37,7 +37,7 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, {
}, { }, {
type: "bi.text_button", type: "bi.text_button",
cls: "bi-split-left bi-split-right bi-high-light bi-split-top", cls: "bi-split-left bi-split-right bi-high-light bi-split-top",
textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, textHeight: BI.toPix(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1),
shadow: true, shadow: true,
text: BI.i18nText("BI-Multi_Date_Today"), text: BI.i18nText("BI-Multi_Date_Today"),
disabled: this._checkTodayValid(), disabled: this._checkTodayValid(),
@ -53,7 +53,7 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, {
}, { }, {
type: "bi.text_button", type: "bi.text_button",
cls: "bi-high-light bi-split-top", cls: "bi-high-light bi-split-top",
textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, textHeight: BI.toPix(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1),
shadow: true, shadow: true,
text: BI.i18nText("BI-Basic_OK"), text: BI.i18nText("BI-Basic_OK"),
listeners: [{ listeners: [{

40
src/widget/dynamicdatetime/dynamicdatetime.trigger.js

@ -9,7 +9,7 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
iconWidth: 24 iconWidth: 24
}, },
props: { props: () => ({
extraCls: "bi-date-time-trigger", extraCls: "bi-date-time-trigger",
min: "1900-01-01", // 最小日期 min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期 max: "2099-12-31", // 最大日期
@ -17,8 +17,8 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
iconWidth: 24, iconWidth: 24,
format: "", // 显示的日期格式化方式 format: "", // 显示的日期格式化方式
allowEdit: true, // 是否允许编辑 allowEdit: true, // 是否允许编辑
watermark: "" watermark: BI.i18nText("BI-Basic_Unrestricted"),
}, }),
_init: function () { _init: function () {
BI.DynamicDateTimeTrigger.superclass._init.apply(this, arguments); BI.DynamicDateTimeTrigger.superclass._init.apply(this, arguments);
@ -44,7 +44,7 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
hgap: c.hgap, hgap: c.hgap,
vgap: c.vgap, vgap: c.vgap,
allowBlank: true, allowBlank: true,
watermark: BI.isKey(o.watermark) ? o.watermark : BI.i18nText("BI-Basic_Unrestricted"), watermark: o.watermark,
errorText: function (v) { errorText: function (v) {
var str = ""; var str = "";
if (!BI.isKey(o.format)) { if (!BI.isKey(o.format)) {
@ -149,7 +149,11 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
}, },
_getTitle: function () { _getTitle: function () {
var o = this.options;
var storeValue = this.storeValue || {}; var storeValue = this.storeValue || {};
if (BI.isEmptyObject(storeValue)) {
return o.watermark;
}
var type = storeValue.type || BI.DynamicDateCombo.Static; var type = storeValue.type || BI.DynamicDateCombo.Static;
var value = storeValue.value; var value = storeValue.value;
switch (type) { switch (type) {
@ -197,7 +201,7 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
// 这边不能直接用\d+去切日期, 因为format格式可能是20190607这样的没有分割符的 = = // 这边不能直接用\d+去切日期, 因为format格式可能是20190607这样的没有分割符的 = =
// 先看一下是否是合法的, 如果合法就变成标准格式的走原来的流程, 不合法不关心 // 先看一下是否是合法的, 如果合法就变成标准格式的走原来的流程, 不合法不关心
var date = BI.parseDateTime(v, this._getFormatString()); var date = BI.parseDateTime(v, this._getFormatString());
if(BI.print(date, this._getFormatString()) === v) { if (BI.print(date, this._getFormatString()) === v) {
v = BI.print(date, c.compareFormat); v = BI.print(date, c.compareFormat);
result = [0, 1, 2]; result = [0, 1, 2];
} }
@ -214,7 +218,7 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
BI.isNumeric(v) && v.length === 1 && (suffixArray[idx] = "0" + v); BI.isNumeric(v) && v.length === 1 && (suffixArray[idx] = "0" + v);
}); });
// hh:mm // hh:mm
if(suffixArray.length === 2 && !hasSecond) { if (suffixArray.length === 2 && !hasSecond) {
suffixArray.push("00"); suffixArray.push("00");
} }
var suffixString = suffixArray.join(":"); var suffixString = suffixArray.join(":");
@ -283,42 +287,42 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
_getText: function (obj) { _getText: function (obj) {
var value = ""; var value = "";
var endText = ""; var endText = "";
if(BI.isNotNull(obj.year)) { if (BI.isNotNull(obj.year)) {
if(BI.parseInt(obj.year) !== 0) { if (BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
endText = getPositionText(BI.i18nText("BI-Basic_Year"), obj.position); endText = getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
} }
if(BI.isNotNull(obj.quarter)) { if (BI.isNotNull(obj.quarter)) {
if(BI.parseInt(obj.quarter) !== 0) { if (BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
endText = getPositionText(BI.i18nText("BI-Basic_Single_Quarter"), obj.position); endText = getPositionText(BI.i18nText("BI-Basic_Single_Quarter"), obj.position);
} }
if(BI.isNotNull(obj.month)) { if (BI.isNotNull(obj.month)) {
if(BI.parseInt(obj.month) !== 0) { if (BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
endText = getPositionText(BI.i18nText("BI-Basic_Month"), obj.position); endText = getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
} }
if(BI.isNotNull(obj.week)) { if (BI.isNotNull(obj.week)) {
if(BI.parseInt(obj.week) !== 0) { if (BI.parseInt(obj.week) !== 0) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
endText = getPositionText(BI.i18nText("BI-Basic_Week"), obj.position); endText = getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
} }
if(BI.isNotNull(obj.day)) { if (BI.isNotNull(obj.day)) {
if(BI.parseInt(obj.day) !== 0) { if (BI.parseInt(obj.day) !== 0) {
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
endText = BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : ""; endText = BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
} }
if(BI.isNotNull(obj.workDay) && BI.parseInt(obj.workDay) !== 0) { if (BI.isNotNull(obj.workDay) && BI.parseInt(obj.workDay) !== 0) {
value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
} }
return value + endText; return value + endText;
function getPositionText (baseText, position) { function getPositionText(baseText, position) {
switch (position) { switch (position) {
case BI.DynamicDateCard.OFFSET.BEGIN: case BI.DynamicDateCard.OFFSET.BEGIN:
return baseText + BI.i18nText("BI-Basic_Begin_Start"); return baseText + BI.i18nText("BI-Basic_Begin_Start");

4
src/widget/editor/editor.search.js

@ -15,13 +15,12 @@ BI.SearchEditor = BI.inherit(BI.Widget, {
}); });
}, },
_init: function () { _init: function () {
this.options.height -= this.options.simple ? 1 : 2;
BI.SearchEditor.superclass._init.apply(this, arguments); BI.SearchEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.editor = BI.createWidget(o.el, { this.editor = BI.createWidget(o.el, {
type: "bi.editor", type: "bi.editor",
simple: o.simple, simple: o.simple,
height: o.height, height: BI.toPix(o.height, o.simple ? 1 : 2),
watermark: o.watermark, watermark: o.watermark,
allowBlank: true, allowBlank: true,
hgap: 1, hgap: 1,
@ -45,6 +44,7 @@ BI.SearchEditor = BI.inherit(BI.Widget, {
}); });
BI.createWidget({ BI.createWidget({
element: this, element: this,
height: BI.toPix(o.height, o.simple ? 1 : 2),
type: "bi.htape", type: "bi.htape",
items: [ items: [
{ {

12
src/widget/editor/editor.text.js

@ -26,15 +26,11 @@ BI.TextEditor = BI.inherit(BI.Widget, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
var border = o.simple ? 1 : 2; var border = o.simple ? 1 : 2;
if (BI.isNumber(o.height)) {
this.element.css({ height: o.height - border });
}
if (BI.isNumber(o.width)) {
this.element.css({ width: o.width - border });
}
this.editor = BI.createWidget({ this.editor = BI.createWidget({
type: "bi.editor", type: "bi.editor",
element: this, element: this,
width: BI.toPix(o.width, border),
height: BI.toPix(o.height, border),
simple: o.simple, simple: o.simple,
hgap: o.hgap, hgap: o.hgap,
vgap: o.vgap, vgap: o.vgap,
@ -142,6 +138,10 @@ BI.TextEditor = BI.inherit(BI.Widget, {
return this.editor.isValid(); return this.editor.isValid();
}, },
setValid: function (b) {
this.editor.setValid(b);
},
setValue: function (v) { setValue: function (v) {
this.editor.setValue(v); this.editor.setValue(v);
}, },

116
src/widget/intervalslider/intervalslider.js

@ -26,7 +26,7 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
beforeMount: function () { beforeMount: function () {
const { value, min, max } = this.options; const { value, min, max } = this.options;
this.setMinAndMax({ this._setMinAndMax({
min, min,
max, max,
}); });
@ -60,8 +60,8 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
cls: "slider-editor-button", cls: "slider-editor-button",
text: this.options.unit, text: this.options.unit,
allowBlank: false, allowBlank: false,
width: c.EDITOR_WIDTH - 2, width: BI.toPix(c.EDITOR_WIDTH, 2),
height: c.EDITOR_HEIGHT - 2, height: BI.toPix(c.EDITOR_HEIGHT, 2),
validationChecker: function (v) { validationChecker: function (v) {
return self._checkValidation(v); return self._checkValidation(v);
} }
@ -88,8 +88,8 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
cls: "slider-editor-button", cls: "slider-editor-button",
text: this.options.unit, text: this.options.unit,
allowBlank: false, allowBlank: false,
width: c.EDITOR_WIDTH - 2, width: BI.toPix(c.EDITOR_WIDTH, 2),
height: c.EDITOR_HEIGHT - 2, height: BI.toPix(c.EDITOR_HEIGHT, 2),
validationChecker: function (v) { validationChecker: function (v) {
return self._checkValidation(v); return self._checkValidation(v);
} }
@ -122,28 +122,29 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
this._setVisible(false); this._setVisible(false);
return { return {
type: "bi.vertical_fill",
rowSize: [30, 30],
items: [
this._createLabelWrapper(),
{
type: "bi.absolute", type: "bi.absolute",
element: this, items: [
items: [{ {
el: { el: {
type: "bi.vertical", type: "bi.horizontal",
items: [{ horizontalAlign: "stretch",
type: "bi.absolute", verticalAlign: "middle",
columnSize: ["fill"],
items: [{ items: [{
el: this.track, el: this.track,
width: "100%",
height: c.TRACK_HEIGHT
}]
}], }],
hgap: 7, hgap: 10,
height: c.TRACK_HEIGHT
}, },
top: 23, inset: 0
left: 0,
width: "100%"
}, },
this._createLabelWrapper(), this._createSliderWrapper(),
this._createSliderWrapper() ]
}
] ]
}; };
}, },
@ -225,14 +226,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
items: [{ items: [{
el: this.labelOne, el: this.labelOne,
top: 0, top: 0,
left: "0%" left: 0,
}] }]
}, { }, {
type: "bi.absolute", type: "bi.absolute",
items: [{ items: [{
el: this.labelTwo, el: this.labelTwo,
top: 0, top: 0,
left: "100%" right: 0,
}] }]
}], }],
rgap: c.EDITOR_R_GAP, rgap: c.EDITOR_R_GAP,
@ -248,58 +249,62 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
var c = this._constant; var c = this._constant;
return { return {
el: { el: {
type: "bi.vertical", type: "bi.horizontal",
items: [{ horizontalAlign: "stretch",
verticalAlign: "middle",
items: [
{
type: "bi.absolute", type: "bi.absolute",
items: [{ height: 12,
width: "fill",
items: [
{
el: this.sliderOne, el: this.sliderOne,
top: 0, top: 0,
left: "0%" bottom: 0,
}] left: 0
}, { }, {
type: "bi.absolute",
items: [{
el: this.sliderTwo, el: this.sliderTwo,
top: 0, top: 0,
bottom: 0,
left: "100%" left: "100%"
}] }
}], ],
hgap: c.SLIDER_WIDTH_HALF, }
height: c.SLIDER_HEIGHT ],
hgap: 10,
}, },
top: 20, inset: 0
left: 0,
width: "100%"
}; };
}, },
_createTrackWrapper: function () { _createTrackWrapper: function () {
return BI.createWidget({ return BI.createWidget({
type: "bi.horizontal",
cls: "track-wrapper",
horizontalAlign: "stretch",
verticalAlign: "middle",
columnSize: ["fill"],
scrollx: false,
items: [
{
type: "bi.absolute", type: "bi.absolute",
items: [{ height: 6,
el: {
type: "bi.vertical",
items: [{
type: "bi.absolute",
items: [{ items: [{
el: this.grayTrack, el: this.grayTrack,
top: 0, top: 0,
left: 0, left: 0,
bottom: 0,
width: "100%" width: "100%"
}, { }, {
el: this.blueTrack, el: this.blueTrack,
top: 0, top: 0,
left: 0, left: 0,
bottom: 0,
width: "0%" width: "0%"
}] }]
}], }
hgap: 8, ],
height: 8
},
top: 8,
left: 0,
width: "100%"
}]
}); });
}, },
@ -482,22 +487,23 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
}, },
setMinAndMax: function (v) { _setMinAndMax: function (v) {
var minNumber = BI.parseFloat(v.min); var minNumber = BI.parseFloat(v.min);
var maxNumber = BI.parseFloat(v.max); var maxNumber = BI.parseFloat(v.max);
if ((!isNaN(minNumber)) && (!isNaN(maxNumber)) && (maxNumber >= minNumber )) { if ((!isNaN(minNumber)) && (!isNaN(maxNumber)) && (maxNumber >= minNumber)) {
this.min = minNumber; this.min = minNumber;
this.max = maxNumber; this.max = maxNumber;
this.valueOne = minNumber; this.valueOne = minNumber;
this.valueTwo = maxNumber; this.valueTwo = maxNumber;
this.precision = this._getPrecision(); this.precision = this._getPrecision();
this.setEnable(true);
}
if (maxNumber === minNumber) {
this.setEnable(false);
} }
}, },
setMinAndMax: function (v) {
this._setMinAndMax(v);
this.setEnable(v.min <= v.max);
},
setValue: function (v) { setValue: function (v) {
var o = this.options; var o = this.options;
var valueOne = BI.parseFloat(v.min); var valueOne = BI.parseFloat(v.min);

20
src/widget/multilayerselecttree/multilayerselecttree.combo.js

@ -21,13 +21,6 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
}); });
}, },
_init: function () {
var o = this.options;
BI.isNumeric(o.width) && (o.width -= 2);
BI.isNumeric(o.height) && (o.height -= 2);
BI.MultiLayerSelectTreeCombo.superclass._init.apply(this, arguments);
},
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
@ -38,6 +31,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
if (o.allowEdit) { if (o.allowEdit) {
return { return {
type: "bi.absolute", type: "bi.absolute",
width: BI.toPix(o.width, 2),
height: BI.toPix(o.height, 2),
cls, cls,
items: [ items: [
{ {
@ -59,7 +54,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
}, },
text: o.text, text: o.text,
defaultText: o.defaultText, defaultText: o.defaultText,
height: o.height, height: BI.toPix(o.height, 2),
items: o.items, items: o.items,
value: o.value, value: o.value,
tipType: o.tipType, tipType: o.tipType,
@ -73,6 +68,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options; var self = this, o = this.options;
return { return {
type: "bi.combo", type: "bi.combo",
width: BI.toPix(o.width, 2),
height: BI.toPix(o.height, 2),
container: o.container, container: o.container,
destroyWhenHide: o.destroyWhenHide, destroyWhenHide: o.destroyWhenHide,
adjustLength: 2, adjustLength: 2,
@ -136,8 +133,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
itemsCreator: o.itemsCreator, itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter, valueFormatter: o.valueFormatter,
watermark: o.watermark, watermark: o.watermark,
// height: o.height - (o.simple ? 1 : 2), height: BI.toPix(o.height, 2),
height: o.height,
text: o.text, text: o.text,
defaultText: o.defaultText, defaultText: o.defaultText,
value: o.value, value: o.value,
@ -213,8 +209,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
ref: function (_ref) { ref: function (_ref) {
self.triggerBtn = _ref; self.triggerBtn = _ref;
}, },
width: o.height, width: BI.toPix(o.height, 2),
height: o.height, height: BI.toPix(o.height, 2),
listeners: [ listeners: [
{ {
eventName: BI.TriggerIconButton.EVENT_CHANGE, eventName: BI.TriggerIconButton.EVENT_CHANGE,

2
src/widget/multilayerselecttree/multilayerselecttree.popup.js

@ -56,7 +56,7 @@ BI.MultiLayerSelectTreePopup = BI.inherit(BI.Widget, {
self.fireEvent(BI.MultiLayerSelectTreePopup.EVENT_CHANGE); self.fireEvent(BI.MultiLayerSelectTreePopup.EVENT_CHANGE);
}); });
this.tree.css("min-height", o.minHeight - 10); this.tree.css("min-height", BI.pixFormat(o.minHeight - 10));
}, },
getValue: function () { getValue: function () {

17
src/widget/multilayersingletree/multilayersingletree.combo.js

@ -23,13 +23,6 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
}); });
}, },
_init: function () {
var o = this.options;
BI.isNumeric(o.width) && (o.width -= 2);
BI.isNumeric(o.height) && (o.height -= 2);
BI.MultiLayerSingleTreeCombo.superclass._init.apply(this, arguments);
},
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
@ -40,6 +33,8 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
if (o.allowEdit) { if (o.allowEdit) {
return { return {
type: "bi.absolute", type: "bi.absolute",
width: BI.toPix(o.width, 2),
height: BI.toPix(o.height, 2),
cls, cls,
items: [ items: [
{ {
@ -61,7 +56,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
}, },
text: o.text, text: o.text,
defaultText: o.defaultText, defaultText: o.defaultText,
height: o.height, height: BI.toPix(o.height, 2),
items: o.items, items: o.items,
value: o.value, value: o.value,
tipType: o.tipType, tipType: o.tipType,
@ -136,7 +131,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
items: o.items, items: o.items,
itemsCreator: o.itemsCreator, itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter, valueFormatter: o.valueFormatter,
height: o.height, height: BI.toPix(o.height, 2),
text: o.text, text: o.text,
defaultText: o.defaultText, defaultText: o.defaultText,
value: o.value, value: o.value,
@ -210,8 +205,8 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
ref: function (_ref) { ref: function (_ref) {
self.triggerBtn = _ref; self.triggerBtn = _ref;
}, },
width: o.height, width: BI.toPix(o.height, 2),
height: o.height, height: BI.toPix(o.height, 2),
listeners: [ listeners: [
{ {
eventName: BI.TriggerIconButton.EVENT_CHANGE, eventName: BI.TriggerIconButton.EVENT_CHANGE,

2
src/widget/multilayersingletree/multilayersingletree.popup.js

@ -55,7 +55,7 @@ BI.MultiLayerSingleTreePopup = BI.inherit(BI.Widget, {
self.fireEvent(BI.MultiLayerSingleTreePopup.EVENT_CHANGE); self.fireEvent(BI.MultiLayerSingleTreePopup.EVENT_CHANGE);
}); });
this.tree.css("min-height", o.minHeight - 10); this.tree.css("min-height", BI.pixFormat(o.minHeight - 10));
}, },
getValue: function () { getValue: function () {

2
src/widget/multiselect/multiselect.combo.js

@ -45,7 +45,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
this.trigger = BI.createWidget({ this.trigger = BI.createWidget({
type: "bi.multi_select_trigger", type: "bi.multi_select_trigger",
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
height: o.height - (o.simple ? 1 : 2), height: BI.toPix(o.height, o.simple ? 1 : 2),
text: o.text, text: o.text,
defaultText: o.defaultText, defaultText: o.defaultText,
masker: { masker: {

2
src/widget/multiselect/multiselect.combo.nobar.js

@ -41,7 +41,7 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
this.trigger = BI.createWidget({ this.trigger = BI.createWidget({
type: "bi.multi_select_trigger", type: "bi.multi_select_trigger",
height: o.height - (o.simple ? 1 : 2), height: BI.toPix(o.height, o.simple ? 1 : 2),
text: o.text, text: o.text,
defaultText: o.defaultText, defaultText: o.defaultText,
masker: { masker: {

2
src/widget/multiselect/multiselect.insert.combo.js

@ -40,7 +40,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
this.trigger = BI.createWidget({ this.trigger = BI.createWidget({
type: "bi.multi_select_insert_trigger", type: "bi.multi_select_insert_trigger",
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
height: o.height - (o.simple ? 1 : 2), height: BI.toPix(o.height, o.simple ? 1 : 2),
text: o.text, text: o.text,
watermark: o.watermark, watermark: o.watermark,
defaultText: o.defaultText, defaultText: o.defaultText,

2
src/widget/multiselect/multiselect.insert.combo.nobar.js

@ -41,7 +41,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
this.trigger = BI.createWidget({ this.trigger = BI.createWidget({
type: "bi.multi_select_insert_trigger", type: "bi.multi_select_insert_trigger",
height: o.height - (o.simple ? 1 : 2), height: BI.toPix(o.height, o.simple ? 1 : 2),
text: o.text, text: o.text,
// adapter: this.popup, // adapter: this.popup,
masker: { masker: {

2
src/widget/multiselect/multiselect.loader.nobar.js

@ -173,7 +173,7 @@ BI.MultiSelectNoBarLoader = BI.inherit(BI.Widget, {
}, },
resetHeight: function (h) { resetHeight: function (h) {
this.button_group.element.css({ "max-height": h / BI.pixRatio + BI.pixUnit }); this.button_group.element.css({ "max-height": BI.toPix(h) });
}, },
resetWidth: function () { resetWidth: function () {

4
src/widget/multiselect/search/multiselect.search.insert.pane.js

@ -54,11 +54,11 @@ BI.MultiSelectSearchInsertPane = BI.inherit(BI.Widget, {
}); });
this.resizer = BI.createWidget({ this.resizer = BI.createWidget({
type: "bi.vtape", type: "bi.vertical_fill",
rowSize: ["", "fill"],
element: this, element: this,
items: [{ items: [{
el: this.addNotMatchTip, el: this.addNotMatchTip,
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
}, { }, {
el: this.loader, el: this.loader,
}], }],

7
src/widget/multiselectlist/multiselectlist.insert.js

@ -74,7 +74,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
ref: function (ref) { ref: function (ref) {
self.editor = ref; self.editor = ref;
}, },
height: o.searcherHeight || BI.SIZE_CONSANTS.TRIGGER_HEIGHT,
}, },
isAutoSearch: false, isAutoSearch: false,
isAutoSync: false, isAutoSync: false,
@ -83,7 +82,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
}, },
adapter: this.adapter, adapter: this.adapter,
popup: this.searcherPane, popup: this.searcherPane,
height: 200,
masker: false, masker: false,
listeners: [{ listeners: [{
eventName: BI.Searcher.EVENT_START, eventName: BI.Searcher.EVENT_START,
@ -168,14 +166,13 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
}); });
BI.createWidget({ BI.createWidget({
type: "bi.vtape", type: "bi.vertical_fill",
rowSize: ["", "fill"],
element: this, element: this,
items: [{ items: [{
el: this.trigger, el: this.trigger,
height: o.searcherHeight || BI.SIZE_CONSANTS.TRIGGER_HEIGHT,
}, { }, {
el: this.adapter, el: this.adapter,
height: "fill"
}] }]
}); });
BI.createWidget({ BI.createWidget({

4
src/widget/multiselecttree/multiselecttree.js

@ -100,11 +100,11 @@ BI.MultiSelectTree = BI.inherit(BI.Single, {
}); });
BI.createWidget({ BI.createWidget({
type: "bi.vtape", type: "bi.vertical_fill",
element: this, element: this,
items: [{ items: [{
el: this.searcher, el: this.searcher,
height: this._constant.EDITOR_HEIGHT height: ""
}, { }, {
el: this.adapter, el: this.adapter,
height: "fill" height: "fill"

2
src/widget/multitree/multi.tree.combo.js

@ -27,7 +27,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
this.trigger = BI.createWidget({ this.trigger = BI.createWidget({
type: "bi.multi_select_trigger", type: "bi.multi_select_trigger",
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
height: o.height - (o.simple ? 1 : 2), height: BI.toPix(o.height, o.simple ? 1 : 2),
valueFormatter: o.valueFormatter, valueFormatter: o.valueFormatter,
text: o.text, text: o.text,
defaultText: o.defaultText, defaultText: o.defaultText,

2
src/widget/multitree/multi.tree.insert.combo.js

@ -28,7 +28,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
this.trigger = BI.createWidget({ this.trigger = BI.createWidget({
type: "bi.multi_select_trigger", type: "bi.multi_select_trigger",
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
height: o.height - (o.simple ? 1 : 2), height: BI.toPix(o.height, o.simple ? 1 : 2),
valueFormatter: o.valueFormatter, valueFormatter: o.valueFormatter,
text: o.text, text: o.text,
defaultText: o.defaultText, defaultText: o.defaultText,

2
src/widget/multitree/multi.tree.list.combo.js

@ -32,7 +32,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
text: o.text, text: o.text,
defaultText: o.defaultText, defaultText: o.defaultText,
watermark: o.watermark, watermark: o.watermark,
height: o.height - (o.simple ? 1 : 2), height: BI.toPix(o.height, o.simple ? 1 : 2),
valueFormatter: o.valueFormatter, valueFormatter: o.valueFormatter,
masker: { masker: {
offset: { offset: {

4
src/widget/numbereditor/number.editor.js

@ -27,7 +27,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
var self = this, o = this.options; var self = this, o = this.options;
this.editor = BI.createWidget({ this.editor = BI.createWidget({
type: "bi.sign_editor", type: "bi.sign_editor",
height: o.height - 2, height: BI.toPix(o.height, 2),
simple: o.simple, simple: o.simple,
allowBlank: o.allowBlank, allowBlank: o.allowBlank,
value: o.valueFormatter(o.value), value: o.valueFormatter(o.value),
@ -87,7 +87,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
}); });
BI.createWidget({ BI.createWidget({
type: "bi.htape", type: "bi.htape",
height: o.height - 2, height: BI.toPix(o.height, 2),
element: this, element: this,
items: [this.editor, { items: [this.editor, {
el: { el: {

102
src/widget/numberinterval/numberinterval.js

@ -36,7 +36,7 @@ BI.NumberInterval = BI.inherit(BI.Single, {
BI.NumberInterval.superclass._init.apply(this, arguments); BI.NumberInterval.superclass._init.apply(this, arguments);
this.smallEditor = BI.createWidget({ this.smallEditor = BI.createWidget({
type: "bi.number_interval_single_editor", type: "bi.number_interval_single_editor",
height: o.height - (o.simple ? 1 : 2), height: BI.toPix(o.height, o.simple ? 1 : 2),
watermark: o.watermark, watermark: o.watermark,
allowBlank: o.allowBlank, allowBlank: o.allowBlank,
value: o.min, value: o.min,
@ -61,7 +61,7 @@ BI.NumberInterval = BI.inherit(BI.Single, {
this.smallTip = BI.createWidget({ this.smallTip = BI.createWidget({
type: "bi.label", type: "bi.label",
text: o.numTip, text: o.numTip,
height: o.height - (o.simple ? 1 : 2), height: BI.toPix(o.height, o.simple ? 1 : 2),
invisible: true invisible: true
}); });
BI.createWidget({ BI.createWidget({
@ -76,7 +76,7 @@ BI.NumberInterval = BI.inherit(BI.Single, {
this.bigEditor = BI.createWidget({ this.bigEditor = BI.createWidget({
type: "bi.number_interval_single_editor", type: "bi.number_interval_single_editor",
height: o.height - (o.simple ? 1 : 2), height: BI.toPix(o.height, o.simple ? 1 : 2),
watermark: o.watermark, watermark: o.watermark,
allowBlank: o.allowBlank, allowBlank: o.allowBlank,
value: o.max, value: o.max,
@ -99,7 +99,7 @@ BI.NumberInterval = BI.inherit(BI.Single, {
this.bigTip = BI.createWidget({ this.bigTip = BI.createWidget({
type: "bi.label", type: "bi.label",
text: o.numTip, text: o.numTip,
height: o.height - (o.simple ? 1 : 2), height: BI.toPix(o.height, o.simple ? 1 : 2),
invisible: true invisible: true
}); });
BI.createWidget({ BI.createWidget({
@ -114,7 +114,8 @@ BI.NumberInterval = BI.inherit(BI.Single, {
this.smallCombo = BI.createWidget({ this.smallCombo = BI.createWidget({
type: "bi.icon_combo", type: "bi.icon_combo",
cls: "number-interval-small-combo" + (o.simple ? "" : " bi-border-top bi-border-bottom bi-border-right bi-border-corner-right-radius"), cls: "number-interval-small-combo" + (o.simple ? "" : " bi-border-top bi-border-bottom bi-border-right bi-border-corner-right-radius"),
height: o.height - (o.simple ? 0 : 2), height: BI.toPix(o.height, o.simple ? 0 : 2),
width: BI.toPix(c.width, c.border),
items: [{ items: [{
text: "(" + BI.i18nText("BI-Less_Than") + ")", text: "(" + BI.i18nText("BI-Less_Than") + ")",
iconCls: "less-font", iconCls: "less-font",
@ -133,7 +134,8 @@ BI.NumberInterval = BI.inherit(BI.Single, {
this.bigCombo = BI.createWidget({ this.bigCombo = BI.createWidget({
type: "bi.icon_combo", type: "bi.icon_combo",
cls: "number-interval-big-combo" + (o.simple ? "" : " bi-border-top bi-border-bottom bi-border-left bi-border-corner-left-radius"), cls: "number-interval-big-combo" + (o.simple ? "" : " bi-border-top bi-border-bottom bi-border-left bi-border-corner-left-radius"),
height: o.height - (o.simple ? 0 : 2), height: BI.toPix(o.height, o.simple ? 0 : 2),
width: BI.toPix(c.width, c.border),
items: [{ items: [{
text: "(" + BI.i18nText("BI-Less_Than") + ")", text: "(" + BI.i18nText("BI-Less_Than") + ")",
iconCls: "less-font", iconCls: "less-font",
@ -152,71 +154,83 @@ BI.NumberInterval = BI.inherit(BI.Single, {
this.label = BI.createWidget({ this.label = BI.createWidget({
type: "bi.label", type: "bi.label",
text: BI.i18nText("BI-Basic_Value"), text: BI.i18nText("BI-Basic_Value"),
textHeight: o.height - (o.simple ? 0 : c.border * 2), textHeight: o.height,
width: c.width - (o.simple ? 0 : c.border * 2), // width: BI.toPix(o.width, o.simple ? 0 : c.border * 2),
height: o.height - (o.simple ? 0 : c.border * 2), hgap: 5,
height: o.height,
level: "warning", level: "warning",
tipType: "warning" tipType: "warning"
}); });
this.left = BI.createWidget({ this.left = BI.createWidget({
type: "bi.htape", type: "bi.horizontal_fill",
columnSize: ["fill", ""],
items: [{ items: [{
el: self.smallEditor el: self.smallEditor
}, { }, {
el: self.smallCombo, el: self.smallCombo,
width: c.width - c.border
}] }]
}); });
this.right = BI.createWidget({ this.right = BI.createWidget({
type: "bi.htape", type: "bi.horizontal_fill",
columnSize: ["", "fill"],
items: [{ items: [{
el: self.bigCombo, el: self.bigCombo,
width: c.width - c.border
}, { }, {
el: self.bigEditor, el: self.bigEditor,
// BI-23883 间距考虑边框 // BI-23883 间距考虑边框
lgap: 1 // lgap: 1
}] }]
}); });
BI.createWidget({ BI.createWidget({
element: self, element: self,
type: "bi.center", type: "bi.horizontal_fill",
hgap: 15, columnSize: ["fill", "", "fill"],
height: o.height,
items: [
{
type: "bi.absolute",
items: [{ items: [{
el: self.left, el: self.left
left: -15,
right: 0,
top: 0,
bottom: 0
}]
}, { }, {
type: "bi.absolute", el: self.label
items: [{ }, {
el: self.right, el: self.right
left: 0,
right: -15,
top: 0,
bottom: 0
}] }]
}
]
});
BI.createWidget({
element: self,
type: "bi.horizontal_auto",
items: [
self.label
]
}); });
// BI.createWidget({
// element: self,
// type: "bi.horizontal_auto",
// items: [
// self.label
// ]
// });
// BI.createWidget({
// element: self,
// type: "bi.center",
// hgap: 15,
// height: o.height,
// items: [
// {
// type: "bi.absolute",
// items: [{
// el: self.left,
// left: -15,
// right: 0,
// top: 0,
// bottom: 0
// }]
// }, {
// type: "bi.absolute",
// items: [{
// el: self.right,
// left: 0,
// right: -15,
// top: 0,
// bottom: 0
// }]
// }
// ]
// });
self._setValidEvent(self.bigEditor, c.bigEditor); self._setValidEvent(self.bigEditor, c.bigEditor);
self._setValidEvent(self.smallEditor, c.smallEditor); self._setValidEvent(self.smallEditor, c.smallEditor);

2
src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js

@ -35,7 +35,7 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
this.trigger = BI.createWidget({ this.trigger = BI.createWidget({
type: "bi.search_multi_select_trigger", type: "bi.search_multi_select_trigger",
text: o.text, text: o.text,
height: o.height - (o.simple ? 1 : 2), height: BI.toPix(o.height, o.simple ? 1 : 2),
// adapter: this.popup, // adapter: this.popup,
masker: { masker: {
offset: { offset: {

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save