Browse Source

Merge branch 'master' of ssh://code.fineres.com:7999/~claire.tang/fineui

es6
Claire 3 years ago
parent
commit
6434b351ef
  1. 3
      bi.lessconfig.json
  2. BIN
      dist/font/iconfont.eot
  3. 4
      dist/font/iconfont.svg
  4. BIN
      dist/font/iconfont.ttf
  5. BIN
      dist/font/iconfont.woff
  6. BIN
      dist/font/iconfont.woff2
  7. 2
      package.json
  8. 4
      src/base/combination/group.virtual.js
  9. 11
      src/base/layer/layer.popover.js
  10. 17
      src/base/layer/layer.popup.js
  11. 16
      src/base/single/button/listitem/blankicontextitem.js
  12. 11
      src/base/single/input/file.js
  13. 15
      src/base/single/tip/tip.toast.js
  14. 68
      src/case/button/item.multiselect.js
  15. 4
      src/case/button/item.singleselect.icontext.js
  16. 4
      src/case/button/item.singleselect.js
  17. 60
      src/case/button/item.singleselect.radio.js
  18. 48
      src/case/button/node/node.arrow.js
  19. 50
      src/case/button/node/node.plus.js
  20. 8
      src/case/combo/bubblecombo/combo.bubble.js
  21. 76
      src/case/combo/bubblecombo/popup.bubble.js
  22. 6
      src/core/3.ob.js
  23. 2
      src/core/5.inject.js
  24. 7
      src/core/func/function.js
  25. 4
      src/core/logic/logic.js
  26. 18
      src/core/logic/logic.layout.js
  27. 6
      src/core/structure/cache.js
  28. 96
      src/core/wrapper/layout.js
  29. 4
      src/core/wrapper/layout/adapt/absolute.horizontal.js
  30. 2
      src/core/wrapper/layout/adapt/absolute.leftrightvertical.js
  31. 4
      src/core/wrapper/layout/adapt/absolute.vertical.js
  32. 4
      src/core/wrapper/layout/adapt/adapt.center.js
  33. 8
      src/core/wrapper/layout/adapt/adapt.leftrightvertical.js
  34. 4
      src/core/wrapper/layout/adapt/adapt.vertical.js
  35. 4
      src/core/wrapper/layout/adapt/inline.center.js
  36. 4
      src/core/wrapper/layout/adapt/inline.horizontal.js
  37. 4
      src/core/wrapper/layout/adapt/inline.vertical.js
  38. 2
      src/core/wrapper/layout/flex/flex.center.js
  39. 2
      src/core/wrapper/layout/flex/flex.horizontal.center.js
  40. 4
      src/core/wrapper/layout/flex/flex.leftrightvertical.center.js
  41. 2
      src/core/wrapper/layout/flex/flex.vertical.center.js
  42. 4
      src/core/wrapper/layout/float/float.absolute.horizontal.js
  43. 2
      src/core/wrapper/layout/float/float.absolute.leftrightvertical.js
  44. 4
      src/core/wrapper/layout/float/float.absolute.vertical.js
  45. 2
      src/core/wrapper/layout/float/float.horizontal.js
  46. 12
      src/core/wrapper/layout/layout.adaptive.js
  47. 12
      src/core/wrapper/layout/layout.flow.js
  48. 6
      src/core/wrapper/layout/layout.inline.js
  49. 24
      src/core/wrapper/layout/layout.tape.js
  50. 2
      src/less/base/single/tip/tip.toast.less
  51. 64
      src/less/base/view/popupview.less
  52. 2
      src/less/resource/font.less
  53. 2
      src/widget/downlist/popup.downlist.js
  54. 2
      src/widget/multilayerdownlist/popup.downlist.js
  55. 2
      src/widget/singleslider/singleslider.js
  56. 1
      typescript/base/combination/combo.ts
  57. 8
      typescript/core/utils/tree.ts
  58. 5
      typescript/core/wrapper/layout/sticky/sticky.horizontal.ts
  59. 5
      typescript/core/wrapper/layout/sticky/sticky.vertical.ts
  60. 6
      typescript/index.ts
  61. 4
      typescript/shims-tsx.ts
  62. 5
      typescript/widget/downlist/item.downlistgroup.ts

3
bi.lessconfig.json

@ -8,7 +8,7 @@
"@color-light-gray": "#ECEEF3",
"@color-light-gray-theme-dark": "#292F45",
"@border-color-dark-line": "#2E3A4D",
"@color-sliver-theme-dark": "363E55",
"@color-sliver-theme-dark": "#363E55",
"@border-color-disabled": "#E7E8EB",
"@color-bi-background-active-radio": "transparent",
@ -18,6 +18,7 @@
"@color-bi-background-disabled-active-checkbox-content": "#D0D4DA",
"@color-bi-background-disabled-active-checkbox-content-theme-dark": "#606479",
"@color-bi-background-tooltip-success": "#2E3A4D",
"@color-bi-text-header-background": "#647185",
"@color-bi-border-tooltip-success": "#2E3A4D",
"@color-bi-background-toast-success": "#FFFFFF",
"@color-bi-background-toast-warning": "#FFFFFF",

BIN
dist/font/iconfont.eot vendored

Binary file not shown.

4
dist/font/iconfont.svg vendored

