Browse Source

Pull request #1: Master >> Feature/x

Merge in ~DAILER/fineui-decision from master to feature/x

* commit 'f7fe05da3f56c3a7c58b028b6fde4c06fa660632': (56 commits)
  auto upgrade version to 2.0.20221101100519
  auto upgrade version to 2.0.20221031221611
  REPORT-82014 fix:补齐AFTER_HIDEVIEW事件
  auto upgrade version to 2.0.20221031190602
  auto upgrade version to 2.0.20221031135635
  BI-115201 fix: 【6.0.3.3】下拉树下拉后不选择任何内容,前端多发一个data请求
  BI-115201 fix: 【6.0.3.3】下拉树下拉后不选择任何内容,前端多发一个data请求
  auto upgrade version to 2.0.20221031101438
  auto upgrade version to 2.0.20221031095439
  bugfix
  auto upgrade version to 2.0.20221028191610
  feature: 增加instruction组件
  feature: 增加instruction组件
  REPORT-83214 fix: 不允许编辑的下拉树展示多了滚动条(finui的bi.multilayer_single_tree_combo组件)
  auto upgrade version to 2.0.20221028145548
  auto upgrade version to 2.0.20221028143506
  update
  update
  update
  KERNEL-13158: 优化
  ...
research/test
Dailer-刘荣歆 2 years ago
parent
commit
7dd7228eb6
  1. 2
      demo/js/config/widget.js
  2. 8
      demo/js/widget/multitree/demo.multi_tree_combo.js
  3. 2
      package.json
  4. 36
      src/base/collection/collection.js
  5. 8
      src/base/combination/group.button.js
  6. 19
      src/base/combination/navigation.js
  7. 17
      src/base/combination/tab.js
  8. 36
      src/base/grid/grid.js
  9. 23
      src/base/single/button/button.basic.js
  10. 76
      src/base/single/instruction/instruction.js
  11. 2
      src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js
  12. 25
      src/case/layer/panel.js
  13. 6
      src/component/treevaluechooser/combo.treevaluechooser.js
  14. 2
      src/core/2.base.js
  15. 21
      src/core/4.widget.js
  16. 2
      src/core/platform/web/detectElementResize.js
  17. 2
      src/core/utils/events/mousemovetracker.js
  18. 22
      src/core/wrapper/layout/sticky/sticky.horizontal.js
  19. 22
      src/core/wrapper/layout/sticky/sticky.vertical.js
  20. 11
      src/less/base/single/button/button.half.less
  21. 11
      src/less/base/single/input/checkbox.less
  22. 11
      src/less/base/single/input/radio.less
  23. 31
      src/less/base/single/instruction.less
  24. 10
      src/less/base/single/tip/tip.bubble.less
  25. 267
      src/less/base/tree/ztree.less
  26. 25
      src/less/case/tree/tree.item.less
  27. 20
      src/less/core/utils/common.less
  28. 52
      src/less/resource/background.less
  29. 2
      src/less/visual.less
  30. 17
      src/widget/intervalslider/intervalslider.js
  31. 2
      src/widget/multilayersingletree/multilayersingletree.combo.js
  32. 14
      src/widget/multitree/multi.tree.combo.js
  33. 11
      src/widget/multitree/multi.tree.insert.combo.js
  34. 11
      src/widget/multitree/multi.tree.list.combo.js
  35. 3
      typescript/index.ts
  36. 4
      typescript/widget/datepane/datepane.ts
  37. 4
      typescript/widget/dynamicdate/dynamicdate.combo.ts
  38. 4
      typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts
  39. 2
      typescript/widget/year/combo.year.ts
  40. 13
      typescript/widget/year/popup.year.ts

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,

8
demo/js/widget/multitree/demo.multi_tree_combo.js

