Browse Source

Merge pull request #214705 in DEC/fineui from release/11.0 to final/11.0

* commit 'ea776c0be708f36dc71b8eb27a43abe6d3ff19e4':
  BI-119128 fix: 【自适应迭代发散】小屏编辑,高度适应+自定义(1366*449),直接预览,文本控件下拉选项偏离
  BI-119112 fix:editor弹出errorbubble位置修改
  Revert "BI-119112 fix:editor可以自定义error bubble位置"
  BI-119112 fix:editor可以自定义error bubble位置
  BI-119217 fix: 【6.0.6冒烟】等比自适应-高清屏-宽度自适应预览,下拉树查看已选展示异常
  REPORT-87371 fix: 【BI6.0】【目录管理-管理首页】添加首页时模板类型的下拉框为空
  auto upgrade version to 2.0.20221218194544
  auto upgrade version to 2.0.20221216170431
  BI-118262 fix: 树过滤组件搜索过滤不生效
  BI-117667 fix: 【6.0.5冒烟】数值下拉选择多个选项,查看已选点击加载更多展示重复数据
  auto upgrade version to 2.0.20221216114354
  KERNEL-13893 feat: 颜色选择器默认色板候选调整
  auto upgrade version to 2.0.20221216100516
  auto upgrade version to 2.0.20221215221629
  auto upgrade version to 2.0.20221215220552
  无JRIA fix: 再检查一遍输入框圆角问题
research/test
superman 2 years ago
parent
commit
9093689c7f
  1. 2
      package.json
  2. 4
      src/base/combination/combo.js
  3. 8
      src/case/colorchooser/colorpicker/button/button.colorshow.js
  4. 253
      src/case/colorchooser/colorpicker/colorpicker.hex.js
  5. 58
      src/case/colorchooser/colorpicker/editor.colorpicker.hex.js
  6. 36
      src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js
  7. 14
      src/case/colorchooser/colorpicker/editor.colorpicker.js
  8. 8
      src/case/colorchooser/colorpicker/editor.colorpicker.simple.js
  9. 2
      src/case/ztree/parttree.js
  10. 5
      src/core/controller/controller.bubbles.js
  11. 78
      src/core/platform/web/dom.js
  12. 15
      src/widget/multiselect/check/multiselect.display.js
  13. 22
      src/widget/multitree/multi.tree.combo.js
  14. 23
      src/widget/multitree/multi.tree.insert.combo.js
  15. 18
      src/widget/multitree/trigger/multi.tree.search.insert.pane.js
  16. 12
      src/widget/multitree/trigger/multi.tree.search.pane.js
  17. 15
      src/widget/multitree/trigger/searcher.multi.tree.js

2
package.json

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

4
src/base/combination/combo.js

@ -310,8 +310,8 @@
var scaleX = positonedRect.width / positionRelativeElement.offsetWidth;
var scaleY = positonedRect.height / positionRelativeElement.offsetHeight;
p.top && (p.top = Math.round(p.top / scaleY));
p.left && (p.left = Math.round(p.left / scaleX));
p.top && (p.top = Math.round(p.top / scaleY + positionRelativeElement.scrollTop));
p.left && (p.left = Math.round(p.left / scaleX + positionRelativeElement.scrollLeft));
p.adaptHeight && (p.adaptHeight = Math.round(p.adaptHeight / scaleY));
}

8
src/case/colorchooser/colorpicker/button/button.colorshow.js