@ -14,6 +14,10 @@
/>
<missing-glyph />
<glyph glyph-name="hangliezhuanhuan1" unicode="&#59542;" d="M398.208 839.104c31.424 0 56.96-25.472 56.96-56.896l-0.064-455.04h455.104c31.424 0 56.96-25.536 56.96-56.96v-284.416c0-31.424-25.536-56.96-56.96-56.96H113.792a56.896 56.896 0 0 0-56.96 56.96V782.208c0 31.424 25.536 56.96 56.96 56.96h284.416z m512-568.896l-455.104 0.064v-284.48h455.104V270.208zM592.448 805.76a28.48 28.48 0 0 0 3.328-36.288l-3.328-3.968-11.84-11.712h73.6c121.6 0 220.992-95.424 227.2-215.488l0.384-12.096v-81.024l9.728 9.728a28.48 28.48 0 0 0 36.288 3.328l3.968-3.328a28.48 28.48 0 0 0 3.264-36.288l-3.264-3.904-53.888-53.952a37.504 37.504 0 0 0-48.448-3.904l-4.672 3.904-53.888 53.952a28.416 28.416 0 0 0 36.288 43.52l3.904-3.328 13.76-13.696V526.208a170.688 170.688 0 0 1-159.808 170.368l-10.816 0.32h-73.6l11.84-11.84a28.48 28.48 0 0 0 3.328-36.288l-3.328-3.904a28.48 28.48 0 0 0-36.288-3.328l-3.904 3.328-53.952 53.888a37.504 37.504 0 0 0-3.968 48.448l3.968 4.608 53.952 53.952a28.416 28.416 0 0 0 40.192 0z" horiz-adv-x="1024" />
<glyph glyph-name="JSONjiexi" unicode="&#59541;" d="M796.864 839.104l170.24-171.392v-681.92c0-31.424-25.472-56.96-56.896-56.96H227.584a56.896 56.896 0 0 0-56.96 56.96V71.04h-56.832A56.896 56.896 0 0 0 56.832 128V469.312c0 31.424 25.536 56.96 56.96 56.96h56.832v256c0 31.36 25.536 56.832 56.96 56.832h569.28z m-57.472-56.832H227.584l-0.064-256h568.96c31.36 0 56.832-25.536 56.832-56.96V128c0-31.36-25.472-56.896-56.896-56.896h-568.96l0.128-85.312h682.624v624.64h-85.504c-45.44 0-82.56 35.52-85.12 80.256l-0.192 5.056V782.272z m-217.088-384c-26.368 0-46.464-7.232-60.416-21.568-18.624-16.896-27.968-42.24-27.968-75.968 0-33.088 9.344-58.432 27.968-76.032 13.952-14.336 34.048-21.504 60.416-21.504 26.304 0 46.464 7.168 60.352 21.504 18.56 17.6 27.84 42.88 27.84 76.032 0 33.728-9.28 59.072-27.84 75.968-13.888 14.336-34.048 21.504-60.352 21.504z m-187.264-0.32c-23.232 0-40.896-5.44-52.864-16.384a53.248 53.248 0 0 1-18.048-41.088c0-18.112 6.208-31.36 18.624-39.872 7.36-5.12 20.608-9.792 39.744-14.08l19.52-4.48c11.456-2.432 19.84-5.312 25.152-8.576a15.744 15.744 0 0 0 8-14.08c0-10.432-5.376-17.6-16.128-21.44a67.84 67.84 0 0 0-22.144-3.008c-15.168 0-25.856 3.84-32.128 11.392a37.824 37.824 0 0 0-6.848 18.88H261.12c0-19.2 6.848-34.24 20.608-45.184 13.76-10.944 32.64-16.448 56.64-16.448 23.488 0 41.6 5.568 54.528 16.64a53.12 53.12 0 0 1 19.328 41.984c0 16.448-5.504 28.992-16.512 37.632-7.04 5.568-17.6 10.048-31.488 13.44l-31.744 7.552a107.136 107.136 0 0 0-24 7.68 15.872 15.872 0 0 0-8.768 14.72c0 7.168 2.944 12.8 8.896 16.768a41.792 41.792 0 0 0 23.68 5.952 48.64 48.64 0 0 0 22.4-4.608c9.024-4.672 13.888-12.544 14.528-23.68h36.992c-0.64 19.648-7.872 34.56-21.568 44.864a80.384 80.384 0 0 1-49.664 15.424z m-103.168-5.376h-38.464v-128.832c0-8.96-0.896-15.296-2.624-19.008-2.944-6.4-8.96-9.536-17.984-9.536-9.216 0-15.168 2.944-17.92 8.704-2.816 5.76-4.416 15.808-4.736 30.08v4.224h-36.352v-4.224c0-21.696 4.096-38.784 12.224-51.328 8.192-12.544 24.192-18.816 48.128-18.816s40.448 7.744 49.664 23.232c5.376 9.216 8.064 21.632 8.064 37.248V392.576z m447.808 0h-40.384v-184.256h35.84V339.2l75.264-130.88h38.528v184.32h-35.84v-128.64l-73.408 128.64z m-157.44-27.008c15.296 0 27.392-5.632 36.352-16.896 8.96-11.328 13.44-27.264 13.44-48 0-20.672-4.48-36.672-13.44-48a43.968 43.968 0 0 0-36.288-16.832 44.48 44.48 0 0 0-36.48 16.896c-9.152 11.264-13.696 27.264-13.696 48s4.544 36.736 13.632 48a44.48 44.48 0 0 0 36.48 16.832z" horiz-adv-x="1024" />
<glyph glyph-name="niantie" unicode="&#59540;" d="M128 608a32 32 0 0 0 32-32v-512a32 32 0 0 1 32-32h512a32 32 0 1 0 0-64H192A96 96 0 0 0 96 64V576a32 32 0 0 0 32 32z m704 192A96 96 0 0 0 928 704v-512a96 96 0 0 0-96-96H320A96 96 0 0 0 224 192V704A96 96 0 0 0 320 800z m0-64H320a32 32 0 0 1-32-32v-512a32 32 0 0 1 32-32h512a32 32 0 0 1 32 32V704a32 32 0 0 1-32 32z m-256-64c17.664 0 32-16.384 32-36.608L607.936 480h155.456c20.224 0 36.608-14.336 36.608-32s-16.384-32-36.608-32H607.936v-155.52c0-20.16-14.272-36.48-32-36.48-17.6 0-32 16.32-32 36.48V416H388.48c-20.16 0-36.48 14.336-36.48 32s16.32 32 36.48 32H544V635.392c0 20.224 14.4 36.608 32 36.608z" horiz-adv-x="1024" />
<glyph glyph-name="kaiqishoushi" unicode="&#59538;" d="M878.592-5.312l25.088 450.88a96.192 96.192 0 0 1-90.752 101.76L587.264 559.36V736a128 128 0 0 1-128 128l-9.536-0.32A128 128 0 0 1 331.328 736l-0.064-336.832-7.232 4.928a128 128 0 0 1-172.864-181.888l183.552-262.144 6.272-8.32 6.976-7.68 4.864-4.544-1.92 2.304c18.048-23.68 46.08-37.824 76.416-37.824h355.456a96 96 0 0 1 95.808 90.688z m-38.784 455.104l-25.088-451.584a32 32 0 0 0-32-30.208H427.392a31.808 31.808 0 0 0-21.504 8.32l-8.448 9.088a62.848 62.848 0 0 0-10.24 11.392L203.52 258.944a64 64 0 0 0 104.832 73.408l86.848-124.16V736a64 64 0 1 0 128 0v-176.64a64 64 0 0 1 60.608-63.936l225.664-11.968a32 32 0 0 0 30.272-33.664z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 467 KiB

After

Width:  |  Height:  |  Size: 470 KiB

BIN
dist/font/iconfont.ttf vendored

Binary file not shown.

BIN
dist/font/iconfont.woff vendored

Binary file not shown.

BIN
dist/font/iconfont.woff2 vendored

Binary file not shown.

2
package.json

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

4
src/base/combination/group.virtual.js

@ -109,7 +109,9 @@ BI.VirtualGroup = BI.inherit(BI.Widget, {
if (!this.layouts) {
this.layouts = BI.createWidget(BI.extend({element: this}, this._packageLayout(items)));
} else {
this.layouts.populate(items);
this.layouts.populate(items, {
context: this
});
}
}
});

11
src/base/layer/layer.popover.js