@ -38,7 +38,15 @@ Demo.MultiTreeCombo = BI.inherit(BI.Widget, {
width: 300, width: 300,
value: { value: {
"根目录": {} "根目录": {}
},
listeners: [
{
eventName: "EVENT_CONFIRM",
action: function () {
console.log("EVENT_CONFIRM", this.getValue());
}
} }
]
}, { }, {
type: "bi.button", type: "bi.button",
text: "getValue", text: "getValue",

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "fineui", "name": "fineui",
"version": "2.0.20221024153423", "version": "2.0.20221101100519",
"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",

36
src/base/collection/collection.js

@ -280,12 +280,44 @@ BI.CollectionView = BI.inherit(BI.Widget, {
} }
}, },
_isOverflowX: function () {
var o = this.options;
// 兼容一下
var scrollable = o.scrollable, scrollx = o.scrollx;
if (o.overflowX === false) {
return false;
}
if (scrollx) {
return true;
}
if (scrollable === true || scrollable === "xy" || scrollable === "x") {
return true;
}
return false;
},
_isOverflowY: function () {
var o = this.options;
// 兼容一下
var scrollable = o.scrollable, scrolly = o.scrolly;
if (o.overflowX === false) {
return false;
}
if (scrolly) {
return true;
}
if (scrollable === true || scrollable === "xy" || scrollable === "y") {
return true;
}
return false;
},
_getMaxScrollLeft: function () { _getMaxScrollLeft: function () {
return Math.max(0, this._width - this.options.width + (this.options.overflowX ? BI.DOM.getScrollWidth() : 0)); return Math.max(0, this._width - this.options.width + (this._isOverflowX() ? BI.DOM.getScrollWidth() : 0));
}, },
_getMaxScrollTop: function () { _getMaxScrollTop: function () {
return Math.max(0, this._height - this.options.height + (this.options.overflowY ? BI.DOM.getScrollWidth() : 0)); return Math.max(0, this._height - this.options.height + (this._isOverflowY() ? BI.DOM.getScrollWidth() : 0));
}, },
_populate: function (items) { _populate: function (items) {

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

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

19
src/base/combination/navigation.js

@ -43,11 +43,10 @@ BI.Navigation = BI.inherit(BI.Widget, {
return self.showIndex + v; return self.showIndex + v;
}, },
cardCreator: function (v) { cardCreator: function (v) {
BI.Widget.pushContext(self); BI.Widget.execWithContext(self, function () {
var card = o.cardCreator(v); self.cardMap[v] = o.cardCreator(v);
BI.Widget.popContext(); });
self.cardMap[v] = card; return self.cardMap[v];
return card;
}, },
afterCardCreated: BI.bind(this.afterCardCreated, this), afterCardCreated: BI.bind(this.afterCardCreated, this),
afterCardShow: BI.bind(this.afterCardShow, this), afterCardShow: BI.bind(this.afterCardShow, this),
@ -104,12 +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)) {
BI.Widget.pushContext(this); BI.Widget.execWithContext(self, function () {
var card = this.options.cardCreator(v); self.cardMap[v] = o.cardCreator(v);
BI.Widget.popContext(); });
this.cardMap[v] = card; this.layout.addCardByName(v, this.cardMap[v]);
this.layout.addCardByName(v, card);
this.afterCardCreated(v); this.afterCardCreated(v);
} }
}, },

17
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(v);
});
return card; return self.cardMap[v];
}, },
afterCardShow: function (v) { afterCardShow: function (v) {
self._deleteOtherCards(v); self._deleteOtherCards(v);
@ -71,12 +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)) {
BI.Widget.pushContext(this); BI.Widget.execWithContext(this, function () {
var card = this.options.cardCreator(v); self.cardMap[v] = o.cardCreator(v);
BI.Widget.popContext(); });
this.cardMap[v] = card; this.layout.addCardByName(v, this.cardMap[v]);
this.layout.addCardByName(v, card);
} }
}, },

36
src/base/grid/grid.js

