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": "#ECEEF3",
"@color-light-gray-theme-dark": "#292F45", "@color-light-gray-theme-dark": "#292F45",
"@border-color-dark-line": "#2E3A4D", "@border-color-dark-line": "#2E3A4D",
"@color-sliver-theme-dark": "363E55", "@color-sliver-theme-dark": "#363E55",
"@border-color-disabled": "#E7E8EB", "@border-color-disabled": "#E7E8EB",
"@color-bi-background-active-radio": "transparent", "@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": "#D0D4DA",
"@color-bi-background-disabled-active-checkbox-content-theme-dark": "#606479", "@color-bi-background-disabled-active-checkbox-content-theme-dark": "#606479",
"@color-bi-background-tooltip-success": "#2E3A4D", "@color-bi-background-tooltip-success": "#2E3A4D",
"@color-bi-text-header-background": "#647185",
"@color-bi-border-tooltip-success": "#2E3A4D", "@color-bi-border-tooltip-success": "#2E3A4D",
"@color-bi-background-toast-success": "#FFFFFF", "@color-bi-background-toast-success": "#FFFFFF",
"@color-bi-background-toast-warning": "#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 /> <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="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" /> <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", "name": "fineui",
"version": "2.0.20220221165305", "version": "2.0.20220301113302",
"description": "fineui", "description": "fineui",
"main": "dist/fineui.min.js", "main": "dist/fineui.min.js",
"types": "dist/lib/index.d.ts", "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) { if (!this.layouts) {
this.layouts = BI.createWidget(BI.extend({element: this}, this._packageLayout(items))); this.layouts = BI.createWidget(BI.extend({element: this}, this._packageLayout(items)));
} else { } 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, footerHeight: 44,
closable: true, // BI-40839 是否显示右上角的关闭按钮 closable: true, // BI-40839 是否显示右上角的关闭按钮
bodyHgap: BI.SIZE_CONSANTS.H_GAP_SIZE, 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: [{ items: [{
el: o.body el: o.body
}] }],
}, hgap: o.bodyHgap,
hgap: o.bodyHgap, tgap: o.bodyTgap
tgap: o.bodyTgap }
} : { } : {
el: { el: {
type: "bi.absolute", type: "bi.absolute",
@ -143,7 +143,6 @@ BI.Popover = BI.inherit(BI.Widget, {
} }
return BI.extend({ return BI.extend({
type: o.logic.dynamic ? "bi.vertical" : "bi.vtape",
items: items, items: items,
width: this._getSuitableWidth(size.width) width: this._getSuitableWidth(size.width)
}, o.logic.dynamic ? { }, o.logic.dynamic ? {

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

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

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

@ -30,10 +30,17 @@ BI.BlankIconTextItem = BI.inherit(BI.BasicButton, {
return { return {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
columnSize: [o.blankWidth, "fill", o.iconWrapperWidth || o.height], columnSize: [o.blankWidth, o.iconWrapperWidth || o.height, "fill"],
items: [{ items: [{
type: "bi.layout", type: "bi.layout",
width: o.blankWidth 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", type: "bi.label",
ref: function (_ref) { ref: function (_ref) {
@ -49,13 +56,6 @@ BI.BlankIconTextItem = BI.inherit(BI.BasicButton, {
value: o.value, value: o.value,
keyword: o.keyword, keyword: o.keyword,
height: o.height 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)) { if (isFunction(handler.onloadstart)) {
handler.onloadstart(rpe, {}); handler.onloadstart(rpe, {});
} }
with (document.body || document.documentElement) { var d = document.body || document.documentElement;
appendChild(iframe); d.appendChild(iframe);
appendChild(form); d.appendChild(form);
form.submit(); form.submit();
}
return handler; return handler;
}; };
@ -652,7 +651,7 @@
}); });
}, },
setMaxFileLength: function(v) { setMaxFileLength: function (v) {
this.options.maxLength = v; this.options.maxLength = v;
if (this.wrap) { if (this.wrap) {
this.wrap.maxLength = v; this.wrap.maxLength = v;

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

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

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

@ -20,52 +20,52 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, {
textRgap: 0 textRgap: 0
}); });
}, },
_init: function () {
BI.MultiSelectItem.superclass._init.apply(this, arguments); render: function () {
var self = this, o = this.options; var self = this, o = this.options;
this.checkbox = BI.createWidget({ this.checkbox = BI.createWidget({
type: "bi.checkbox" 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) { this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) { if (type === BI.Events.CLICK) {
self.setSelected(self.isSelected()); self.setSelected(self.isSelected());
} }
}); });
return {
BI.createWidget(BI.extend({ type: "bi.vertical_adapt",
element: this columnSize: [o.iconWrapperWidth || o.height, "fill"],
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { items: [{
items: BI.LogicFactory.createLogicItemsByDirection("left", {
type: "bi.center_adapt", type: "bi.center_adapt",
items: [this.checkbox], items: [this.checkbox]
width: o.iconWrapperWidth }, {
}, this.text) 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) { // _setEnable: function (enable) {
BI.MultiSelectItem.superclass._setEnable.apply(this, arguments); // BI.MultiSelectItem.superclass._setEnable.apply(this, arguments);
if (enable === true) { // if (enable === true) {
this.element.attr("tabIndex", 1); // this.element.attr("tabIndex", 1);
} else if (enable === false) { // } else if (enable === false) {
this.element.removeAttr("tabIndex"); // this.element.removeAttr("tabIndex");
} // }
}, // },
doRedMark: function () { doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments); 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 height: 24
}); });
}, },
_init: function () {
BI.SingleSelectIconTextItem.superclass._init.apply(this, arguments); render: function () {
var self = this, o = this.options; var self = this, o = this.options;
this.text = BI.createWidget({ this.text = BI.createWidget({
type: "bi.icon_text_item", type: "bi.icon_text_item",

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

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

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

@ -21,37 +21,39 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, {
textRgap: 0 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({ render: function () {
element: this var self = this, o = this.options;
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { return {
items: BI.LogicFactory.createLogicItemsByDirection("left", { type: "bi.vertical_adapt",
columnSize: [o.iconWrapperWidth || o.height, "fill"],
items: [{
type: "bi.center_adapt", type: "bi.center_adapt",
items: [this.radio], items: [{
width: o.iconWrapperWidth type: "bi.radio",
}, this.text) 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) { _setEnable: function (enable) {

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

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

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

@ -15,28 +15,17 @@ BI.PlusGroupNode = BI.inherit(BI.NodeButton, {
id: "", id: "",
pId: "", pId: "",
open: false, open: false,
iconWrapperWidth: null,
height: 24 height: 24
}); });
}, },
_init: function () {
BI.PlusGroupNode.superclass._init.apply(this, arguments); render: function () {
var self = this, o = this.options; var self = this, o = this.options;
this.checkbox = BI.createWidget({ this.checkbox = BI.createWidget({
type: "bi.tree_node_checkbox", type: "bi.tree_node_checkbox",
iconHeight: o.height, iconHeight: o.height,
iconWidth: o.height iconWidth: o.iconWrapperWidth || 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
}); });
this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) { this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) { if (type === BI.Events.CLICK) {
@ -44,16 +33,25 @@ BI.PlusGroupNode = BI.inherit(BI.NodeButton, {
} }
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}); });
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left); return {
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, { type: "bi.vertical_adapt",
width: 24, columnSize: [o.iconWrapperWidth || o.height, "fill"],
el: this.checkbox items: [this.checkbox, {
}, this.text); type: "bi.label",
BI.createWidget(BI.extend({ ref: function (_ref) {
element: this self.text = _ref;
}, BI.LogicFactory.createLogic(type, BI.extend(o.logic, { },
items: items 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 () { 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, isNeedAdjustWidth: true,
stopPropagation: false, stopPropagation: false,
adjustLength: 0, // 调整的距离 adjustLength: 0, // 调整的距离
// adjustXOffset: 0, adjustXOffset: 0,
// adjustYOffset: 10, adjustYOffset: 0,
hideChecker: BI.emptyFn, hideChecker: BI.emptyFn,
offsetStyle: "left", // left,right,center offsetStyle: "left", // left,right,center
el: {}, el: {},
@ -47,8 +47,8 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
isNeedAdjustHeight: o.isNeedAdjustHeight, isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: o.isNeedAdjustWidth, isNeedAdjustWidth: o.isNeedAdjustWidth,
stopPropagation: o.stopPropagation, stopPropagation: o.stopPropagation,
adjustXOffset: 0, adjustXOffset: o.adjustXOffset,
adjustYOffset: 0, adjustYOffset: o.adjustYOffset,
hideChecker: o.hideChecker, hideChecker: o.hideChecker,
offsetStyle: o.offsetStyle, offsetStyle: o.offsetStyle,
showArrow: true, 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", baseCls: config.baseCls + " bi-bubble-popup-view",
minWidth: 70, minWidth: 70,
maxWidth: 300, 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 () { _createToolBar: function () {
var o = this.options, self = this; var o = this.options, self = this;
@ -73,12 +72,16 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
}); });
}, },
_createContent: function () {
return this.options.el;
},
_createView: function () { _createView: function () {
var o = this.options; var o = this.options;
var button = BI.createWidget({ var button = BI.createWidget({
type: "bi.button_group", type: "bi.button_group",
items: [o.el], items: [this._createContent()],
layouts: [{ layouts: [{
type: "bi.vertical", type: "bi.vertical",
cls: "bar-popup-container", cls: "bar-popup-container",
@ -101,66 +104,29 @@ BI.shortcut("bi.bubble_bar_popup_view", BI.BubblePopupBarView);
* @class BI.TextBubblePopupBarView * @class BI.TextBubblePopupBarView
* @extends BI.BubblePopupView * @extends BI.BubblePopupView
*/ */
BI.TextBubblePopupBarView = BI.inherit(BI.Widget, { BI.TextBubblePopupBarView = BI.inherit(BI.BubblePopupBarView, {
props: function () { _defaultConfig: function () {
return { var config = BI.TextBubblePopupBarView.superclass._defaultConfig.apply(this, arguments);
baseCls: "bi-text-bubble-bar-popup-view", return BI.extend(config, {
baseCls: config.baseCls + " bi-text-bubble-bar-popup-view",
text: "", 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 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 { return {
type: "bi.bubble_bar_popup_view", type: "bi.label",
primary: o.primary, text: o.text,
showArrow: o.showArrow, whiteSpace: "normal",
minWidth: o.minWidth, textAlign: "left",
maxWidth: o.maxWidth,
minHeight: o.minHeight,
ref: function () { ref: function () {
self.popup = this; self.text = this;
}, }
el: {
type: "bi.label",
text: o.text,
whiteSpace: "normal",
textAlign: "left",
ref: function () {
self.text = this;
}
},
buttons: buttons
}; };
}, },
setDirection: function (direction, position) {
this.popup.setDirection(direction, position);
},
populate: function (v) { populate: function (v) {
this.text.setText(v || this.options.text); this.text.setText(v || this.options.text);
} }

6
src/core/3.ob.js

@ -51,7 +51,9 @@
if (BI.isFunction(this.props)) { if (BI.isFunction(this.props)) {
props = this.props(config); 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 () { _init: function () {
@ -67,7 +69,7 @@
self.on(eventName, lis); self.on(eventName, lis);
return; 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; 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) { var runConfigFunction = function (type) {
if (!type || !configFunctions[type]) { if (!type || !configFunctions[type]) {
return false; return false;

7
src/core/func/function.js

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

4
src/core/logic/logic.js

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

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

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

6
src/core/structure/cache.js

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

96
src/core/wrapper/layout.js

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

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

@ -37,7 +37,9 @@ BI.AbsoluteHorizontalLayout = BI.inherit(BI.Layout, {
lgap: o.lgap, lgap: o.lgap,
rgap: o.rgap, rgap: o.rgap,
tgap: o.tgap, 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); BI.AbsoluteLeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments);
return { return {
type: "bi.htape", type: "bi.htape",
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
ref: function (_ref) { ref: function (_ref) {
self.layout = _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, lgap: o.lgap,
rgap: o.rgap, rgap: o.rgap,
tgap: o.tgap, 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, lgap: o.lgap,
rgap: o.rgap, rgap: o.rgap,
tgap: o.tgap, 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) { if (leftRight.left || "left" in o.items) {
layoutArray.push({ layoutArray.push({
type: "bi.left", type: "bi.left",
lgap: o.innerHgap,
vgap: o.innerVgap,
items: [{ items: [{
el: { el: {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
@ -55,6 +57,8 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
if (leftRight.right || "right" in o.items) { if (leftRight.right || "right" in o.items) {
layoutArray.push({ layoutArray.push({
type: "bi.right", type: "bi.right",
rgap: o.innerHgap,
vgap: o.innerVgap,
items: [{ items: [{
el: { el: {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
@ -144,6 +148,8 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
tgap: o.tgap, tgap: o.tgap,
bgap: o.bgap, bgap: o.bgap,
vgap: o.vgap, vgap: o.vgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
scrollx: o.scrollx, scrollx: o.scrollx,
scrolly: o.scrolly, scrolly: o.scrolly,
scrollable: o.scrollable scrollable: o.scrollable
@ -196,6 +202,8 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
tgap: o.tgap, tgap: o.tgap,
bgap: o.bgap, bgap: o.bgap,
vgap: o.vgap, vgap: o.vgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
scrollx: o.scrollx, scrollx: o.scrollx,
scrolly: o.scrolly, scrolly: o.scrolly,
scrollable: o.scrollable 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, lgap: o.lgap,
rgap: o.rgap, rgap: o.rgap,
tgap: o.tgap, 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, lgap: o.lgap,
rgap: o.rgap, rgap: o.rgap,
tgap: o.tgap, 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, lgap: o.lgap,
rgap: o.rgap, rgap: o.rgap,
tgap: o.tgap, 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, lgap: o.lgap,
rgap: o.rgap, rgap: o.rgap,
tgap: o.tgap, 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, vgap: o.vgap,
tgap: o.tgap, tgap: o.tgap,
bgap: o.bgap, bgap: o.bgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
items: o.items 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, vgap: o.vgap,
tgap: o.tgap, tgap: o.tgap,
bgap: o.bgap, bgap: o.bgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
items: o.items 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), items: this._formatItems(o.items),
scrollx: o.scrollx, scrollx: o.scrollx,
scrolly: o.scrolly, 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, lgap: o.lgap,
rgap: o.rgap, rgap: o.rgap,
hgap: o.hgap, hgap: o.hgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
items: o.items 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, bgap: o.bgap,
// lgap和rgap不传的话内部不会设置left和right // lgap和rgap不传的话内部不会设置left和right
lgap: o.lgap, 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, verticalAlign: o.verticalAlign,
items: this._formatItems(o.items), items: this._formatItems(o.items),
vgap: "50%", vgap: "50%",
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
scrollx: o.scrollx, scrollx: o.scrollx,
scrolly: o.scrolly, scrolly: o.scrolly,
scrollable: o.scrollable 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, rgap: o.rgap,
// tgap和bgap不传的话内部不会设置top和bottom // tgap和bgap不传的话内部不会设置top和bottom
tgap: o.tgap, 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, horizontalAlign: o.horizontalAlign,
verticalAlign: o.verticalAlign, verticalAlign: o.verticalAlign,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
scrollx: o.scrollx, scrollx: o.scrollx,
scrolly: o.scrolly, scrolly: o.scrolly,
scrollable: o.scrollable scrollable: o.scrollable

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

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

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

@ -22,6 +22,18 @@ BI.FloatLeftLayout = BI.inherit(BI.Layout, {
render: function () { render: function () {
BI.FloatLeftLayout.superclass.render.apply(this, arguments); BI.FloatLeftLayout.superclass.render.apply(this, arguments);
var o = this.options; 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); 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"); w.element.addClass("i-item");
if (columnSize === "fill" || columnSize === "") { if (columnSize === "fill" || columnSize === "") {
var length = 0, gap = o.hgap; var length = 0, gap = o.hgap + o.innerHgap;
var fillCount = 0, autoCount = 0; var fillCount = 0, autoCount = 0;
for (var k = 0, len = o.columnSize.length || o.items.length; k < len; k++) { 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; 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); this._handleGap(w, item, i);
if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) { if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) {
var top = o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0), var top = o.innerVgap + o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0),
bottom = o.vgap + o.bgap + (item.bgap || 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; 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 + ")"); 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({ w.element.css({
position: "absolute", position: "absolute",
top: self._optimiseGap((item.vgap || 0) + (item.tgap || 0) + o.vgap + o.tgap), 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.vgap + o.bgap) bottom: self._optimiseGap((item.bgap || 0) + (item.vgap || 0) + o.innerVgap + o.vgap + o.bgap)
}); });
if (o.verticalAlign === BI.VerticalAlign.Middle) { if (o.verticalAlign === BI.VerticalAlign.Middle) {
w.element.css({ w.element.css({
@ -59,8 +59,8 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
}); });
var left = {}, right = {}; var left = {}, right = {};
left[0] = 0; left[0] = o.innerHgap;
right[items.length - 1] = 0; right[items.length - 1] = o.innerHgap;
BI.any(items, function (i, item) { BI.any(items, function (i, item) {
if (BI.isEmptyObject(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), left: self._optimiseGap(left[i] + (item.lgap || 0) + (item.hgap || 0) + o.hgap + o.lgap),
width: BI.isNumber(columnSize) ? self._optimiseGap(columnSize) : "" width: BI.isNumber(columnSize) ? self._optimiseGap(columnSize) : ""
}); });
if (columnSize === "" || columnSize === "fill") { if (columnSize === "" || columnSize === "fill") {
return true; 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), right: self._optimiseGap(right[i] + (item.rgap || 0) + (item.hgap || 0) + o.hgap + o.rgap),
width: BI.isNumber(columnSize) ? self._optimiseGap(columnSize) : "" width: BI.isNumber(columnSize) ? self._optimiseGap(columnSize) : ""
}); });
if (columnSize === "" || columnSize === "fill") { if (columnSize === "" || columnSize === "fill") {
return true; return true;
} }
@ -163,8 +163,8 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
} }
w.element.css({ w.element.css({
position: "absolute", position: "absolute",
left: self._optimiseGap((item.lgap || 0) + (item.hgap || 0) + o.hgap + o.lgap), 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.hgap + o.rgap) right: self._optimiseGap((item.hgap || 0) + (item.rgap || 0) + o.innerHgap + o.hgap + o.rgap)
}); });
if (o.horizontalAlign === BI.HorizontalAlign.Center) { if (o.horizontalAlign === BI.HorizontalAlign.Center) {
w.element.css({ w.element.css({
@ -179,8 +179,8 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
}); });
var top = {}, bottom = {}; var top = {}, bottom = {};
top[0] = 0; top[0] = o.innerVgap;
bottom[items.length - 1] = 0; bottom[items.length - 1] = o.innerVgap;
BI.any(items, function (i, item) { BI.any(items, function (i, item) {
if (BI.isEmptyObject(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), top: self._optimiseGap(top[i] + (item.vgap || 0) + (item.tgap || 0) + o.vgap + o.tgap),
height: BI.isNumber(rowSize) ? self._optimiseGap(rowSize) : "" height: BI.isNumber(rowSize) ? self._optimiseGap(rowSize) : ""
}); });
if (rowSize === "" || rowSize === "fill") { if (rowSize === "" || rowSize === "fill") {
return true; 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), bottom: self._optimiseGap(bottom[i] + (item.vgap || 0) + (item.bgap || 0) + o.vgap + o.bgap),
height: BI.isNumber(rowSize) ? self._optimiseGap(rowSize) : "" height: BI.isNumber(rowSize) ? self._optimiseGap(rowSize) : ""
}); });
if (rowSize === "" || rowSize === "fill") { if (rowSize === "" || rowSize === "fill") {
return true; return true;
} }

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

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

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

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

2
src/less/resource/font.less

@ -83,7 +83,7 @@
//toast //toast
.font(toast-error-font, @font-tip-error, @color-bi-color-toast-error); .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-warning-font, @font-tip-warning, @color-bi-color-toast-warning);
.font(toast-message-font, @font-tip-message, @color-bi-color-toast-normal); .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 maxHeight: 378
}; };
item.el.childValues = []; 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, maxHeight: 378,
}; };
self._createChildren(item); self._createChildren(item);

2
src/widget/singleslider/singleslider.js

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

1
typescript/base/combination/combo.ts

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

8
typescript/core/utils/tree.ts

@ -43,8 +43,8 @@ export declare class Tree {
postOrderTraverse(callback: Function): void; postOrderTraverse(callback: Function): void;
nrPostOrderTraverse(callback: Function): void; nrPostOrderTraverse(callback: Function): void;
static transformToArrayFormat<T>(nodes: T | T[], pId: any, childKey?: string): T[]; static transformToArrayFormat<T>(nodes: T | T[], pId: any, childKey?: string): T[];
static arrayFormat(nodes: Node | Node[], pId: any): Node[]; static arrayFormat<T>(nodes: T | T[], pId: any): T[];
static transformToTreeFormat<T>(sNodes: T[]): Node[]; static transformToTreeFormat<T>(sNodes: T[]): T[];
static treeFormat(sNodes: Node | Node[]): Node[]; static treeFormat<T>(sNodes: T | T[]): T[];
static traversal(array: Node[], callback: Function, pNode: Node): void; 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 { MultiLayerSelectLevelTree } from './widget/multilayerselecttree/multilayerselecttree.leveltree';
import { SelectTreeExpander } from './widget/selecttree/selecttree.expander'; import { SelectTreeExpander } from './widget/selecttree/selecttree.expander';
import { DownListGroupItem } from "./widget/downlist/item.downlistgroup"; 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'; import './shims-tsx';
@ -372,6 +374,8 @@ export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils {
MultiLayerSelectLevelTree: typeof MultiLayerSelectLevelTree; MultiLayerSelectLevelTree: typeof MultiLayerSelectLevelTree;
SelectTreeExpander: typeof SelectTreeExpander; SelectTreeExpander: typeof SelectTreeExpander;
DownListGroupItem: typeof DownListGroupItem; DownListGroupItem: typeof DownListGroupItem;
VerticalStickyLayout: typeof VerticalStickyLayout;
HorizontalStickyLayout: typeof HorizontalStickyLayout;
} }
export default { export default {
@ -561,4 +565,6 @@ export {
SelectTreeExpander, SelectTreeExpander,
DirectionPager, DirectionPager,
DownListGroupItem, DownListGroupItem,
HorizontalStickyLayout,
VerticalStickyLayout,
}; };

4
typescript/shims-tsx.ts

@ -19,8 +19,8 @@ interface UIProps {
interface AdditionalProps { interface AdditionalProps {
column: number; column: number;
row: number; row: number;
innerVGap: number; innerVgap: number;
innerHGap: number; innerHgap: number;
} }
interface ElementClassProps<T> extends UIProps { 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 xtype: string;
static EVENT_CHANGE: string; static EVENT_CHANGE: string;
props: {
iconCls1: string;
iconCls2: string;
} & BasicButton['props'];
doRedMark(...args: any[]): void; doRedMark(...args: any[]): void;
unRedMark(...args: any[]): void; unRedMark(...args: any[]): void;

Loading…
Cancel
Save