@ -27,7 +27,7 @@ BI.Popover = BI.inherit(BI.Widget, {
footerHeight: 44,
closable: true, // BI-40839 是否显示右上角的关闭按钮
bodyHgap: BI.SIZE_CONSANTS.H_GAP_SIZE,
bodyTgap: 10
bodyTgap: BI.SIZE_CONSANTS.V_GAP_SIZE
};
},
@ -109,10 +109,10 @@ BI.Popover = BI.inherit(BI.Widget, {
},
items: [{
el: o.body
}]
},
hgap: o.bodyHgap,
tgap: o.bodyTgap
}],
hgap: o.bodyHgap,
tgap: o.bodyTgap
}
} : {
el: {
type: "bi.absolute",
@ -143,7 +143,6 @@ BI.Popover = BI.inherit(BI.Widget, {
}
return BI.extend({
type: o.logic.dynamic ? "bi.vertical" : "bi.vtape",
items: items,
width: this._getSuitableWidth(size.width)
}, o.logic.dynamic ? {

17
src/base/layer/layer.popup.js

@ -22,8 +22,8 @@ BI.PopupView = BI.inherit(BI.Widget, {
bgap: 0,
vgap: 0,
hgap: 0,
innerVGap: 0,
innerHGap: 0,
innerVgap: 0,
innerHgap: 0,
showArrow: false,
direction: BI.Direction.Top, // 工具栏的方向
stopEvent: false, // 是否停止mousedown、mouseup事件
@ -106,10 +106,11 @@ BI.PopupView = BI.inherit(BI.Widget, {
});
this.arrowWrapper = BI.createWidget({
type: "bi.absolute",
cls: "bi-bubble-arrow-wrapper",
items: [{
el: this.arrow,
}]
})
});
// 因为三角符号的原因位置变大了,需要占位
this.placeholder = BI.createWidget({
type: "bi.layout"
@ -133,10 +134,10 @@ BI.PopupView = BI.inherit(BI.Widget, {
this.button_group = BI.createWidget(o.el, {type: "bi.button_group", value: o.value});
this.button_group.element.css({
"min-height": BI.isNumeric(o.minHeight) ? (o.minHeight / BI.pixRatio + BI.pixUnit) : o.minHeight,
"padding-top": o.innerVGap / BI.pixRatio + BI.pixUnit,
"padding-bottom": o.innerVGap / BI.pixRatio + BI.pixUnit,
"padding-left": o.innerHGap / BI.pixRatio + BI.pixUnit,
"padding-right": o.innerHGap / BI.pixRatio + BI.pixUnit
"padding-top": o.innerVgap / BI.pixRatio + BI.pixUnit,
"padding-bottom": o.innerVgap / BI.pixRatio + BI.pixUnit,
"padding-left": o.innerHgap / BI.pixRatio + BI.pixUnit,
"padding-right": o.innerHgap / BI.pixRatio + BI.pixUnit
});
return this.button_group;
},
@ -396,7 +397,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
var tbHeight = this.toolbar ? (this.toolbar.attr("height") || 24) : 0,
tabHeight = this.tab ? (this.tab.attr("height") || 24) : 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.element.css({"max-height": resetHeight / BI.pixRatio + BI.pixUnit});
},

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

@ -30,10 +30,17 @@ BI.BlankIconTextItem = BI.inherit(BI.BasicButton, {
return {
type: "bi.vertical_adapt",
columnSize: [o.blankWidth, "fill", o.iconWrapperWidth || o.height],
columnSize: [o.blankWidth, o.iconWrapperWidth || o.height, "fill"],
items: [{
type: "bi.layout",
width: o.blankWidth
}, {
type: "bi.icon_label",
cls: o.iconCls,
width: o.iconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}, {
type: "bi.label",
ref: function (_ref) {
@ -49,13 +56,6 @@ BI.BlankIconTextItem = BI.inherit(BI.BasicButton, {
value: o.value,
keyword: o.keyword,
height: o.height
}, {
type: "bi.icon_label",
cls: o.iconCls,
width: o.iconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}]
};
},

11
src/base/single/input/file.js

@ -333,11 +333,10 @@
if (isFunction(handler.onloadstart)) {
handler.onloadstart(rpe, {});
}
with (document.body || document.documentElement) {
appendChild(iframe);
appendChild(form);
form.submit();
}
var d = document.body || document.documentElement;
d.appendChild(iframe);
d.appendChild(form);
form.submit();
return handler;
};
@ -652,7 +651,7 @@
});
},
setMaxFileLength: function(v) {
setMaxFileLength: function (v) {
this.options.maxLength = v;
if (this.wrap) {
this.wrap.maxLength = v;

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

@ -7,8 +7,11 @@
*/
BI.Toast = BI.inherit(BI.Tip, {
_const: {
minWidth: 200,
hgap: 10
closableMinWidth: 146,
minWidth: 124,
closableMaxWidth: 410,
maxWidth: 400,
hgap: 8
},
_defaultConfig: function () {
@ -22,9 +25,10 @@ BI.Toast = BI.inherit(BI.Tip, {
},
render: function () {
var self = this, o = this.options;
var self = this, o = this.options, c = this._const;
this.element.css({
minWidth: this._const.minWidth / BI.pixRatio + BI.pixUnit
minWidth: (o.closable ? c.closableMinWidth : c.minWidth) / BI.pixRatio + BI.pixUnit,
maxWidth: (o.closable ? c.closableMaxWidth : c.maxWidth) / BI.pixRatio + BI.pixUnit
});
this.element.addClass("toast-" + o.level);
var fn = function (e) {
@ -93,10 +97,9 @@ BI.Toast = BI.inherit(BI.Tip, {
this.text = BI.createWidget({
type: "bi.horizontal",
horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: BI.VerticalAlign.Middle,
element: this,
items: items,
vgap: 7,
vgap: 12,
columnSize: columnSize
});
},

68
src/case/button/item.multiselect.js

@ -20,52 +20,52 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, {
textRgap: 0
});
},
_init: function () {
BI.MultiSelectItem.superclass._init.apply(this, arguments);
render: function () {
var self = this, o = this.options;
this.checkbox = BI.createWidget({
type: "bi.checkbox"
});
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
rgap: o.rgap,
lgap: o.textLgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py
});
this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
self.setSelected(self.isSelected());
}
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", {
return {
type: "bi.vertical_adapt",
columnSize: [o.iconWrapperWidth || o.height, "fill"],
items: [{
type: "bi.center_adapt",
items: [this.checkbox],
width: o.iconWrapperWidth
}, this.text)
}))));
items: [this.checkbox]
}, {
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
cls: "list-item-text",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
rgap: o.rgap,
lgap: o.textLgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py
}]
};
},
_setEnable: function (enable) {
BI.MultiSelectItem.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.element.attr("tabIndex", 1);
} else if (enable === false) {
this.element.removeAttr("tabIndex");
}
},
// _setEnable: function (enable) {
// BI.MultiSelectItem.superclass._setEnable.apply(this, arguments);
// if (enable === true) {
// this.element.attr("tabIndex", 1);
// } else if (enable === false) {
// this.element.removeAttr("tabIndex");
// }
// },
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);

4
src/case/button/item.singleselect.icontext.js

@ -15,8 +15,8 @@ BI.SingleSelectIconTextItem = BI.inherit(BI.Single, {
height: 24
});
},
_init: function () {
BI.SingleSelectIconTextItem.superclass._init.apply(this, arguments);
render: function () {
var self = this, o = this.options;
this.text = BI.createWidget({
type: "bi.icon_text_item",

4
src/case/button/item.singleselect.js

@ -10,8 +10,8 @@ BI.SingleSelectItem = BI.inherit(BI.BasicButton, {
textAlign: "left"
});
},
_init: function () {
BI.SingleSelectItem.superclass._init.apply(this, arguments);
render: function () {
var self = this, o = this.options;
this.text = BI.createWidget({
type: "bi.label",

60
src/case/button/item.singleselect.radio.js

@ -21,37 +21,39 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, {
textRgap: 0
});
},
_init: function () {
BI.SingleSelectRadioItem.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.radio = BI.createWidget({
type: "bi.radio"
});
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
rgap: o.textRgap,
lgap: o.textLgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", {
render: function () {
var self = this, o = this.options;
return {
type: "bi.vertical_adapt",
columnSize: [o.iconWrapperWidth || o.height, "fill"],
items: [{
type: "bi.center_adapt",
items: [this.radio],
width: o.iconWrapperWidth
}, this.text)
}))));
items: [{
type: "bi.radio",
ref: function (_ref) {
self.radio = _ref;
},
}]
}, {
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
cls: "list-item-text",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
rgap: o.textRgap,
lgap: o.textLgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py
}]
};
},
_setEnable: function (enable) {

48
src/case/button/node/node.arrow.js

@ -16,43 +16,37 @@ BI.ArrowNode = BI.inherit(BI.NodeButton, {
iconWrapperWidth: 16
});
},
_init: function () {
render: function () {
var self = this, o = this.options;
BI.ArrowNode.superclass._init.apply(this, arguments);
this.checkbox = BI.createWidget({
type: "bi.arrow_group_node_checkbox"
});
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword
});
this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
self.setSelected(self.isSelected());
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
width: o.iconWrapperWidth,
el: this.checkbox
}, this.text);
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(type, BI.extend(o.logic, {
items: items
}))));
return {
type: "bi.vertical_adapt",
columnSize: [o.iconWrapperWidth || o.height, "fill"],
items: [this.checkbox, {
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword
}]
};
},
doRedMark: function () {

50
src/case/button/node/node.plus.js

@ -15,28 +15,17 @@ BI.PlusGroupNode = BI.inherit(BI.NodeButton, {
id: "",
pId: "",
open: false,
iconWrapperWidth: null,
height: 24
});
},
_init: function () {
BI.PlusGroupNode.superclass._init.apply(this, arguments);
render: function () {
var self = this, o = this.options;
this.checkbox = BI.createWidget({
type: "bi.tree_node_checkbox",
iconHeight: o.height,
iconWidth: o.height
});
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
keyword: o.keyword,
py: o.py
iconWidth: o.iconWrapperWidth || o.height
});
this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
@ -44,16 +33,25 @@ BI.PlusGroupNode = BI.inherit(BI.NodeButton, {
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
width: 24,
el: this.checkbox
}, this.text);
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(type, BI.extend(o.logic, {
items: items
}))));
return {
type: "bi.vertical_adapt",
columnSize: [o.iconWrapperWidth || o.height, "fill"],
items: [this.checkbox, {
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
keyword: o.keyword,
py: o.py
}]
};
},
doRedMark: function () {
@ -77,4 +75,4 @@ BI.PlusGroupNode = BI.inherit(BI.NodeButton, {
}
});
BI.shortcut("bi.plus_group_node", BI.PlusGroupNode);
BI.shortcut("bi.plus_group_node", BI.PlusGroupNode);