@ -262,12 +262,44 @@ BI.GridView = BI.inherit(BI.Widget, {
} }
}, },
_isOverflowX: function () {
var o = this.options;
// 兼容一下
var scrollable = o.scrollable, scrollx = o.scrollx;
if (o.overflowX === false) {
return false;
}
if (scrollx) {
return true;
}
if (scrollable === true || scrollable === "xy" || scrollable === "x") {
return true;
}
return false;
},
_isOverflowY: function () {
var o = this.options;
// 兼容一下
var scrollable = o.scrollable, scrolly = o.scrolly;
if (o.overflowX === false) {
return false;
}
if (scrolly) {
return true;
}
if (scrollable === true || scrollable === "xy" || scrollable === "y") {
return true;
}
return false;
},
_getMaxScrollLeft: function () { _getMaxScrollLeft: function () {
return Math.max(0, this._getContainerWidth() - this.options.width + (this.options.overflowX ? BI.DOM.getScrollWidth() : 0)); return Math.max(0, this._getContainerWidth() - this.options.width + (this._isOverflowX() ? BI.DOM.getScrollWidth() : 0));
}, },
_getMaxScrollTop: function () { _getMaxScrollTop: function () {
return Math.max(0, this._getContainerHeight() - this.options.height + (this.options.overflowY ? BI.DOM.getScrollWidth() : 0)); return Math.max(0, this._getContainerHeight() - this.options.height + (this._isOverflowY() ? BI.DOM.getScrollWidth() : 0));
}, },
_getContainerWidth: function () { _getContainerWidth: function () {

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

76
src/base/single/instruction/instruction.js

@ -0,0 +1,76 @@
BI.Instruction = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.Link.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-instruction",
height: 20,
level: "error",
textAlign: "left",
whiteSpace: "nowrap",
hgap: 5
});
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
cls: "instruction-" + o.level,
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
textHeight: o.height,
height: o.height,
hgap: o.hgap,
rgap: o.rgap,
lgap: o.lgap,
vgap: o.vgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py
};
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
setText: function (v) {
this.options.text = v;
this.text.setText(v);
},
getText: function () {
return this.options.text;
},
setStyle: function (css) {
this.text.setStyle(css);
},
setValue: function (v) {
this.text.setValue(v);
},
getValue: function () {
this.text.getValue();
}
});
BI.shortcut("bi.instruction", BI.Instruction);

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

@ -91,6 +91,7 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
eventName: BI.Combo.EVENT_AFTER_HIDEVIEW, eventName: BI.Combo.EVENT_AFTER_HIDEVIEW,
action: function () { action: function () {
self.trigger.stopEditing(); self.trigger.stopEditing();
self.fireEvent(BI.SearchTextValueCombo.EVENT_AFTER_HIDEVIEW);
} }
}, { }, {
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW, eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW,
@ -148,4 +149,5 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
}); });
BI.SearchTextValueCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.SearchTextValueCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.SearchTextValueCombo.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW"
BI.shortcut("bi.search_text_value_combo", BI.SearchTextValueCombo); BI.shortcut("bi.search_text_value_combo", BI.SearchTextValueCombo);

25
src/case/layer/panel.js

@ -11,22 +11,21 @@ BI.Panel = BI.inherit(BI.Widget, {
titleHeight: 30, titleHeight: 30,
titleButtons: [], titleButtons: [],
el: {}, el: {},
logic: { // logic: {
dynamic: false // dynamic: false
} // }
}); });
}, },
_init: function () { render: function () {
BI.Panel.superclass._init.apply(this, arguments); BI.Panel.superclass._init.apply(this, arguments);
var o = this.options; var o = this.options;
BI.createWidget(BI.extend({ return {
element: this type: "bi.vertical_fill",
}, BI.LogicFactory.createLogic("vertical", BI.extend(o.logic, { rowSize: ["", "fill"],
items: BI.LogicFactory.createLogicItemsByDirection("top", this._createTitle() items: [this._createTitle(), this.options.el]
, this.options.el) };
}))));
}, },
_createTitle: function () { _createTitle: function () {
@ -56,7 +55,7 @@ BI.Panel = BI.inherit(BI.Widget, {
}); });
return { return {
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: BI.toPix(o.titleHeight, 1), height: BI.toPix(o.titleHeight, 1),
@ -66,8 +65,8 @@ BI.Panel = BI.inherit(BI.Widget, {
}, },
lhgap: 10, lhgap: 10,
rhgap: 10 rhgap: 10
}, // },
height: BI.toPix(o.titleHeight, 1) // height: BI.toPix(o.titleHeight, 1)
}; };
}, },

6
src/component/treevaluechooser/combo.treevaluechooser.js