@ -6,14 +6,15 @@
BI.ColorChooserShowButton = BI.inherit(BI.BasicButton, {
props: {
baseCls: 'bi-color-chooser-show-button bi-border bi-list-item-effect',
baseCls: 'bi-color-chooser-show-button bi-border bi-list-item-effect bi-border-radius',
},
render: function () {
var self = this, o = this.options;
return {
type: 'bi.htape',
items: [{
items: [
{
el: {
type: "bi.icon_label",
ref: function (_ref) {
@ -28,8 +29,9 @@ BI.ColorChooserShowButton = BI.inherit(BI.BasicButton, {
type: 'bi.label',
textAlign: 'left',
text: o.text,
}]
}
]
};
},
doClick: function () {

253
src/case/colorchooser/colorpicker/colorpicker.hex.js

@ -11,118 +11,173 @@ BI.HexColorPicker = BI.inherit(BI.Widget, {
},
_items: [
[{
value: "#808080"
}, {
value: "#ffffff"
}, {
value: "#ffebe5"
}, {
value: "#ffddba"
}, {
value: "#ffeebb"
}, {
value: "#d4e9bf"
}, {
value: "#c7e1e1"
}, {
value: "#bfe3f0"
}, {
value: "#ccd6eb"
}],
[{
value: "#616161"
}, {
value: "#f2f2f2"
}, {
value: "#ffd6cc"
}, {
value: "#ffb87a"
}, {
value: "#ffdf91"
}, {
value: "#b7d2b6"
}, {
value: "#a3d2c9"
}, {
value: "#8ab6d6"
}, {
value: "#bcbce0"
}],
[{
value: "#404040"
}, {
value: "#dedede"
}, {
value: "#ffab9b"
}, {
value: "#eb8a3a"
}, {
value: "#ffc947"
}, {
value: "#8aa964"
}, {
value: "#5eaaa0"
}, {
value: "#2978b5"
}, {
value: "#8f8faa"
}],
[{
value: "#202020"
}, {
value: "#bfbfbf"
}, {
value: "#df7461"
}, {
value: "#cf7536"
}, {
value: "#e6b63b"
}, {
value: "#5b8a72"
}, {
value: "#3b9aa3"
}, {
value: "#336291"
}, {
value: "#58568f"
}],
[{
value: "#000000"
}, {
value: "#a1a1a1"
}, {
value: "#b55140"
}, {
value: "#a6713c"
}, {
value: "#ad975f"
}, {
value: "#5f7d6e"
}, {
value: "#3b7480"
}, {
value: "#425d78"
}, {
value: "#62608a"
}]
[
{
"value": "#999999"
},
{
"value": "#FFFFFF"
},
{
"value": "#FFE5E5"
},
{
"value": "#FFF1E5"
},
{
"value": "#FFF9E5"
},
{
"value": "#E9F5E9"
},
{
"value": "#EAEEFF"
},
{
"value": "#EFEBF7"
},
{
"value": "#FCE8EF"
}
],
[
{
"value": "#737373"
},
{
"value": "#F2F2F2"
},
{
"value": "#FFA6A6"
},
{
"value": "#FFD0A6"
},
{
"value": "#FFEDA6"
},
{
"value": "#B3DCB2"
},
{
"value": "#B9C6FF"
},
{
"value": "#CABAE6"
},
{
"value": "#F8B1C9"
}
],
[
{
"value": "#4C4C4C"
},
{
"value": "#D9D9D9"
},
{
"value": "#FF5959"
},
{
"value": "#FFA759"
},
{
"value": "#FFDD59"
},
{
"value": "#7EBE70"
},
{
"value": "#7B95FF"
},
{
"value": "#9C7FD0"
},
{
"value": "#F06D99"
}
],
[
{
"value": "#262626"
},
{
"value": "#BFBFBF"
},
{
"value": "#FF0000"
},
{
"value": "#FF7800"
},
{
"value": "#FFCB00"
},
{
"value": "#259B23"
},
{
"value": "#355CFF"
},
{
"value": "#673AB7"
},
{
"value": "#E91E63"
}
],
[
{
"value": "#000000"
},
{
"value": "#A6A6A6"
},
{
"value": "#A80000"
},
{
"value": "#B65600"
},
{
"value": "#CEB000"
},
{
"value": "#0E550C"
},
{
"value": "#09269C"
},
{
"value": "#3A1A73"
},
{
"value": "#B30072"
}
]
],
render: function () {
var self = this, o = this.options;
return {
type: "bi.button_group",
items: this._digest(o.items || this._items),
layouts: [{
layouts: [
{
type: "bi.grid",
}],
}
],
value: o.value,
listeners: [{
listeners: [
{
eventName: BI.ButtonGroup.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.HexColorPicker.EVENT_CHANGE, arguments);
}
}],
}
],
ref: function (_ref) {
self.colors = _ref;
}

58
src/case/colorchooser/colorpicker/editor.colorpicker.hex.js

@ -33,14 +33,15 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, {
var Ws = BI.map(BI.range(0, 3), function () {
return {
type: "bi.small_text_editor",
cls: "color-picker-editor-input",
cls: "color-picker-editor-input bi-border-radius",
validationChecker: checker,
errorText: BI.i18nText("BI-Color_Picker_Error_Text"),
allowBlank: true,
value: 255,
width: c.RGB_WIDTH,
height: 24,
listeners: [{
listeners: [
{
eventName: BI.TextEditor.EVENT_CHANGE,
action: function () {
self._checkEditors();
@ -49,33 +50,39 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, {
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
}
}]
}
]
};
});
return {
type: "bi.absolute",
items: [{
items: [
{
el: {
type: "bi.vertical",
tgap: 10,
items: [{
items: [
{
type: 'bi.vertical_adapt',
columnSize: ["fill", 'fill'],
height: 24,
items: [{
items: [
{
type: "bi.color_picker_show_button",
cls: "trans-color-icon",
height: 22,
title: BI.i18nText("BI-Transparent_Color"),
text: BI.i18nText("BI-Transparent_Color"),
listeners: [{
listeners: [
{
eventName: BI.ColorChooserShowButton.EVENT_CHANGE,
action: function () {
self.setValue("transparent");
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
}],
}
],
ref: function (_ref) {
self.transparent = _ref;
}
@ -86,26 +93,30 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, {
height: 22,
title: BI.i18nText("BI-Basic_Auto"),
text: BI.i18nText("BI-Basic_Auto"),
listeners: [{
listeners: [
{
eventName: BI.ColorChooserShowButton.EVENT_CHANGE,
action: function () {
self.setValue("");
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
}],
}
],
ref: function (_ref) {
self.none = _ref;
}
},
lgap: 10,
}]
}
]
}, {
el: {
type: "bi.vertical_adapt",
columnSize: [22, 10, 'fill', 12, c.RGB_WIDTH, 12, c.RGB_WIDTH, 12, c.RGB_WIDTH],
rgap: 5,
items: [{
items: [
{
el: {
type: "bi.layout",
cls: "color-picker-editor-display bi-card bi-border",
@ -125,13 +136,14 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.hexEditor = _ref;
},
cls: "color-picker-editor-input",
cls: "color-picker-editor-input bi-border-radius",
validationChecker: this._hexChecker,
allowBlank: true,
errorText: BI.i18nText("BI-Color_Picker_Error_Text_Hex"),
width: c.HEX_WIDTH,
height: 24,
listeners: [{
listeners: [
{
eventName: "EVENT_CHANGE",
action: function () {
self._checkHexEditor();
@ -141,38 +153,42 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, {
}
}
}]
}
]
}, RGB[0], {
el: BI.extend(Ws[0], {
ref: function (_ref) {
self.R = _ref
self.R = _ref;
}
}),
width: c.RGB_WIDTH
}, RGB[1], {
el: BI.extend(Ws[1], {
ref: function (_ref) {
self.G = _ref
self.G = _ref;
}
}),
width: c.RGB_WIDTH
}, RGB[2], {
el: BI.extend(Ws[2], {
ref: function (_ref) {
self.B = _ref
self.B = _ref;
}
}),
rgap: -5,
width: c.RGB_WIDTH
}]
}
}]
]
}
}
]
},
left: 0,
right: 0,
top: 0,
bottom: 0
}]
}
]
};
},

36
src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js

@ -31,14 +31,15 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, {
var Ws = BI.map(BI.range(0, 3), function () {
return {
type: "bi.small_text_editor",
cls: "color-picker-editor-input",
cls: "color-picker-editor-input bi-border-radius",
validationChecker: checker,
errorText: BI.i18nText("BI-Color_Picker_Error_Text"),
allowBlank: true,
value: 255,
width: c.RGB_WIDTH,
height: 24,
listeners: [{
listeners: [
{
eventName: BI.TextEditor.EVENT_CHANGE,
action: function () {
self._checkEditors();
@ -47,19 +48,22 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, {
self.fireEvent(BI.SimpleColorPickerEditor.EVENT_CHANGE);
}
}
}]
}
]
};
});
return {
type: "bi.vertical",
tgap: 10,
items: [{
items: [
{
el: {
type: "bi.vertical_adapt",
rgap: 5,
columnSize: [22, 10, 'fill', 12, c.RGB_WIDTH, 12, c.RGB_WIDTH, 12, c.RGB_WIDTH],
items: [{
items: [
{
el: {
type: "bi.layout",
cls: "color-picker-editor-display bi-card bi-border",
@ -79,13 +83,14 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.hexEditor = _ref;
},
cls: "color-picker-editor-input",
cls: "color-picker-editor-input bi-border-radius",
validationChecker: this._hexChecker,
allowBlank: true,
errorText: BI.i18nText("BI-Color_Picker_Error_Text_Hex"),
width: c.HEX_WIDTH,
height: 24,
listeners: [{
listeners: [
{
eventName: "EVENT_CHANGE",
action: function () {
self._checkHexEditor();
@ -94,34 +99,37 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, {
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
}
}]
}
]
}, RGB[0], {
el: BI.extend(Ws[0], {
ref: function (_ref) {
self.R = _ref
self.R = _ref;
}
}),
width: c.RGB_WIDTH
}, RGB[1], {
el: BI.extend(Ws[1], {
ref: function (_ref) {
self.G = _ref
self.G = _ref;
}
}),
width: c.RGB_WIDTH
}, RGB[2], {
el: BI.extend(Ws[2], {
ref: function (_ref) {
self.B = _ref
self.B = _ref;
}
}),
rgap: -5,
width: c.RGB_WIDTH
}]
}
}]
]
}
}
]
};
},
_hexChecker: function (v) {

14
src/case/colorchooser/colorpicker/editor.colorpicker.js

@ -41,7 +41,7 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
};
var Ws = BI.createWidgets([{}, {}, {}], {
type: "bi.small_text_editor",
cls: "color-picker-editor-input",
cls: "color-picker-editor-input bi-border-radius",
validationChecker: checker,
errorText: BI.i18nText("BI-Color_Picker_Error_Text"),
allowBlank: true,
@ -95,10 +95,12 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
items: [
{
el: {
type: "bi.vertical_adapt",
items: [{
items: [
{
el: this.colorShow,
width: 16
}, {
@ -127,13 +129,15 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
el: this.none,
width: 16,
lgap: 5
}]
}
]
},
left: 10,
right: 10,
top: 0,
bottom: 0
}]
}
]
});
},

8
src/case/colorchooser/colorpicker/editor.colorpicker.simple.js

@ -40,7 +40,7 @@ BI.SimpleColorPickerEditor = BI.inherit(BI.Widget, {
};
var Ws = BI.createWidgets([{}, {}, {}], {
type: "bi.small_text_editor",
cls: "color-picker-editor-input",
cls: "color-picker-editor-input bi-border-radius",
validationChecker: checker,
errorText: BI.i18nText("BI-Color_Picker_Error_Text"),
allowBlank: true,
@ -64,7 +64,8 @@ BI.SimpleColorPickerEditor = BI.inherit(BI.Widget, {
BI.createWidget({
type: "bi.vertical_adapt",
element: this,
items: [{
items: [
{
el: this.colorShow,
width: 16,
lgap: 20,
@ -87,7 +88,8 @@ BI.SimpleColorPickerEditor = BI.inherit(BI.Widget, {
}, {
el: this.B,
width: c.RGB_WIDTH
}]
}
]
});
},

2
src/case/ztree/parttree.js

@ -37,6 +37,7 @@ BI.PartTree = BI.inherit(BI.AsyncTree, {
var self = this, o = this.options;
var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var name = this._getNodeValue(treeNode);
this.fireEvent(BI.PartTree.EVENT_CLICK_TREE_NODE);
if (treeNode.checked === true) {
this.options.paras.selectedValues = this._getUnionValue();
// this._buildTree(self.options.paras.selectedValues, BI.concat(parentValues, name));
@ -197,4 +198,5 @@ BI.PartTree = BI.inherit(BI.AsyncTree, {
}
});
BI.PartTree.EVENT_CLICK_TREE_NODE = "EVENT_CLICK_TREE_NODE";
BI.shortcut("bi.part_tree", BI.PartTree);

5
src/core/controller/controller.bubbles.js

@ -71,10 +71,7 @@ BI.BubblesController = BI.inherit(BI.Controller, {
{
name: "preventOverflow",
enabled: false
}, {
name: "flip",
enabled: false
},
}
]
});
return this;

78
src/core/platform/web/dom.js

@ -239,13 +239,15 @@
},
isRightSpaceLarger: function (combo) {
var windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
return windowBounds.width - combo.element.offset().left - combo.element.bounds().width >= combo.element.offset().left;
var comboBounds = combo.element[0].getBoundingClientRect(),
viewportBounds = document.documentElement.getBoundingClientRect();
return viewportBounds.width - comboBounds.right >= comboBounds.left;
},
isBottomSpaceLarger: function (combo) {
var windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
return windowBounds.height - combo.element.offset().top - combo.element.bounds().height >= combo.element.offset().top;
var comboBounds = combo.element[0].getBoundingClientRect(),
viewportBounds = document.documentElement.getBoundingClientRect();
return viewportBounds.height - comboBounds.bottom >= comboBounds.top;
},
_getLeftAlignPosition: function (combo, popup, extraWidth, container) {
@ -279,9 +281,9 @@
};
},
getLeftAdaptPosition: function (combo, popup, extraWidth) {
if (BI.DOM.isLeftSpaceEnough(combo, popup, extraWidth)) {
return BI.DOM.getLeftPosition(combo, popup, extraWidth);
getLeftAdaptPosition: function (combo, popup, extraWidth, container) {
if (BI.DOM.isLeftSpaceEnough(combo, popup, extraWidth, container)) {
return BI.DOM.getLeftPosition(combo, popup, extraWidth, container);
}
return {
left: 0
@ -312,12 +314,12 @@
};
},
getRightAdaptPosition: function (combo, popup, extraWidth) {
if (BI.DOM.isRightSpaceEnough(combo, popup, extraWidth)) {
return BI.DOM.getRightPosition(combo, popup, extraWidth);
getRightAdaptPosition: function (combo, popup, extraWidth, container) {
if (BI.DOM.isRightSpaceEnough(combo, popup, extraWidth, container)) {
return BI.DOM.getRightPosition(combo, popup, extraWidth, container);
}
return {
left: BI.Widget._renderEngine.createElement("body").bounds().width - popup.element.bounds().width
left: document.documentElement.getBoundingClientRect().width - popup.element[0].getBoundingClientRect().width - container.getBoundingClientRect().left
};
},
@ -355,26 +357,28 @@
};
},
getTopAdaptPosition: function (combo, popup, extraHeight, needAdaptHeight) {
var popupBounds = popup.element.bounds(),
windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
getTopAdaptPosition: function (combo, popup, extraHeight, needAdaptHeight, positionRelativeElement) {
var comboBounds = combo.element[0].getBoundingClientRect(),
popupBounds = popup.element[0].getBoundingClientRect(),
positionRelativeElementRect = positionRelativeElement.getBoundingClientRect(),
viewportBounds = document.documentElement.getBoundingClientRect();
if (BI.DOM.isTopSpaceEnough(combo, popup, extraHeight)) {
return BI.DOM.getTopPosition(combo, popup, extraHeight);
}
if (needAdaptHeight) {
return {
top: 0,
adaptHeight: combo.element.offset().top - extraHeight
top: 0 - positionRelativeElementRect.top,
adaptHeight: comboBounds.top - extraHeight
};
}
if (popupBounds.height + extraHeight > windowBounds.height) {
if (popupBounds.height + extraHeight > viewportBounds.height) {
return {
top: 0,
adaptHeight: windowBounds.height - extraHeight
top: 0 - positionRelativeElementRect.top,
adaptHeight: viewportBounds.height - extraHeight
};
}
return {
top: 0
top: 0 - positionRelativeElementRect.top
};
},
@ -412,26 +416,28 @@
};
},
getBottomAdaptPosition: function (combo, popup, extraHeight, needAdaptHeight) {
var comboBounds = combo.element[0].getBoundingClientRect(), popupBounds = popup.element[0].getBoundingClientRect(),
windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
getBottomAdaptPosition: function (combo, popup, extraHeight, needAdaptHeight, positionRelativeElement) {
var comboBounds = combo.element[0].getBoundingClientRect(),
popupBounds = popup.element[0].getBoundingClientRect(),
viewportBounds = document.documentElement.getBoundingClientRect(),
positionRelativeElementRect = positionRelativeElement.getBoundingClientRect();
if (BI.DOM.isBottomSpaceEnough(combo, popup, extraHeight)) {
return BI.DOM.getBottomPosition(combo, popup, extraHeight);
return BI.DOM.getBottomPosition(combo, popup, extraHeight, positionRelativeElement);
}
if (needAdaptHeight) {
return {
top: comboBounds.top + comboBounds.height + extraHeight,
adaptHeight: windowBounds.height - comboBounds.top - comboBounds.height - extraHeight
top: comboBounds.top + comboBounds.height + extraHeight - positionRelativeElementRect.top,
adaptHeight: viewportBounds.height - comboBounds.top - comboBounds.height - extraHeight
};
}
if (popupBounds.height + extraHeight > windowBounds.height) {
if (popupBounds.height + extraHeight > viewportBounds.height) {
return {
top: extraHeight,
adaptHeight: windowBounds.height - extraHeight
top: extraHeight - positionRelativeElementRect.top,
adaptHeight: viewportBounds.height - extraHeight
};
}
return {
top: windowBounds.height - popupBounds.height - extraHeight
top: viewportBounds.height - popupBounds.height - extraHeight - positionRelativeElementRect.top
};
},
@ -638,10 +644,10 @@
case "left":
case "right":
if (BI.DOM.isRightSpaceLarger(combo)) {
left = BI.DOM.getRightAdaptPosition(combo, popup, extraWidth).left;
left = BI.DOM.getRightAdaptPosition(combo, popup, extraWidth, container).left;
firstDir = "right";
} else {
left = BI.DOM.getLeftAdaptPosition(combo, popup, extraWidth).left;
left = BI.DOM.getLeftAdaptPosition(combo, popup, extraWidth, container).left;
firstDir = "left";
}
if (topBottom[0] === "bottom") {
@ -656,19 +662,19 @@
return pos;
default :
if (BI.DOM.isBottomSpaceLarger(combo)) {
top = BI.DOM.getBottomAdaptPosition(combo, popup, extraHeight, needAdaptHeight).top;
top = BI.DOM.getBottomAdaptPosition(combo, popup, extraHeight, needAdaptHeight, container).top;
firstDir = "bottom";
} else {
top = BI.DOM.getTopAdaptPosition(combo, popup, extraHeight, needAdaptHeight).top;
top = BI.DOM.getTopAdaptPosition(combo, popup, extraHeight, needAdaptHeight, container).top;
firstDir = "top";
}
if (leftRight[0] === "right") {
pos = BI.DOM.getLeftAlignPosition(combo, popup, extraWidth);
pos = BI.DOM.getLeftAlignPosition(combo, popup, extraWidth, container);
pos.top = top;
pos.dir = firstDir + "," + pos.dir;
return pos;
}
pos = BI.DOM.getRightAlignPosition(combo, popup, extraWidth);
pos = BI.DOM.getRightAlignPosition(combo, popup, extraWidth, container);
pos.top = top;
pos.dir = firstDir + "," + pos.dir;
return pos;

15
src/widget/multiselect/check/multiselect.display.js

@ -40,10 +40,12 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, {
},
items: this._createItems(opts.items),
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
layouts: [{
layouts: [
{
type: "bi.vertical",
lgap: 10
}]
}
]
},
itemsCreator: function (options, callback) {
if (options.times === 1) {
@ -53,10 +55,7 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, {
if (cacheItems.length > 0) {
var renderedItems = cacheItems.slice(0, 100);
cacheItems = cacheItems.slice(100);
self.hasNext = true;
if (cacheItems.length === 0) {
self.hasNext = false;
}
self.hasNext = cacheItems.length > 0;
callback(self._createItems(renderedItems));
return;
}
@ -65,8 +64,8 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, {
self.hasNext = !!ob.hasNext;
var firstItemsCount = 100 + ob.items.length % 100;
if (ob.items.length > 100) {
cacheItems = ob.items.slice(100 + ob.items.length % 100);
self.hasNext = true;
cacheItems = ob.items.slice(firstItemsCount);
self.hasNext = (firstItemsCount === ob.items.length) ? false : true;
}
callback(self._createItems(ob.items.slice(0, firstItemsCount)));
});

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

@ -42,7 +42,15 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
},
searcher: {
type: "bi.multi_tree_searcher",
itemsCreator: o.itemsCreator
itemsCreator: o.itemsCreator,
listeners: [
{
eventName: BI.MultiTreeSearcher.EVENT_CLICK_TREE_NODE,
action: function () {
self._dataChange = true;
}
}
],
},
value: { value: o.value || {} }
});
@ -61,7 +69,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
},
listeners: [{
listeners: [
{
eventName: BI.MultiTreePopup.EVENT_AFTERINIT,
action: function () {
self.numberCounter.adjustView();
@ -97,7 +106,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
self.setValue();
self._defaultState();
}
}],
}
],
itemsCreator: o.itemsCreator,
onLoaded: function () {
BI.nextTick(function () {
@ -293,7 +303,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
items: [
{
el: this.combo,
left: 0,
right: 0,
@ -312,7 +323,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
right: o.height,
top: 0,
bottom: 0
}]
}
]
});
},

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

@ -47,7 +47,8 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",
listeners: [{
listeners: [
{
eventName: BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM,
action: function () {
self.storeValue.value[self.trigger.getSearcher().getKeyword()] = {};
@ -58,7 +59,13 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
self._stopEditing();
self._dataChange = true;
}
}]
}, {
eventName: BI.MultiTreeSearchInsertPane.EVENT_CLICK_TREE_NODE,
action: function () {
self._dataChange = true;
}
}
]
}
},
value: { value: o.value || {} }
@ -79,7 +86,8 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
},
listeners: [{
listeners: [
{
eventName: BI.MultiTreePopup.EVENT_AFTERINIT,
action: function () {
self.numberCounter.adjustView();
@ -115,7 +123,8 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
self.setValue();
self._defaultState();
}
}],
}
],
itemsCreator: o.itemsCreator,
onLoaded: function () {
BI.nextTick(function () {
@ -303,7 +312,8 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
items: [
{
el: this.combo,
left: 0,
right: 0,
@ -322,7 +332,8 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
right: o.height,
top: 0,
height: o.height,
}]
}
]
});
},

18
src/widget/multitree/trigger/multi.tree.search.insert.pane.js

@ -25,7 +25,8 @@ BI.MultiTreeSearchInsertPane = BI.inherit(BI.Widget, {
return {
type: "bi.absolute",
items: [{
items: [
{
el: {
type: "bi.text_button",
invisible: true,
@ -57,7 +58,8 @@ BI.MultiTreeSearchInsertPane = BI.inherit(BI.Widget, {
self.partTree = _ref;
},
value: opts.value,
listeners: [{
listeners: [
{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -67,13 +69,20 @@ BI.MultiTreeSearchInsertPane = BI.inherit(BI.Widget, {
action: function () {
self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_CHANGE);
}
}]
}, {
eventName: BI.PartTree.EVENT_CLICK_TREE_NODE,
action: function () {
self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_CLICK_TREE_NODE);
}
}
]
}, opts.el),
left: 0,
top: 0,
bottom: 0,
right: 0
}]
}
]
};
},
@ -115,5 +124,6 @@ BI.MultiTreeSearchInsertPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiTreeSearchInsertPane.EVENT_CLICK_CONFIRM = "EVENT_CLICK_CONFIRM";
BI.MultiTreeSearchInsertPane.EVENT_CLICK_CLEAR = "EVENT_CLICK_CLEAR";
BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiTreeSearchInsertPane.EVENT_CLICK_TREE_NODE = "EVENT_CLICK_TREE_NODE";
BI.shortcut("bi.multi_tree_search_insert_pane", BI.MultiTreeSearchInsertPane);

12
src/widget/multitree/trigger/multi.tree.search.pane.js

@ -25,7 +25,8 @@ BI.MultiTreeSearchPane = BI.inherit(BI.Pane, {
opts.itemsCreator(op, callback);
},
value: opts.value,
listeners: [{
listeners: [
{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -35,7 +36,13 @@ BI.MultiTreeSearchPane = BI.inherit(BI.Pane, {
action: function () {
self.fireEvent(BI.MultiTreeSearchPane.EVENT_CHANGE);
}
}],
}, {
eventName: BI.PartTree.EVENT_CLICK_TREE_NODE,
action: function () {
self.fireEvent(BI.MultiTreeSearchPane.EVENT_CLICK_TREE_NODE);
}
}
],
ref: function (_ref) {
self.partTree = _ref;
}
@ -72,5 +79,6 @@ BI.MultiTreeSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiTreeSearchPane.EVENT_CLICK_CONFIRM = "EVENT_CLICK_CONFIRM";
BI.MultiTreeSearchPane.EVENT_CLICK_CLEAR = "EVENT_CLICK_CLEAR";
BI.MultiTreeSearchPane.EVENT_CLICK_TREE_NODE = "EVENT_CLICK_TREE_NODE";
BI.shortcut("bi.multi_tree_search_pane", BI.MultiTreeSearchPane);

15
src/widget/multitree/trigger/searcher.multi.tree.js

@ -33,7 +33,8 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
defaultText: o.defaultText,
height: o.height
},
listeners: [{
listeners: [
{
eventName: BI.MultiSelectEditor.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS);
@ -43,7 +44,8 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
action: function () {
self.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR);
}
}]
}
]
});
this.searcher = BI.createWidget({
@ -67,6 +69,14 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
op.keyword = self.editor.getValue();
o.itemsCreator(op, callback);
},
listeners: [
{
eventName: BI.MultiTreeSearchPane.EVENT_CLICK_TREE_NODE,
action: function () {
self.fireEvent(BI.MultiTreeSearcher.EVENT_CLICK_TREE_NODE, arguments);
}
}
],
value: o.value
}, o.popup),
@ -206,4 +216,5 @@ BI.MultiTreeSearcher.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiTreeSearcher.EVENT_START = "EVENT_START";
BI.MultiTreeSearcher.EVENT_STOP = "EVENT_STOP";
BI.MultiTreeSearcher.EVENT_PAUSE = "EVENT_PAUSE";
BI.MultiTreeSearcher.EVENT_CLICK_TREE_NODE = "EVENT_CLICK_TREE_NODE";
BI.shortcut("bi.multi_tree_searcher", BI.MultiTreeSearcher);

Loading…
Cancel
Save