8
src/case/combo/bubblecombo/combo.bubble.js

@ -20,8 +20,8 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
isNeedAdjustWidth: true,
stopPropagation: false,
adjustLength: 0, // 调整的距离
// adjustXOffset: 0,
// adjustYOffset: 10,
adjustXOffset: 0,
adjustYOffset: 0,
hideChecker: BI.emptyFn,
offsetStyle: "left", // left,right,center
el: {},
@ -47,8 +47,8 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: o.isNeedAdjustWidth,
stopPropagation: o.stopPropagation,
adjustXOffset: 0,
adjustYOffset: 0,
adjustXOffset: o.adjustXOffset,
adjustYOffset: o.adjustYOffset,
hideChecker: o.hideChecker,
offsetStyle: o.offsetStyle,
showArrow: true,

76
src/case/combo/bubblecombo/popup.bubble.js

@ -11,7 +11,8 @@ BI.BubblePopupView = BI.inherit(BI.PopupView, {
baseCls: config.baseCls + " bi-bubble-popup-view",
minWidth: 70,
maxWidth: 300,
minHeight: 50
// minHeight: 50,
showArrow: true,
});
}
});
@ -38,9 +39,7 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
}]
});
},
_init: function () {
BI.BubblePopupBarView.superclass._init.apply(this, arguments);
},
_createToolBar: function () {
var o = this.options, self = this;
@ -73,12 +72,16 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
});
},
_createContent: function () {
return this.options.el;
},
_createView: function () {
var o = this.options;
var button = BI.createWidget({
type: "bi.button_group",
items: [o.el],
items: [this._createContent()],
layouts: [{
type: "bi.vertical",
cls: "bar-popup-container",
@ -101,66 +104,29 @@ BI.shortcut("bi.bubble_bar_popup_view", BI.BubblePopupBarView);
* @class BI.TextBubblePopupBarView
* @extends BI.BubblePopupView
*/
BI.TextBubblePopupBarView = BI.inherit(BI.Widget, {
BI.TextBubblePopupBarView = BI.inherit(BI.BubblePopupBarView, {
props: function () {
return {
baseCls: "bi-text-bubble-bar-popup-view",
_defaultConfig: function () {
var config = BI.TextBubblePopupBarView.superclass._defaultConfig.apply(this, arguments);
return BI.extend(config, {
baseCls: config.baseCls + " bi-text-bubble-bar-popup-view",
text: "",
buttons: [{
level: "ignore",
value: false,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Cancel")
}, {
value: true,
stopPropagation: true,
text: BI.i18nText("BI-Basic_OK")
}]
};
});
},
render: function () {
_createContent: function () {
var self = this, o = this.options;
var buttons = BI.map(o.buttons, function (index, buttonOpt) {
if (BI.isWidget(buttonOpt)) {
return buttonOpt;
}
return BI.extend({
type: "bi.button",
height: 24,
handler: function (v) {
self.fireEvent(BI.TextBubblePopupBarView.EVENT_CHANGE, v);
}
}, buttonOpt);
});
return {
type: "bi.bubble_bar_popup_view",
primary: o.primary,
showArrow: o.showArrow,
minWidth: o.minWidth,
maxWidth: o.maxWidth,
minHeight: o.minHeight,
type: "bi.label",
text: o.text,
whiteSpace: "normal",
textAlign: "left",
ref: function () {
self.popup = this;
},
el: {
type: "bi.label",
text: o.text,
whiteSpace: "normal",
textAlign: "left",
ref: function () {
self.text = this;
}
},
buttons: buttons
self.text = this;
}
};
},
setDirection: function (direction, position) {
this.popup.setDirection(direction, position);
},
populate: function (v) {
this.text.setText(v || this.options.text);
}

6
src/core/3.ob.js

@ -51,7 +51,9 @@
if (BI.isFunction(this.props)) {
props = this.props(config);
}
this.options = extend(this._defaultConfig(config), props, config);
var defaultProps = this._defaultConfig(config);
var modifiedDefaultProps = (config && config.type && BI.OB.configFunctions[config.type + ".props"]) ? BI.OB.configFunctions[config.type + ".props"](config, defaultProps) : null;
this.options = extend(defaultProps, props, modifiedDefaultProps, config);
},
_init: function () {
@ -67,7 +69,7 @@
self.on(eventName, lis);
return;
}
(lis.target ? lis.target : self)[lis.once ? "once" : "on"](lis.eventName, lis.action);
(lis.target ? lis.target : self)[lis.once ? "once" : "on"](lis.eventName, _.bind(lis.action, self));
});
delete this.options.listeners;
}

2
src/core/5.inject.js

@ -91,7 +91,7 @@
};
};
var configFunctions = {};
var configFunctions = BI.OB.configFunctions = {};
var runConfigFunction = function (type) {
if (!type || !configFunctions[type]) {
return false;

7
src/core/func/function.js

@ -40,16 +40,14 @@ _.extend(BI.Func, {
* @param items
* @param keyword
* @param param 搜索哪个属性
* @param clone 是否需要deepClone
*/
getSearchResult: function (items, keyword, param, clone) {
getSearchResult: function (items, keyword, param) {
var isArray = BI.isArray(items);
items = isArray ? BI.flatten(items) : items;
param || (param = "text");
BI.isNull(clone) && (clone = true);
if (!BI.isKey(keyword)) {
return {
find: clone ? BI.deepClone(items) : items,
find: items,
match: isArray ? [] : {}
};
}
@ -61,7 +59,6 @@ _.extend(BI.Func, {
if (BI.isNull(item)) {
return;
}
clone && (item = BI.deepClone(item));
t = BI.stripEL(item);
text = BI.find([t[param], t.text, t.value, t.name, t], function (index, val) {
return BI.isNotNull(val);

4
src/core/logic/logic.js

@ -43,7 +43,6 @@ BI.LogicFactory = {
case BI.Direction.Bottom:
case BI.Direction.Custom:
return BI.LogicFactory.Type.Vertical;
break;
case BI.Direction.Left:
case BI.Direction.Right:
return BI.LogicFactory.Type.Horizontal;
@ -53,6 +52,7 @@ BI.LogicFactory = {
createLogicItemsByDirection: function (direction) {
var layout;
var items = Array.prototype.slice.call(arguments, 1);
items = BI.compact(items);
items = BI.map(items, function (i, item) {
if (BI.isWidget(item)) {
return {
@ -78,4 +78,4 @@ BI.LogicFactory = {
}
return items;
}
};
};

18
src/core/logic/logic.layout.js

@ -19,7 +19,9 @@ BI.VerticalLayoutLogic = BI.inherit(BI.Logic, {
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
bgap: 0,
innerVgap: 0,
innerHgap: 0
};
},
@ -41,6 +43,8 @@ BI.VerticalLayoutLogic = BI.inherit(BI.Logic, {
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
items: o.items
};
}
@ -68,7 +72,9 @@ BI.HorizontalLayoutLogic = BI.inherit(BI.Logic, {
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
bgap: 0,
innerVgap: 0,
innerHgap: 0
};
},
@ -90,6 +96,8 @@ BI.HorizontalLayoutLogic = BI.inherit(BI.Logic, {
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
items: o.items
};
}
@ -163,7 +171,9 @@ BI.HorizontalFillLayoutLogic = BI.inherit(BI.Logic, {
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
bgap: 0,
innerVgap: 0,
innerHgap: 0
};
},
@ -190,6 +200,8 @@ BI.HorizontalFillLayoutLogic = BI.inherit(BI.Logic, {
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
items: o.items
};
}

6
src/core/structure/cache.js

@ -47,7 +47,7 @@ BI.Cache = {
},
addCookie: function (name, value, path, expiresHours) {
var cookieString = name + "=" + escape(value);
var cookieString = name + "=" + encodeURI(value);
// 判断是否设置过期时间
if (expiresHours && expiresHours > 0) {
var date = new Date();
@ -62,7 +62,7 @@ BI.Cache = {
},
getCookie: function (name) {
var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
if (arr = document.cookie.match(reg)) {return unescape(arr[2]);}
if (arr = document.cookie.match(reg)) {return decodeURI(arr[2]);}
return null;
},
deleteCookie: function (name, path) {
@ -74,4 +74,4 @@ BI.Cache = {
}
document.cookie = cookieString;
}
};
};

96
src/core/wrapper/layout.js

@ -14,7 +14,9 @@ BI.Layout = BI.inherit(BI.Widget, {
scrollable: null, // true, false, null
scrollx: false, // true, false
scrolly: false, // true, false
items: []
items: [],
innerHgap: 0,
innerVgap: 0,
};
},
@ -55,20 +57,6 @@ BI.Layout = BI.inherit(BI.Widget, {
if (this.options.right) {
this.element.css("right", BI.isNumber(this.options.right) ? this.options.right / BI.pixRatio + BI.pixUnit : this.options.right);
}
if (this.options.padding) {
if (this.options.padding.left) {
this.element.css("padding-left", BI.isNumber(this.options.padding.left) ? this.options.padding.left / BI.pixRatio + BI.pixUnit : this.options.padding.left);
}
if (this.options.padding.right) {
this.element.css("padding-right", BI.isNumber(this.options.padding.right) ? this.options.padding.right / BI.pixRatio + BI.pixUnit : this.options.padding.right);
}
if (this.options.padding.top) {
this.element.css("padding-top", BI.isNumber(this.options.padding.top) ? this.options.padding.top / BI.pixRatio + BI.pixUnit : this.options.padding.top);
}
if (this.options.padding.bottom) {
this.element.css("padding-bottom", BI.isNumber(this.options.padding.bottom) ? this.options.padding.bottom / BI.pixRatio + BI.pixUnit : this.options.padding.bottom);
}
}
},
_init4Scroll: function () {
@ -296,26 +284,36 @@ BI.Layout = BI.inherit(BI.Widget, {
_handleGap: function (w, item, hIndex, vIndex) {
var o = this.options;
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
var top = ((BI.isNull(vIndex) || vIndex === 0) ? o.vgap : 0) + o.tgap + (item.tgap || 0) + (item.vgap || 0);
var innerLgap, innerRgap, innerTgap, innerBgap;
if (BI.isNull(vIndex)) {
innerTgap = innerBgap = o.innerVgap;
innerLgap = hIndex === 0 ? o.innerHgap : 0;
innerRgap = hIndex === o.items.length - 1 ? o.innerHgap : 0;
} else {
innerLgap = innerRgap = o.innerHgap;
innerTgap = vIndex === 0 ? o.innerVgap : 0;
innerBgap = vIndex === o.items.length - 1 ? o.innerVgap : 0;
}
if (o.vgap + o.tgap + innerTgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
var top = ((BI.isNull(vIndex) || vIndex === 0) ? o.vgap : 0) + o.tgap + innerTgap + (item.tgap || 0) + (item.vgap || 0);
w.element.css({
"margin-top": this._optimiseGap(top)
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
var left = ((BI.isNull(hIndex) || hIndex === 0) ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0);
if (o.hgap + o.lgap + innerLgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
var left = ((BI.isNull(hIndex) || hIndex === 0) ? o.hgap : 0) + o.lgap + innerLgap + (item.lgap || 0) + (item.hgap || 0);
w.element.css({
"margin-left": this._optimiseGap(left)
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
var right = o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0);
if (o.hgap + o.rgap + innerRgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
var right = o.hgap + o.rgap + innerRgap + (item.rgap || 0) + (item.hgap || 0);
w.element.css({
"margin-right": this._optimiseGap(right)
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
var bottom = o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0);
if (o.vgap + o.bgap + innerBgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
var bottom = o.vgap + o.bgap + innerBgap + (item.bgap || 0) + (item.vgap || 0);
w.element.css({
"margin-bottom": this._optimiseGap(bottom)
});
@ -325,27 +323,31 @@ BI.Layout = BI.inherit(BI.Widget, {
// 横向换纵向
_handleReverseGap: function (w, item, index) {
var o = this.options;
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
var top = (index === 0 ? o.vgap : 0) + (index === 0 ? o.tgap : 0) + (item.tgap || 0) + (item.vgap || 0);
var innerLgap, innerRgap, innerTgap, innerBgap;
innerLgap = innerRgap = o.innerHgap;
innerTgap = index === 0 ? o.innerVgap : 0;
innerBgap = index === o.items.length - 1 ? o.innerVgap : 0;
if (o.vgap + o.tgap + innerTgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
var top = (index === 0 ? o.vgap : 0) + (index === 0 ? o.tgap : 0) + innerTgap + (item.tgap || 0) + (item.vgap || 0);
w.element.css({
"margin-top": this._optimiseGap(top)
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
var left = o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0);
if (o.hgap + o.lgap + innerLgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
var left = o.hgap + o.lgap + innerLgap + (item.lgap || 0) + (item.hgap || 0);
w.element.css({
"margin-left": this._optimiseGap(left)
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
var right = o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0);
if (o.hgap + o.rgap + innerRgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
var right = o.hgap + o.rgap + innerRgap + (item.rgap || 0) + (item.hgap || 0);
w.element.css({
"margin-right": this._optimiseGap(right)
});
}
// 这里的代码是关键
if (o.vgap + o.hgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
var bottom = (index === o.items.length - 1 ? o.vgap : o.hgap) + (index === o.items.length - 1 ? o.bgap : 0) + (item.bgap || 0) + (item.vgap || 0);
if (o.vgap + o.hgap + o.bgap + innerBgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
var bottom = (index === o.items.length - 1 ? o.vgap : o.hgap) + (index === o.items.length - 1 ? o.bgap : 0) + innerBgap + (item.bgap || 0) + (item.vgap || 0);
w.element.css({
"margin-bottom": this._optimiseGap(bottom)
});
@ -492,7 +494,7 @@ BI.Layout = BI.inherit(BI.Widget, {
}
},
updateChildren: function (oldCh, newCh) {
updateChildren: function (oldCh, newCh, context) {
var self = this;
var oldStartIdx = 0, newStartIdx = 0;
var oldEndIdx = oldCh.length - 1;
@ -546,7 +548,7 @@ BI.Layout = BI.inherit(BI.Widget, {
} else {
var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx);
if (BI.isNull(sameOldVnode[0])) { // 不存在就把新的放到左边
var node = addNode(newStartVnode, newStartIdx);
var node = addNode(newStartVnode, newStartIdx, context);
insertBefore(node, oldStartVnode);
} else { // 如果新节点在旧节点区间中存在就复用一下
var sameOldIndex = sameOldVnode[1];
@ -561,7 +563,7 @@ BI.Layout = BI.inherit(BI.Widget, {
}
if (oldStartIdx > oldEndIdx) {
before = BI.isNull(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1];
addVnodes(before, newCh, newStartIdx, newEndIdx);
addVnodes(before, newCh, newStartIdx, newEndIdx, context);
} else if (newStartIdx > newEndIdx) {
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
}
@ -586,15 +588,15 @@ BI.Layout = BI.inherit(BI.Widget, {
}
}
function addNode (vnode, index) {
function addNode (vnode, index, context) {
var opt = self._getOptions(vnode);
var key = opt.key == null ? index : opt.key;
return children[key] = self._newElement(index, vnode);
return children[key] = self._newElement(index, vnode, context);
}
function addVnodes (before, vnodes, startIdx, endIdx) {
function addVnodes (before, vnodes, startIdx, endIdx, context) {
for (; startIdx <= endIdx; ++startIdx) {
var node = addNode(vnodes[startIdx], startIdx);
var node = addNode(vnodes[startIdx], startIdx, context);
insertBefore(node, before, false, startIdx);
}
}
@ -662,16 +664,18 @@ BI.Layout = BI.inherit(BI.Widget, {
update: function (opt) {
var o = this.options;
var items = opt.items || [];
var context = opt.context;
var oldItems = o.items;
this.options.items = items;
return this.updateChildren(oldItems, items);
return this.updateChildren(oldItems, items, context);
},
stroke: function (items) {
stroke: function (items, options) {
options = options || {};
var self = this;
BI.each(items, function (i, item) {
if (item) {
self._addElement(i, item);
self._addElement(i, item, options.context);
}
});
},
@ -702,14 +706,18 @@ BI.Layout = BI.inherit(BI.Widget, {
this.options.items = [];
},
populate: function (items) {
populate: function (items, options) {
items = items || [];
options = options || {};
if (this._isMounted) {
this.update({items: items});
this.update({
items: items,
context: options.context
});
return;
}
this.options.items = items;
this.stroke(items);
this.stroke(items, options);
},
resize: function () {

4
src/core/wrapper/layout/adapt/absolute.horizontal.js

@ -37,7 +37,9 @@ BI.AbsoluteHorizontalLayout = BI.inherit(BI.Layout, {
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
bgap: o.bgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
};
},

2
src/core/wrapper/layout/adapt/absolute.leftrightvertical.js

@ -23,6 +23,8 @@ BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
BI.AbsoluteLeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments);
return {
type: "bi.htape",
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
ref: function (_ref) {
self.layout = _ref;
},

4
src/core/wrapper/layout/adapt/absolute.vertical.js

@ -37,7 +37,9 @@ BI.AbsoluteVerticalLayout = BI.inherit(BI.Layout, {
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
bgap: o.bgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
};
},

4
src/core/wrapper/layout/adapt/adapt.center.js

@ -38,7 +38,9 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
bgap: o.bgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
};
},

8
src/core/wrapper/layout/adapt/adapt.leftrightvertical.js

@ -34,6 +34,8 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
if (leftRight.left || "left" in o.items) {
layoutArray.push({
type: "bi.left",
lgap: o.innerHgap,
vgap: o.innerVgap,
items: [{
el: {
type: "bi.vertical_adapt",
@ -55,6 +57,8 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
if (leftRight.right || "right" in o.items) {
layoutArray.push({
type: "bi.right",
rgap: o.innerHgap,
vgap: o.innerVgap,
items: [{
el: {
type: "bi.vertical_adapt",
@ -144,6 +148,8 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
tgap: o.tgap,
bgap: o.bgap,
vgap: o.vgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
scrollx: o.scrollx,
scrolly: o.scrolly,
scrollable: o.scrollable
@ -196,6 +202,8 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
tgap: o.tgap,
bgap: o.bgap,
vgap: o.vgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
scrollx: o.scrollx,
scrolly: o.scrolly,
scrollable: o.scrollable

4
src/core/wrapper/layout/adapt/adapt.vertical.js

@ -38,7 +38,9 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
bgap: o.bgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
};
},

4
src/core/wrapper/layout/adapt/inline.center.js

@ -40,7 +40,9 @@ BI.InlineCenterAdaptLayout = BI.inherit(BI.Layout, {
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
bgap: o.bgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
};
},

4
src/core/wrapper/layout/adapt/inline.horizontal.js

@ -40,7 +40,9 @@ BI.InlineHorizontalAdaptLayout = BI.inherit(BI.Layout, {
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
bgap: o.bgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
};
},

4
src/core/wrapper/layout/adapt/inline.vertical.js

@ -40,7 +40,9 @@ BI.InlineVerticalAdaptLayout = BI.inherit(BI.Layout, {
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
bgap: o.bgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
};
},

2
src/core/wrapper/layout/flex/flex.center.js

@ -37,6 +37,8 @@ BI.FlexCenterLayout = BI.inherit(BI.Layout, {
vgap: o.vgap,
tgap: o.tgap,
bgap: o.bgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
items: o.items
};
},

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

@ -38,6 +38,8 @@ BI.FlexHorizontalCenter = BI.inherit(BI.Layout, {
vgap: o.vgap,
tgap: o.tgap,
bgap: o.bgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
items: o.items
};
},

4
src/core/wrapper/layout/flex/flex.leftrightvertical.center.js

@ -28,7 +28,9 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
items: this._formatItems(o.items),
scrollx: o.scrollx,
scrolly: o.scrolly,
scrollable: o.scrollable
scrollable: o.scrollable,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
};
},

2
src/core/wrapper/layout/flex/flex.vertical.center.js

@ -39,6 +39,8 @@ BI.FlexVerticalCenter = BI.inherit(BI.Layout, {
lgap: o.lgap,
rgap: o.rgap,
hgap: o.hgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
items: o.items
};
},

4
src/core/wrapper/layout/float/float.absolute.horizontal.js

@ -35,7 +35,9 @@ BI.FloatAbsoluteHorizontalLayout = BI.inherit(BI.Layout, {
bgap: o.bgap,
// lgap和rgap不传的话内部不会设置left和right
lgap: o.lgap,
rgap: o.rgap
rgap: o.rgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
};
},

2
src/core/wrapper/layout/float/float.absolute.leftrightvertical.js

@ -29,6 +29,8 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
verticalAlign: o.verticalAlign,
items: this._formatItems(o.items),
vgap: "50%",
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
scrollx: o.scrollx,
scrolly: o.scrolly,
scrollable: o.scrollable

4
src/core/wrapper/layout/float/float.absolute.vertical.js

@ -35,7 +35,9 @@ BI.FloatAbsoluteVerticalLayout = BI.inherit(BI.Layout, {
rgap: o.rgap,
// tgap和bgap不传的话内部不会设置top和bottom
tgap: o.tgap,
bgap: o.bgap
bgap: o.bgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
};
},

2
src/core/wrapper/layout/float/float.horizontal.js

@ -51,6 +51,8 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, {
}],
horizontalAlign: o.horizontalAlign,
verticalAlign: o.verticalAlign,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
scrollx: o.scrollx,
scrolly: o.scrolly,
scrollable: o.scrollable

12
src/core/wrapper/layout/layout.adaptive.js

@ -2,12 +2,12 @@ BI.AdaptiveLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.AdaptiveLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-adaptive",
hgap: null,
vgap: null,
lgap: null,
rgap: null,
tgap: null,
bgap: null
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {

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

@ -22,6 +22,18 @@ BI.FloatLeftLayout = BI.inherit(BI.Layout, {
render: function () {
BI.FloatLeftLayout.superclass.render.apply(this, arguments);
var o = this.options;
if (o.innerHgap !== 0) {
this.element.css({
paddingLeft: this._optimiseGap(o.innerHgap),
paddingRight: this._optimiseGap(o.innerHgap)
})
}
if (o.innerVgap !== 0) {
this.element.css({
paddingTop: this._optimiseGap(o.innerVgap),
paddingBottom: this._optimiseGap(o.innerVgap)
})
}
this.populate(this.options.items);
},

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

@ -52,7 +52,7 @@ BI.InlineLayout = BI.inherit(BI.Layout, {
});
w.element.addClass("i-item");
if (columnSize === "fill" || columnSize === "") {
var length = 0, gap = o.hgap;
var length = 0, gap = o.hgap + o.innerHgap;
var fillCount = 0, autoCount = 0;
for (var k = 0, len = o.columnSize.length || o.items.length; k < len; k++) {
var cz = o.columnSize.length > 0 ? o.columnSize[k] : o.items[k].width;
@ -81,8 +81,8 @@ BI.InlineLayout = BI.inherit(BI.Layout, {
}
this._handleGap(w, item, i);
if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) {
var top = o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0),
bottom = o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0);
var top = o.innerVgap + o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0),
bottom = o.innerVgap + o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0);
var gap = (top + bottom) > 0 && (top + bottom) < 1 ? ((top + bottom) * 100).toFixed(1) + "%" : (top + bottom) / BI.pixRatio + BI.pixUnit;
w.element.css("height", "calc(100% - " + gap + ")");
}

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

@ -43,8 +43,8 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
}
w.element.css({
position: "absolute",
top: self._optimiseGap((item.vgap || 0) + (item.tgap || 0) + o.vgap + o.tgap),
bottom: self._optimiseGap((item.bgap || 0) + (item.vgap || 0) + o.vgap + o.bgap)
top: self._optimiseGap((item.vgap || 0) + (item.tgap || 0) + o.innerVgap + o.vgap + o.tgap),
bottom: self._optimiseGap((item.bgap || 0) + (item.vgap || 0) + o.innerVgap + o.vgap + o.bgap)
});
if (o.verticalAlign === BI.VerticalAlign.Middle) {
w.element.css({
@ -59,8 +59,8 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
});
var left = {}, right = {};
left[0] = 0;
right[items.length - 1] = 0;
left[0] = o.innerHgap;
right[items.length - 1] = o.innerHgap;
BI.any(items, function (i, item) {
if (BI.isEmptyObject(item)) {
@ -81,7 +81,7 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
left: self._optimiseGap(left[i] + (item.lgap || 0) + (item.hgap || 0) + o.hgap + o.lgap),
width: BI.isNumber(columnSize) ? self._optimiseGap(columnSize) : ""
});
if (columnSize === "" || columnSize === "fill") {
return true;
}
@ -100,7 +100,7 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
right: self._optimiseGap(right[i] + (item.rgap || 0) + (item.hgap || 0) + o.hgap + o.rgap),
width: BI.isNumber(columnSize) ? self._optimiseGap(columnSize) : ""
});
if (columnSize === "" || columnSize === "fill") {
return true;
}
@ -163,8 +163,8 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
}
w.element.css({
position: "absolute",
left: self._optimiseGap((item.lgap || 0) + (item.hgap || 0) + o.hgap + o.lgap),
right: self._optimiseGap((item.hgap || 0) + (item.rgap || 0) + o.hgap + o.rgap)
left: self._optimiseGap((item.lgap || 0) + (item.hgap || 0) + o.innerHgap + o.hgap + o.lgap),
right: self._optimiseGap((item.hgap || 0) + (item.rgap || 0) + o.innerHgap + o.hgap + o.rgap)
});
if (o.horizontalAlign === BI.HorizontalAlign.Center) {
w.element.css({
@ -179,8 +179,8 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
});
var top = {}, bottom = {};
top[0] = 0;
bottom[items.length - 1] = 0;
top[0] = o.innerVgap;
bottom[items.length - 1] = o.innerVgap;
BI.any(items, function (i, item) {
if (BI.isEmptyObject(item)) {
@ -201,7 +201,7 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
top: self._optimiseGap(top[i] + (item.vgap || 0) + (item.tgap || 0) + o.vgap + o.tgap),
height: BI.isNumber(rowSize) ? self._optimiseGap(rowSize) : ""
});
if (rowSize === "" || rowSize === "fill") {
return true;
}
@ -220,7 +220,7 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
bottom: self._optimiseGap(bottom[i] + (item.vgap || 0) + (item.bgap || 0) + o.vgap + o.bgap),
height: BI.isNumber(rowSize) ? self._optimiseGap(rowSize) : ""
});
if (rowSize === "" || rowSize === "fill") {
return true;
}

2
src/less/base/single/tip/tip.toast.less

@ -2,8 +2,6 @@
.bi-toast{
color: @color-bi-color-toast-text;
max-width: 400px;
min-width: 150px;
line-height: @font-size-16;
.border-radius(2px);
&.toast-success{

64
src/less/base/view/popupview.less

@ -28,42 +28,58 @@
}
.bi-popup-view[data-popper-placement^='top'], .bi-popup-view.top {
> div > .bi-bubble-arrow {
bottom: -12px;
width: 14px;
> .bubble-arrow {
bottom: 8px;
left: 1px;
> .bi-bubble-arrow-wrapper {
bottom: 0;
left: 0;
> .bi-bubble-arrow {
bottom: -12px;
width: 14px;
> .bubble-arrow {
bottom: 8px;
left: 1px;
}
}
}
}
.bi-popup-view[data-popper-placement^='bottom'], .bi-popup-view.bottom {
> div > .bi-bubble-arrow {
top: -12px;
width: 14px;
> .bubble-arrow {
top: 8px;
left: 1px;
> .bi-bubble-arrow-wrapper {
top: 0;
left: 0;
> .bi-bubble-arrow {
top: -12px;
width: 14px;
> .bubble-arrow {
top: 8px;
left: 1px;
}
}
}
}
.bi-popup-view[data-popper-placement^='left'], .bi-popup-view.left {
> div > .bi-bubble-arrow {
right: -12px;
height: 14px;
> .bubble-arrow {
right: 8px;
top: 1px;
> .bi-bubble-arrow-wrapper {
right: 0;
top: 0;
> .bi-bubble-arrow {
right: -12px;
height: 14px;
> .bubble-arrow {
right: 8px;
top: 1px;
}
}
}
}
.bi-popup-view[data-popper-placement^='right'], .bi-popup-view.right {
> div > .bi-bubble-arrow {
left: -12px;
height: 14px;
> .bubble-arrow {
left: 8px;
top: 1px;
> .bi-bubble-arrow-wrapper {
left: 0;
top: 0;
> .bi-bubble-arrow {
left: -12px;
height: 14px;
> .bubble-arrow {
left: 8px;
top: 1px;
}
}
}
}

2
src/less/resource/font.less

@ -83,7 +83,7 @@
//toast
.font(toast-error-font, @font-tip-error, @color-bi-color-toast-error);
.font(toast-success-font, @font-tip-success, @color-bi-color-toast-error);
.font(toast-success-font, @font-tip-success, @color-bi-color-toast-success);
.font(toast-warning-font, @font-tip-warning, @color-bi-color-toast-warning);
.font(toast-message-font, @font-tip-message, @color-bi-color-toast-normal);

2
src/widget/downlist/popup.downlist.js

@ -110,7 +110,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
}]
},
innerVGap: 5,
innerVgap: 5,
maxHeight: 378
};
item.el.childValues = [];

2
src/widget/multilayerdownlist/popup.downlist.js

@ -107,7 +107,7 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
}]
},
innerVGap: 5,
innerVgap: 5,
maxHeight: 378,
};
self._createChildren(item);

2
src/widget/singleslider/singleslider.js

@ -127,7 +127,7 @@ BI.SingleSlider = BI.inherit(BI.Single, {
width: "100%"
}, {
el: {
type: "bi.vertical_adapt",
type: "bi.vertical",
items: [{
type: "bi.horizontal_auto",
items: [this.label]

1
typescript/base/combination/combo.ts

@ -34,6 +34,7 @@ export declare class Combo extends Widget {
adjustYOffset?: number;
hideChecker?: Function;
offsetStyle?: 'left' | 'right' | 'center';
value?:any;
el?: any;
popup?: any;
comboClass?: string;

8
typescript/core/utils/tree.ts

@ -43,8 +43,8 @@ export declare class Tree {
postOrderTraverse(callback: Function): void;
nrPostOrderTraverse(callback: Function): void;
static transformToArrayFormat<T>(nodes: T | T[], pId: any, childKey?: string): T[];
static arrayFormat(nodes: Node | Node[], pId: any): Node[];
static transformToTreeFormat<T>(sNodes: T[]): Node[];
static treeFormat(sNodes: Node | Node[]): Node[];
static traversal(array: Node[], callback: Function, pNode: Node): void;
static arrayFormat<T>(nodes: T | T[], pId: any): T[];
static transformToTreeFormat<T>(sNodes: T[]): T[];
static treeFormat<T>(sNodes: T | T[]): T[];
static traversal<T>(array: T[], callback: (index:number,node:T,pNode?:T)=> boolean | void, pNode?: T): void;
}

5
typescript/core/wrapper/layout/sticky/sticky.horizontal.ts

@ -0,0 +1,5 @@
import { Layout } from "../../layout";
export declare class HorizontalStickyLayout extends Layout {
static xtype: string;
}

5
typescript/core/wrapper/layout/sticky/sticky.vertical.ts

@ -0,0 +1,5 @@
import { Layout } from "../../layout";
export declare class VerticalStickyLayout extends Layout {
static xtype: string;
}

6
typescript/index.ts

@ -182,6 +182,8 @@ import { TdLayout } from './core/wrapper/layout/layout.td';
import { MultiLayerSelectLevelTree } from './widget/multilayerselecttree/multilayerselecttree.leveltree';
import { SelectTreeExpander } from './widget/selecttree/selecttree.expander';
import { DownListGroupItem } from "./widget/downlist/item.downlistgroup";
import { VerticalStickyLayout } from "./core/wrapper/layout/sticky/sticky.vertical";
import { HorizontalStickyLayout } from "./core/wrapper/layout/sticky/sticky.horizontal";
import './shims-tsx';
@ -372,6 +374,8 @@ export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils {
MultiLayerSelectLevelTree: typeof MultiLayerSelectLevelTree;
SelectTreeExpander: typeof SelectTreeExpander;
DownListGroupItem: typeof DownListGroupItem;
VerticalStickyLayout: typeof VerticalStickyLayout;
HorizontalStickyLayout: typeof HorizontalStickyLayout;
}
export default {
@ -561,4 +565,6 @@ export {
SelectTreeExpander,
DirectionPager,
DownListGroupItem,
HorizontalStickyLayout,
VerticalStickyLayout,
};

4
typescript/shims-tsx.ts

@ -19,8 +19,8 @@ interface UIProps {
interface AdditionalProps {
column: number;
row: number;
innerVGap: number;
innerHGap: number;
innerVgap: number;
innerHgap: number;
}
interface ElementClassProps<T> extends UIProps {

5
typescript/widget/downlist/item.downlistgroup.ts

@ -4,6 +4,11 @@ export declare class DownListGroupItem extends BasicButton {
static xtype: string;
static EVENT_CHANGE: string;
props: {
iconCls1: string;
iconCls2: string;
} & BasicButton['props'];
doRedMark(...args: any[]): void;
unRedMark(...args: any[]): void;

Loading…
Cancel
Save