@ -73,6 +73,11 @@ BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, {
action: function () { action: function () {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_BEFORE_POPUPVIEW); self.fireEvent(BI.TreeValueChooserCombo.EVENT_BEFORE_POPUPVIEW);
} }
}, {
eventName: BI.MultiTreeCombo.EVENT_AFTER_HIDEVIEW,
action: function () {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_AFTER_HIDEVIEW);
}
}] }]
}); });
}, },
@ -128,4 +133,5 @@ BI.TreeValueChooserCombo.EVENT_BLUR = "EVENT_BLUR";
BI.TreeValueChooserCombo.EVENT_STOP = "EVENT_STOP"; BI.TreeValueChooserCombo.EVENT_STOP = "EVENT_STOP";
BI.TreeValueChooserCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; BI.TreeValueChooserCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.TreeValueChooserCombo.EVENT_SEARCHING = "EVENT_SEARCHING"; BI.TreeValueChooserCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.TreeValueChooserCombo.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";
BI.shortcut("bi.tree_value_chooser_combo", BI.TreeValueChooserCombo); BI.shortcut("bi.tree_value_chooser_combo", BI.TreeValueChooserCombo);

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

21
src/core/4.widget.js

@ -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;
@ -927,16 +938,6 @@
return vm; return vm;
}; };
BI.execWithContext = function (_context, fn) {
BI.Widget.pushContext(_context);
try {
fn();
} catch (e) {
// nothing
}
BI.Widget.popContext();
};
BI.watch = function (vm, watch, handler) { BI.watch = function (vm, watch, handler) {
// 必须要保证组件当前环境存在 // 必须要保证组件当前环境存在
if (BI.Widget.current) { if (BI.Widget.current) {

2
src/core/platform/web/detectElementResize.js

@ -553,7 +553,7 @@ var ResizeObserver = window.ResizeObserver || ResizeObserverPolyfill.ResizeObser
if (!element.__resizeObserver__) { if (!element.__resizeObserver__) {
var resizeObserver = new ResizeObserver(function () { var resizeObserver = new ResizeObserver(function () {
element.__resizeListeners__.forEach(function (listener) { element.__resizeListeners__.forEach(function (listener) {
listener(); BI.$(element).is(":visible") && listener();
}); });
}); });
resizeObserver.observe(element); resizeObserver.observe(element);

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

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: '';
} }

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

@ -6,17 +6,18 @@
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;

11
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,13 +20,12 @@
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;

31
src/less/base/single/instruction.less

@ -0,0 +1,31 @@
@import "../../index.less";
.bi-instruction {
.border-radius(2px);
&.instruction-error{
background: @color-bi-background-bubble-error;
color: @color-bi-text-failure;
}
&.instruction-common{
background: @color-bi-background-bubble-normal;
color: @color-bi-text-highlight;
}
&.instruction-success{
background: @color-bi-background-bubble-success;
color: @color-bi-text-success;
}
&.instruction-warning{
background: @color-bi-background-bubble-warning;
color: @color-bi-text-redmark;
}
}
.bi-theme-dark {
.bi-instruction.instruction-error {
background: @color-bi-background-bubble-error-theme-dark;
}
}

10
src/less/base/single/tip/tip.bubble.less

@ -9,10 +9,6 @@
color: @color-bi-text-failure; color: @color-bi-text-failure;
} }
.bi-theme-dark &.bubble-error {
background: @color-bi-background-bubble-error-theme-dark;
}
&.bubble-common{ &.bubble-common{
background: @color-bi-background-bubble-normal; background: @color-bi-background-bubble-normal;
color: @color-bi-text-highlight; color: @color-bi-text-highlight;
@ -28,3 +24,9 @@
color: @color-bi-text-redmark; color: @color-bi-text-redmark;
} }
} }
.bi-theme-dark {
.bi-bubble.bubble-error {
background: @color-bi-background-bubble-error-theme-dark;
}
}

267
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;
} }
} }
@ -113,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 {
@ -163,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 {
@ -183,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 {
@ -215,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 {
background-position: -28px 0
} }
.ztree li span.button.chk.radio_false_full_focus { .ztree.solid li span.button.center_docu {
background-position: -28px -14px background: none;
} position: relative;
.ztree li span.button.chk.radio_false_part { &:before {
background-position: -28px -28px 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_focus { &:after {
background-position: -28px -42px 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_disable { .ztree.solid li span.button.bottom_docu {
background-position: -28px -56px background: none;
position: relative;
&:before {
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 { .ztree li span.button.chk {
background-position: -42px -42px 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 {
@ -292,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 {
@ -366,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;
}*/

25
src/less/case/tree/tree.item.less

@ -1,6 +1,29 @@
@import "../../index.less"; @import "../../index.less";
.tree-first-solid-line-conn-background, .tree-mid-solid-line-conn-background { .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 { &:before {
position: absolute; position: absolute;
top: 0; top: 0;

20
src/less/core/utils/common.less

@ -77,6 +77,7 @@
&: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;
} }

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

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 {

17
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,
}); });
@ -260,12 +260,12 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
items: [ items: [
{ {
el: this.sliderOne, el: this.sliderOne,
top: 1, top: 0,
bottom: 0, bottom: 0,
left: 0 left: 0
}, { }, {
el: this.sliderTwo, el: this.sliderTwo,
top: 1, top: 0,
bottom: 0, bottom: 0,
left: "100%" left: "100%"
} }
@ -487,7 +487,7 @@ 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)) {
@ -496,13 +496,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
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);

2
src/widget/multilayersingletree/multilayersingletree.combo.js

@ -49,6 +49,8 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
} }
return BI.extend(baseConfig, { return BI.extend(baseConfig, {
width: BI.toPix(o.width, 2),
height: BI.toPix(o.height, 2),
el: { el: {
type: "bi.single_tree_trigger", type: "bi.single_tree_trigger",
ref: function (_ref) { ref: function (_ref) {

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

@ -82,6 +82,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
self.numberCounter.setButtonChecked(val); self.numberCounter.setButtonChecked(val);
self.storeValue = { value: self.combo.getValue() }; self.storeValue = { value: self.combo.getValue() };
self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM, self.combo.getValue()); self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM, self.combo.getValue());
self._dataChange = true;
} }
}, { }, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM, eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM,
@ -92,6 +93,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CLEAR, eventName: BI.MultiTreePopup.EVENT_CLICK_CLEAR,
action: function () { action: function () {
clear = true; clear = true;
self._dataChange = true;
self.setValue(); self.setValue();
self._defaultState(); self._defaultState();
} }
@ -180,12 +182,16 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None);
self.numberCounter.setButtonChecked(val); self.numberCounter.setButtonChecked(val);
self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM, self.combo.getValue()); self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM, self.combo.getValue());
self._dataChange = true;
}); });
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () { this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
if (isSearching()) { if (isSearching()) {
return; return;
} }
if (!this.isViewVisible()) {
self._dataChange = false; // 标记数据是否发生变化
}
if (change === true) { if (change === true) {
self.storeValue = { value: self.combo.getValue() }; self.storeValue = { value: self.combo.getValue() };
change = false; change = false;
@ -198,7 +204,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () { this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () {
if (isSearching()) { if (isSearching()) {
self._stopEditing(); self._stopEditing();
self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM); self._dataChange && self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM);
} else { } else {
if (isPopupView()) { if (isPopupView()) {
self._stopEditing(); self._stopEditing();
@ -206,12 +212,15 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
if (clear === true) { if (clear === true) {
self.storeValue = { value: {} }; self.storeValue = { value: {} };
} }
self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM); self._dataChange && self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM);
} }
} }
clear = false; clear = false;
change = false; change = false;
}); });
this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () {
self.fireEvent(BI.MultiTreeCombo.EVENT_AFTER_HIDEVIEW);
});
var triggerBtn = BI.createWidget({ var triggerBtn = BI.createWidget({
type: "bi.trigger_icon_button", type: "bi.trigger_icon_button",
@ -367,5 +376,6 @@ BI.MultiTreeCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiTreeCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; BI.MultiTreeCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.MultiTreeCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.MultiTreeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.MultiTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; BI.MultiTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.MultiTreeCombo.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";
BI.shortcut("bi.multi_tree_combo", BI.MultiTreeCombo); BI.shortcut("bi.multi_tree_combo", BI.MultiTreeCombo);

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

@ -56,6 +56,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
self.combo.setValue(self.storeValue); self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue); self.numberCounter.setValue(self.storeValue);
self._stopEditing(); self._stopEditing();
self._dataChange = true;
} }
}] }]
} }
@ -99,6 +100,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
self.numberCounter.setButtonChecked(val); self.numberCounter.setButtonChecked(val);
self.storeValue = { value: self.combo.getValue() }; self.storeValue = { value: self.combo.getValue() };
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.getValue()); self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.getValue());
self._dataChange = true;
} }
}, { }, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM, eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM,
@ -109,6 +111,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CLEAR, eventName: BI.MultiTreePopup.EVENT_CLICK_CLEAR,
action: function () { action: function () {
clear = true; clear = true;
self._dataChange = true;
self.setValue(); self.setValue();
self._defaultState(); self._defaultState();
} }
@ -192,12 +195,16 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None);
self.numberCounter.setButtonChecked(val); self.numberCounter.setButtonChecked(val);
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue()); self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue());
self._dataChange = true;
}); });
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () { this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
if (isSearching()) { if (isSearching()) {
return; return;
} }
if (!this.isViewVisible()) {
self._dataChange = false; // 标记数据是否发生变化
}
if (change === true) { if (change === true) {
self.storeValue = { value: self.combo.getValue() }; self.storeValue = { value: self.combo.getValue() };
change = false; change = false;
@ -210,7 +217,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () { this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () {
if (isSearching()) { if (isSearching()) {
self._stopEditing(); self._stopEditing();
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM); self._dataChange && self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM);
} else { } else {
if (isPopupView()) { if (isPopupView()) {
self._stopEditing(); self._stopEditing();
@ -218,7 +225,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
if (clear === true) { if (clear === true) {
self.storeValue = { value: {} }; self.storeValue = { value: {} };
} }
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM); self._dataChange && self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM);
} }
} }
clear = false; clear = false;

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

@ -59,6 +59,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
self.combo.setValue(self.storeValue); self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue); self.numberCounter.setValue(self.storeValue);
self._stopEditing(); self._stopEditing();
self._dataChange = true;
} }
}] }]
} }
@ -116,6 +117,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
self.numberCounter.setButtonChecked(val); self.numberCounter.setButtonChecked(val);
self.storeValue = { value: self.combo.getValue() }; self.storeValue = { value: self.combo.getValue() };
self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.getValue()); self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.getValue());
self._dataChange = true;
} }
}, { }, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM, eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM,
@ -126,6 +128,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CLEAR, eventName: BI.MultiTreePopup.EVENT_CLICK_CLEAR,
action: function () { action: function () {
clear = true; clear = true;
self._dataChange = true;
self.setValue(); self.setValue();
self._defaultState(); self._defaultState();
} }
@ -209,12 +212,16 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None);
self.numberCounter.setButtonChecked(val); self.numberCounter.setButtonChecked(val);
self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue()); self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue());
self._dataChange = true;
}); });
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () { this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
if (isSearching()) { if (isSearching()) {
return; return;
} }
if (!this.isViewVisible()) {
self._dataChange = false; // 标记数据是否发生变化
}
if (change === true) { if (change === true) {
self.storeValue = { value: self.combo.getValue() }; self.storeValue = { value: self.combo.getValue() };
change = false; change = false;
@ -227,7 +234,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () { this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () {
if (isSearching()) { if (isSearching()) {
self.trigger.stopEditing(); self.trigger.stopEditing();
self.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM); self._dataChange && self.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM);
} else { } else {
if (isPopupView()) { if (isPopupView()) {
self._stopEditing(); self._stopEditing();
@ -235,7 +242,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
if (clear === true) { if (clear === true) {
self.storeValue = { value: [] }; self.storeValue = { value: [] };
} }
self.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM); self._dataChange && self.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM);
} }
} }
clear = false; clear = false;

3
typescript/index.ts

@ -145,6 +145,7 @@ import { ArrowTreeGroupNodeCheckbox } from "./case/checkbox/check.arrownode";
import { NumberInterval } from "./widget/numberinterval/numberinterval"; import { NumberInterval } from "./widget/numberinterval/numberinterval";
import { DynamicYearQuarterCombo } from "./widget/yearquarter/combo.yearquarter"; import { DynamicYearQuarterCombo } from "./widget/yearquarter/combo.yearquarter";
import { DynamicYearCombo } from "./widget/year/combo.year"; import { DynamicYearCombo } from "./widget/year/combo.year";
import { DynamicYearPopup } from "./widget/year/popup.year";
import { IntervalSlider } from "./widget/intervalslider/intervalslider"; import { IntervalSlider } from "./widget/intervalslider/intervalslider";
import { MultiSelectInsertList } from "./widget/multiselectlist/multiselectlist.insert"; import { MultiSelectInsertList } from "./widget/multiselectlist/multiselectlist.insert";
import { YearMonthInterval } from "./widget/yearmonthinterval/yearmonthinterval"; import { YearMonthInterval } from "./widget/yearmonthinterval/yearmonthinterval";
@ -350,6 +351,7 @@ export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils {
NumberInterval: typeof NumberInterval; NumberInterval: typeof NumberInterval;
DynamicYearQuarterCombo: typeof DynamicYearQuarterCombo; DynamicYearQuarterCombo: typeof DynamicYearQuarterCombo;
DynamicYearCombo: typeof DynamicYearCombo; DynamicYearCombo: typeof DynamicYearCombo;
DynamicYearPopup: typeof DynamicYearPopup;
IntervalSlider: typeof IntervalSlider; IntervalSlider: typeof IntervalSlider;
MultiSelectInsertList: typeof MultiSelectInsertList; MultiSelectInsertList: typeof MultiSelectInsertList;
YearMonthInterval: typeof YearMonthInterval; YearMonthInterval: typeof YearMonthInterval;
@ -546,6 +548,7 @@ export {
NumberInterval, NumberInterval,
DynamicYearQuarterCombo, DynamicYearQuarterCombo,
DynamicYearCombo, DynamicYearCombo,
DynamicYearPopup,
IntervalSlider, IntervalSlider,
MultiSelectInsertList, MultiSelectInsertList,
YearMonthInterval, YearMonthInterval,

4
typescript/widget/datepane/datepane.ts

@ -4,8 +4,8 @@ export declare class DynamicDatePane extends Widget {
static xtype: string; static xtype: string;
static EVENT_CHANGE: string; static EVENT_CHANGE: string;
static EVENT_BEFORE_YEAR_MONTH_POPUPVIEW: string; static EVENT_BEFORE_YEAR_MONTH_POPUPVIEW: string;
static Static: 1; static Static: number;
static Dynamic: 2; static Dynamic: number;
setMinDate(minDate: string): void; setMinDate(minDate: string): void;

4
typescript/widget/dynamicdate/dynamicdate.combo.ts

@ -2,8 +2,8 @@ import { Single } from '../../base/single/single';
export declare class DynamicDateCombo extends Single { export declare class DynamicDateCombo extends Single {
static xtype: string; static xtype: string;
static Static: 1; static Static: number;
static Dynamic: 2; static Dynamic: number;
static EVENT_KEY_DOWN: string; static EVENT_KEY_DOWN: string;
static EVENT_CONFIRM: string; static EVENT_CONFIRM: string;

4
typescript/widget/dynamicdatetime/dynamicdatetime.combo.ts

@ -11,8 +11,8 @@ export declare class DynamicDateTimeCombo extends Single {
static EVENT_ERROR: string; static EVENT_ERROR: string;
static EVENT_BEFORE_POPUPVIEW: string; static EVENT_BEFORE_POPUPVIEW: string;
static EVENT_BEFORE_YEAR_MONTH_POPUPVIEW: string; static EVENT_BEFORE_YEAR_MONTH_POPUPVIEW: string;
static Static: 1; static Static: number;
static Dynamic: 2; static Dynamic: number;
props: { props: {
minDate?: string; minDate?: string;
maxDate?: string; maxDate?: string;

2
typescript/widget/year/combo.year.ts

@ -2,6 +2,8 @@ import { Widget } from "../../core/widget";
export declare class DynamicYearCombo extends Widget { export declare class DynamicYearCombo extends Widget {
static xtype: string; static xtype: string;
static Static: number;
static Dynamic: number;
static EVENT_CONFIRM: string; static EVENT_CONFIRM: string;
static EVENT_BEFORE_POPUPVIEW: string; static EVENT_BEFORE_POPUPVIEW: string;

13
typescript/widget/year/popup.year.ts

@ -0,0 +1,13 @@
import { Widget } from '../../core/widget';
export declare class DynamicYearPopup extends Widget {
static xtype: string;
static BUTTON_CLEAR_EVENT_CHANGE: string;
static BUTTON_lABEL_EVENT_CHANGE: string;
static BUTTON_OK_EVENT_CHANGE: string;
static EVENT_CHANGE: string;
setMinDate(minDate?: string): void;
setMaxDate(maxDate?: string): void;
}
Loading…
Cancel
Save