Browse Source

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

es6
Tangjinxia 3 years ago
parent
commit
dc9b4dd373
  1. 1
      changelog.md
  2. 4
      dist/2.0/fineui.css
  3. 4
      dist/2.0/fineui.ie.min.js
  4. 2
      dist/2.0/fineui.ie.min.js.map
  5. 686
      dist/2.0/fineui.js
  6. 2
      dist/2.0/fineui.js.map
  7. 4
      dist/2.0/fineui.min.css
  8. 4
      dist/2.0/fineui.min.js
  9. 2
      dist/2.0/fineui.min.js.map
  10. 4
      dist/2.0/fineui_without_normalize.css
  11. 4
      dist/2.0/fineui_without_normalize.min.css
  12. 4
      dist/core.css
  13. 686
      dist/core.js
  14. 2
      dist/core.js.map
  15. 4
      dist/demo.css
  16. 686
      dist/demo.js
  17. 2
      dist/demo.js.map
  18. 4
      dist/fineui.css
  19. 4
      dist/fineui.ie.min.js
  20. 2
      dist/fineui.ie.min.js.map
  21. 686
      dist/fineui.js
  22. 2
      dist/fineui.js.map
  23. 4
      dist/fineui.min.css
  24. 4
      dist/fineui.min.js
  25. 2
      dist/fineui.min.js.map
  26. 4
      dist/fineui.proxy.css
  27. 686
      dist/fineui.proxy.js
  28. 2
      dist/fineui.proxy.js.map
  29. 4
      dist/fineui.proxy.min.css
  30. 4
      dist/fineui.proxy.min.js
  31. 2
      dist/fineui.proxy.min.js.map
  32. 682
      dist/fineui_without_jquery_polyfill.js
  33. 2
      dist/fineui_without_jquery_polyfill.js.map
  34. 2
      dist/font.css
  35. BIN
      dist/font/iconfont.eot
  36. 10
      dist/font/iconfont.svg
  37. BIN
      dist/font/iconfont.ttf
  38. BIN
      dist/font/iconfont.woff
  39. BIN
      dist/font/iconfont.woff2
  40. 2
      dist/lib/base/tree/customtree.d.ts
  41. 2
      dist/resource.css
  42. 2
      dist/utils.js
  43. 2
      dist/utils.min.js
  44. 2
      package.json
  45. 121
      src/case/colorchooser/colorpicker/editor.colorpicker.hex.js
  46. 103
      src/core/wrapper/layout.js
  47. 4
      src/core/wrapper/layout/adapt/absolute.center.js
  48. 2
      src/core/wrapper/layout/adapt/absolute.horizontal.js
  49. 6
      src/core/wrapper/layout/adapt/absolute.leftrightvertical.js
  50. 2
      src/core/wrapper/layout/adapt/absolute.vertical.js
  51. 2
      src/core/wrapper/layout/adapt/adapt.center.js
  52. 7
      src/core/wrapper/layout/adapt/adapt.leftrightvertical.js
  53. 30
      src/core/wrapper/layout/adapt/adapt.table.js
  54. 2
      src/core/wrapper/layout/adapt/adapt.vertical.js
  55. 4
      src/core/wrapper/layout/adapt/auto.horizontal.js
  56. 4
      src/core/wrapper/layout/adapt/inline.center.js
  57. 4
      src/core/wrapper/layout/adapt/inline.horizontal.js
  58. 4
      src/core/wrapper/layout/adapt/inline.vertical.js
  59. 17
      src/core/wrapper/layout/fill/float.fill.horizontal.js
  60. 10
      src/core/wrapper/layout/flex/flex.center.js
  61. 10
      src/core/wrapper/layout/flex/flex.horizontal.center.js
  62. 4
      src/core/wrapper/layout/flex/flex.horizontal.js
  63. 13
      src/core/wrapper/layout/flex/flex.leftrightvertical.center.js
  64. 10
      src/core/wrapper/layout/flex/flex.vertical.center.js
  65. 4
      src/core/wrapper/layout/flex/flex.vertical.js
  66. 8
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js
  67. 8
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js
  68. 4
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js
  69. 8
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js
  70. 4
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js
  71. 4
      src/core/wrapper/layout/float/float.absolute.center.js
  72. 19
      src/core/wrapper/layout/float/float.absolute.horizontal.js
  73. 17
      src/core/wrapper/layout/float/float.absolute.leftrightvertical.js
  74. 13
      src/core/wrapper/layout/float/float.absolute.vertical.js
  75. 4
      src/core/wrapper/layout/layout.absolute.js
  76. 4
      src/core/wrapper/layout/layout.adaptive.js
  77. 5
      src/core/wrapper/layout/layout.border.js
  78. 11
      src/core/wrapper/layout/layout.card.js
  79. 4
      src/core/wrapper/layout/layout.default.js
  80. 30
      src/core/wrapper/layout/layout.division.js
  81. 8
      src/core/wrapper/layout/layout.flow.js
  82. 28
      src/core/wrapper/layout/layout.grid.js
  83. 37
      src/core/wrapper/layout/layout.inline.js
  84. 16
      src/core/wrapper/layout/layout.lattice.js
  85. 10
      src/core/wrapper/layout/layout.table.js
  86. 18
      src/core/wrapper/layout/layout.tape.js
  87. 10
      src/core/wrapper/layout/layout.td.js
  88. 4
      src/core/wrapper/layout/layout.vertical.js
  89. 11
      src/core/wrapper/layout/layout.window.js
  90. 8
      src/core/wrapper/layout/middle/middle.center.js
  91. 8
      src/core/wrapper/layout/middle/middle.float.center.js
  92. 8
      src/core/wrapper/layout/middle/middle.horizontal.js
  93. 8
      src/core/wrapper/layout/middle/middle.vertical.js
  94. 12
      src/less/core/wrapper/float.absolute.less
  95. 2
      typescript/base/tree/customtree.ts

1
changelog.md

@ -1,5 +1,6 @@
# 更新日志 # 更新日志
2.0(2021-07) 2.0(2021-07)
- layout支持forceUpdate刷新方式
- width属性支持calc() - width属性支持calc()
- 修改了颜色选择器交互 - 修改了颜色选择器交互
- 新增bi.horizontal_fill、bi.vertical_fill布局 - 新增bi.horizontal_fill、bi.vertical_fill布局

4
dist/2.0/fineui.css vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.ie.min.js.map vendored

File diff suppressed because one or more lines are too long

686
dist/2.0/fineui.js vendored

File diff suppressed because it is too large Load Diff

2
dist/2.0/fineui.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.min.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui_without_normalize.css vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui_without_normalize.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/core.css vendored

File diff suppressed because one or more lines are too long

686
dist/core.js vendored

File diff suppressed because it is too large Load Diff

2
dist/core.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/demo.css vendored

File diff suppressed because one or more lines are too long

686
dist/demo.js vendored

File diff suppressed because it is too large Load Diff

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.css vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.ie.min.js.map vendored

File diff suppressed because one or more lines are too long

686
dist/fineui.js vendored

File diff suppressed because it is too large Load Diff

2
dist/fineui.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.min.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.proxy.css vendored

File diff suppressed because one or more lines are too long

686
dist/fineui.proxy.js vendored

File diff suppressed because it is too large Load Diff

2
dist/fineui.proxy.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.proxy.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.proxy.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.proxy.min.js.map vendored

File diff suppressed because one or more lines are too long

682
dist/fineui_without_jquery_polyfill.js vendored

File diff suppressed because it is too large Load Diff

2
dist/fineui_without_jquery_polyfill.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/font.css vendored

File diff suppressed because one or more lines are too long

BIN
dist/font/iconfont.eot vendored

Binary file not shown.

10
dist/font/iconfont.svg vendored

@ -14,6 +14,8 @@
/> />
<missing-glyph /> <missing-glyph />
<glyph glyph-name="zhongxinxuanze" unicode="&#59498;" d="M896 832a64 64 0 0 0 64-64v-512c-4.992-15.616-15.04-23.424-30.336-23.424a32.896 32.896 0 0 0-29.888 17.216l-3.2 6.208H896V768H128v-768h512v-1.6c16.576-4.032 24.832-14.272 24.832-30.72 0-14.4-6.4-24.32-19.008-29.632L640-64H128a64 64 0 0 0-64 64V768a64 64 0 0 0 64 64h768zM452.288 526.72v-82.048H628.48c14.848 0 28.992-7.04 37.952-18.88l128.64-342.464 118.08-0.256c26.304-0.064 37.504-17.92 37.504-38.336 0-20.352-11.328-37.632-37.632-37.632l-141.76 0.384a42.24 42.24 0 0 0-41.6 28.864c-27.84 73.856-69.44 184.64-124.928 332.352H452.288v-74.048c0-25.6-27.264-40-46.08-24.32l-60.928 50.944-77.888 65.024a32.32 32.32 0 0 0 0 48.64l77.888 65.088 60.928 50.944c18.816 15.68 46.08 1.28 46.08-24.32z" horiz-adv-x="1024" />
<glyph glyph-name="yunhangzhong" unicode="&#59497;" d="M729.088 586.496a24 24 0 0 0 33.472-1.792c58.432-62.08 95.872-179.2 84.864-268.928a23.68 23.68 0 1 0-47.104 5.76c9.344 75.968-22.848 175.68-73.024 231.488a23.68 23.68 0 0 0 1.792 33.472zM810.368 318.08a142.336 142.336 0 1 0-54.272-279.488 142.336 142.336 0 0 0 54.272 279.424z m-12.16-62.912a78.336 78.336 0 1 1-29.952-153.728 78.336 78.336 0 0 1 29.888 153.728zM601.792 67.2a23.68 23.68 0 0 0-15.808-29.632c-84.736-25.856-169.6-18.24-246.272 29.632a23.68 23.68 0 1 0 25.088 40.192c64.896-40.512 135.616-46.336 207.36-24.448a23.68 23.68 0 0 0 29.632-15.744zM352.32 92.864a142.336 142.336 0 1 1-230.272 167.36 142.336 142.336 0 0 1 230.272-167.36z m-51.776 37.632a78.336 78.336 0 1 0-126.72 92.096 78.336 78.336 0 0 0 126.72-92.096zM194.88 415.232a23.68 23.68 0 0 0-16.704 29.056 307.648 307.648 0 0 0 162.624 197.248 23.68 23.68 0 0 0 20.8-42.624A260.224 260.224 0 0 1 224 432a23.68 23.68 0 0 0-29.12-16.768zM355.904 617.216A142.336 142.336 0 1 1 619.84 723.84 142.336 142.336 0 0 1 355.84 617.216z m59.328 23.936a78.336 78.336 0 1 0 145.28 58.688 78.336 78.336 0 0 0-145.28-58.688z" horiz-adv-x="1024" /> <glyph glyph-name="yunhangzhong" unicode="&#59497;" d="M729.088 586.496a24 24 0 0 0 33.472-1.792c58.432-62.08 95.872-179.2 84.864-268.928a23.68 23.68 0 1 0-47.104 5.76c9.344 75.968-22.848 175.68-73.024 231.488a23.68 23.68 0 0 0 1.792 33.472zM810.368 318.08a142.336 142.336 0 1 0-54.272-279.488 142.336 142.336 0 0 0 54.272 279.424z m-12.16-62.912a78.336 78.336 0 1 1-29.952-153.728 78.336 78.336 0 0 1 29.888 153.728zM601.792 67.2a23.68 23.68 0 0 0-15.808-29.632c-84.736-25.856-169.6-18.24-246.272 29.632a23.68 23.68 0 1 0 25.088 40.192c64.896-40.512 135.616-46.336 207.36-24.448a23.68 23.68 0 0 0 29.632-15.744zM352.32 92.864a142.336 142.336 0 1 1-230.272 167.36 142.336 142.336 0 0 1 230.272-167.36z m-51.776 37.632a78.336 78.336 0 1 0-126.72 92.096 78.336 78.336 0 0 0 126.72-92.096zM194.88 415.232a23.68 23.68 0 0 0-16.704 29.056 307.648 307.648 0 0 0 162.624 197.248 23.68 23.68 0 0 0 20.8-42.624A260.224 260.224 0 0 1 224 432a23.68 23.68 0 0 0-29.12-16.768zM355.904 617.216A142.336 142.336 0 1 1 619.84 723.84 142.336 142.336 0 0 1 355.84 617.216z m59.328 23.936a78.336 78.336 0 1 0 145.28 58.688 78.336 78.336 0 0 0-145.28-58.688z" horiz-adv-x="1024" />
<glyph glyph-name="renwuyunwei" unicode="&#59496;" d="M782.464 753.92h-61.504v5.76c0 39.872-33.088 72.32-73.728 72.32H376.704c-40.64 0-73.728-32.448-73.728-72.32v-5.76h-61.504C178.88 753.92 128 704 128 642.56v-531.136C128 49.984 178.88 0 241.472 0h540.992c62.592 0 113.536 49.984 113.536 111.424V642.56c0 61.44-50.944 111.488-113.536 111.488z m-410.432 13.44h281.024c1.6 0 2.816-1.28 2.816-2.816v-96.128c0-1.536-1.28-2.816-2.816-2.816H372.032a2.88 2.88 0 0 0-1.984 0.832 2.752 2.752 0 0 0-0.832 1.984V764.544c0 1.536 1.28 2.752 2.816 2.752zM832 105.472c0-23.04-19.2-41.856-42.624-41.856H234.688a42.24 42.24 0 0 0-42.56 41.856v536.96a42.24 42.24 0 0 0 42.56 41.856h68.288v-9.408c0-39.936 33.088-72.32 73.728-72.32h270.528c40.64 0 73.728 32.384 73.728 72.32v9.408h68.416c23.488 0 42.624-18.752 42.624-41.856v-536.96zM481.92 207.488a35.84 35.84 0 0 0-24.96 10.112L332.8 337.92a35.84 35.84 0 1 0 49.92 51.456L481.472 293.76l169.856 170.88a35.84 35.84 0 1 0 50.816-50.496l-194.752-196.032a35.712 35.712 0 0 0-25.472-10.624z" horiz-adv-x="1024" /> <glyph glyph-name="renwuyunwei" unicode="&#59496;" d="M782.464 753.92h-61.504v5.76c0 39.872-33.088 72.32-73.728 72.32H376.704c-40.64 0-73.728-32.448-73.728-72.32v-5.76h-61.504C178.88 753.92 128 704 128 642.56v-531.136C128 49.984 178.88 0 241.472 0h540.992c62.592 0 113.536 49.984 113.536 111.424V642.56c0 61.44-50.944 111.488-113.536 111.488z m-410.432 13.44h281.024c1.6 0 2.816-1.28 2.816-2.816v-96.128c0-1.536-1.28-2.816-2.816-2.816H372.032a2.88 2.88 0 0 0-1.984 0.832 2.752 2.752 0 0 0-0.832 1.984V764.544c0 1.536 1.28 2.752 2.816 2.752zM832 105.472c0-23.04-19.2-41.856-42.624-41.856H234.688a42.24 42.24 0 0 0-42.56 41.856v536.96a42.24 42.24 0 0 0 42.56 41.856h68.288v-9.408c0-39.936 33.088-72.32 73.728-72.32h270.528c40.64 0 73.728 32.384 73.728 72.32v9.408h68.416c23.488 0 42.624-18.752 42.624-41.856v-536.96zM481.92 207.488a35.84 35.84 0 0 0-24.96 10.112L332.8 337.92a35.84 35.84 0 1 0 49.92 51.456L481.472 293.76l169.856 170.88a35.84 35.84 0 1 0 50.816-50.496l-194.752-196.032a35.712 35.712 0 0 0-25.472-10.624z" horiz-adv-x="1024" />
@ -88,9 +90,9 @@
<glyph glyph-name="normal122" unicode="&#59462;" d="M446.976 801.28l118.336-131.392H825.6c74.24 0 134.4-58.816 134.4-131.328v-175.168h-64v62.592H128v-330.048c0-32 26.688-57.856 59.584-57.856L576 38.144v-68.864H198.4c-74.24 0-134.4 58.816-134.4 131.392V801.28h382.976z m334.976-497.408l4.992-3.968 136-132.992 0.512-0.512a30.912 30.912 0 0 0-0.32-44.032L787.2-10.496a32 32 0 0 0-44.8 0l-0.192 0.256a30.912 30.912 0 0 0-0.512 43.776l0.512 0.512 81.024 79.232H607.296a31.296 31.296 0 1 0 0 62.528h216.128l-81.472 79.68-0.256 0.192a31.04 31.04 0 0 0-3.392 39.744l3.648 4.288 0.256 0.256a32 32 0 0 0 39.744 3.968z m-373.12 434.88H128v-250.24h768V545.92c0 31.936-26.688 57.792-59.584 57.792H531.2l-122.368 135.04z" horiz-adv-x="1024" /> <glyph glyph-name="normal122" unicode="&#59462;" d="M446.976 801.28l118.336-131.392H825.6c74.24 0 134.4-58.816 134.4-131.328v-175.168h-64v62.592H128v-330.048c0-32 26.688-57.856 59.584-57.856L576 38.144v-68.864H198.4c-74.24 0-134.4 58.816-134.4 131.392V801.28h382.976z m334.976-497.408l4.992-3.968 136-132.992 0.512-0.512a30.912 30.912 0 0 0-0.32-44.032L787.2-10.496a32 32 0 0 0-44.8 0l-0.192 0.256a30.912 30.912 0 0 0-0.512 43.776l0.512 0.512 81.024 79.232H607.296a31.296 31.296 0 1 0 0 62.528h216.128l-81.472 79.68-0.256 0.192a31.04 31.04 0 0 0-3.392 39.744l3.648 4.288 0.256 0.256a32 32 0 0 0 39.744 3.968z m-373.12 434.88H128v-250.24h768V545.92c0 31.936-26.688 57.792-59.584 57.792H531.2l-122.368 135.04z" horiz-adv-x="1024" />
<glyph glyph-name="bupaixu" unicode="&#59461;" d="M750.4 63.04a32 32 0 0 0 32-32v-10.624a32 32 0 0 0-32-32H533.568a32 32 0 0 0-32 32v10.624a32 32 0 0 0 32 32h216.832z m-493.44 654.08a25.6 25.6 0 0 0 0.512-0.576l137.472-141.632a25.6 25.6 0 0 0-18.432-43.392H277.568v-318.4h98.944a25.6 25.6 0 0 0 14.016-4.224l3.84-3.072a25.6 25.6 0 0 0 0.576-36.16l-137.472-141.696a25.6 25.6 0 0 0-36.736 0L83.2 169.664a25.6 25.6 0 0 0 18.368 43.392h101.312V531.584H101.632a25.6 25.6 0 0 0-18.368 43.392L220.8 716.544a25.6 25.6 0 0 0 36.16 0.576z m655.36-430.144a32 32 0 0 0 32-32v-10.624a32 32 0 0 0-32-32H533.632a32 32 0 0 0-32 32v10.624a32 32 0 0 0 32 32h378.816z m-161.152 223.872a32 32 0 0 0 32-32v-10.624a32 32 0 0 0-32-32h-217.6a32 32 0 0 0-32 32v10.624a32 32 0 0 0 32 32h217.6z m166.208 223.936a32 32 0 0 0 32-32v-10.624a32 32 0 0 0-32-32H533.568a32 32 0 0 0-32 32V702.72a32 32 0 0 0 32 32h383.808z" horiz-adv-x="1024" /> <glyph glyph-name="bupaixu" unicode="&#59461;" d="M313.6 38.39999999999998c17.664 0 32-16.768 32-37.44 0-20.672-14.336-37.44-32-37.44h-192c-17.664 0-32 16.768-32 37.44 0 20.672 14.336 37.44 32 37.44h192z m480.896 665.92a25.6 25.6 0 0 0 0.576-0.576l137.472-141.632a25.6 25.6 0 0 0-18.432-43.392h-98.88v-318.4h98.88a25.6 25.6 0 0 0 14.016-4.224l3.84-3.072a25.6 25.6 0 0 0 0.576-36.16l-137.472-141.696-0.576-0.512a25.6 25.6 0 0 0-36.16 0.512L620.8 156.86400000000003a25.6 25.6 0 0 0 18.368 43.392l101.376 0.064V518.72H639.232a25.6 25.6 0 0 0-18.368 43.392l137.472 141.632a25.6 25.6 0 0 0 36.16 0.576zM505.6 294.4c17.664 0 32-16.768 32-37.44 0-20.672-14.336-37.44-32-37.44h-384c-17.664 0-32 16.768-32 37.44 0 20.672 14.336 37.44 32 37.44h384z m-157.568 256c17.664 0 32-16.768 32-37.44 0-20.672-14.336-37.44-32-37.44H121.6c-17.664 0-32 16.768-32 37.44 0 20.672 14.336 37.44 32 37.44h226.432z m158.976 256c19.136 0 34.688-16.768 34.688-37.44 0-20.672-15.552-37.44-34.688-37.44h-382.72c-19.2 0-34.688 16.768-34.688 37.44 0 20.672 15.552 37.44 34.688 37.44h382.72z" horiz-adv-x="1024" />
<glyph glyph-name="anleixingpaixu" unicode="&#59460;" d="M370.368 333.632v-54.592h-114.56v-278.656h-62.208V279.04h-106.88v54.592h283.648zM627.072 76.8a32 32 0 0 0 32-32v-10.88a32 32 0 0 0-32-32H510.272a32 32 0 0 0-32 32v10.88a32 32 0 0 0 32 32h116.8z m60.288 217.216a32 32 0 0 0 32-32v-10.88a32 32 0 0 0-32-32H510.272a32 32 0 0 0-32 32v10.88a32 32 0 0 0 32 32h177.088zM250.88 755.52l-15.872-57.92h102.656l14.912 57.92h52.928l-13.952-57.92h56.768v-43.584h-63.744l-26.88-109.888h76.672v-46.08H351.68l-15.936-68.288H282.88l15.936 68.224H192.192l-17.92-68.224h-54.784l17.92 68.224h-50.624v46.08h57.6l29.888 109.952H103.68V697.6h76.544l15.936 57.92h54.784z m556.992-244.416a32 32 0 0 0 32-32v-10.88a32 32 0 0 0-32-32h-297.6a32 32 0 0 0-32 32v10.88a32 32 0 0 0 32 32h297.6zM332.672 654.08H230.016l-30.848-109.888h105.6l27.904 109.888z m595.712 74.24a32 32 0 0 0 32-32v-10.88a32 32 0 0 0-32-32H510.272a32 32 0 0 0-32 32v10.88a32 32 0 0 0 32 32h418.112z" horiz-adv-x="1024" /> <glyph glyph-name="anleixingpaixu" unicode="&#59460;" d="M256 38.39999999999998c17.664 0 32-16.768 32-37.44 0-20.672-14.336-37.44-32-37.44H96c-17.664 0-32 16.768-32 37.44 0 20.672 14.336 37.44 32 37.44H256z m360.192 435.52a32 32 0 0 0 30.784-40.448l-13.248-48.256h157.184l16.64 64.64a32 32 0 0 0 31.04 24.064h15.68a31.872 31.872 0 0 0 30.976-39.36l-11.84-49.28h54.912a32 32 0 0 0 32-32v-2.752a32 32 0 0 0-32-32H862.72l-41.152-168.32h85.376a32 32 0 0 0 32-32v-6.528a32 32 0 0 0-32-32h-94.528l-18.624-79.808a32 32 0 0 0-31.168-24.704h-15.232a32 32 0 0 0-31.168 39.232l15.232 65.28H568.128l-21.12-80.64a32 32 0 0 0-30.976-23.872h-17.728a32 32 0 0 0-30.912 40.128l16.896 64.384h-45.504a32 32 0 0 0-32 32v6.528a32 32 0 0 0 32 32h56.192l45.696 168.32H464.704a32 32 0 0 0-32 32v2.688a32 32 0 0 0 32 32h85.12l17.92 65.216a32 32 0 0 0 30.912 23.488h17.536z m167.04-155.392H626.176l-47.296-168.32h161.792l42.688 168.32zM288 294.4c17.664 0 32-16.768 32-37.44 0-20.672-14.336-37.44-32-37.44h-192c-17.664 0-32 16.768-32 37.44 0 20.672 14.336 37.44 32 37.44h192z m160 256c17.664 0 32-16.768 32-37.44 0-20.672-14.336-37.44-32-37.44H96c-17.664 0-32 16.768-32 37.44 0 20.672 14.336 37.44 32 37.44H448z m352 256c17.664 0 32-16.768 32-37.44 0-20.672-14.336-37.44-32-37.44h-704c-17.664 0-32 16.768-32 37.44 0 20.672 14.336 37.44 32 37.44h704z" horiz-adv-x="1024" />
<glyph glyph-name="ziduanshezhi" unicode="&#59459;" d="M992 768a32 32 0 0 0 32-32v-704a32 32 0 0 0-32-32H32a32 32 0 0 0-32 32v704A32 32 0 0 0 32 768h960zM960 704H64v-640h896V704zM576 603.776h64v-137.024h153.472c51.84 0 92.8-42.56 92.8-93.888v-123.52c0-51.264-40.96-93.824-92.8-93.824H668.8c-51.84 0-92.8 42.56-92.8 93.888V603.776z m-199.872-4.928c28.672-9.6 51.2-32.064 60.672-60.8l127.488-382.336H496.96l-42.752 128.064H237.312l-42.56-127.872H127.296l127.36 382.208a96 96 0 0 0 121.472 60.736zM640 249.408c0-16.512 12.864-29.888 28.8-29.888h124.672c15.936 0 28.8 13.44 28.8 29.888V372.864a29.376 29.376 0 0 1-28.8 29.824H668.8a29.376 29.376 0 0 1-28.8-29.824v-123.52zM315.392 517.888l-56.704-170.112h174.144l-56.704 170.112a32 32 0 0 1-60.736 0z" horiz-adv-x="1024" /> <glyph glyph-name="ziduanshezhi" unicode="&#59459;" d="M992 768a32 32 0 0 0 32-32v-704a32 32 0 0 0-32-32H32a32 32 0 0 0-32 32v704A32 32 0 0 0 32 768h960zM960 704H64v-640h896V704zM576 603.776h64v-137.024h153.472c51.84 0 92.8-42.56 92.8-93.888v-123.52c0-51.264-40.96-93.824-92.8-93.824H668.8c-51.84 0-92.8 42.56-92.8 93.888V603.776z m-199.872-4.928c28.672-9.6 51.2-32.064 60.672-60.8l127.488-382.336H496.96l-42.752 128.064H237.312l-42.56-127.872H127.296l127.36 382.208a96 96 0 0 0 121.472 60.736zM640 249.408c0-16.512 12.864-29.888 28.8-29.888h124.672c15.936 0 28.8 13.44 28.8 29.888V372.864a29.376 29.376 0 0 1-28.8 29.824H668.8a29.376 29.376 0 0 1-28.8-29.824v-123.52zM315.392 517.888l-56.704-170.112h174.144l-56.704 170.112a32 32 0 0 1-60.736 0z" horiz-adv-x="1024" />
@ -946,9 +948,9 @@
<glyph glyph-name="guanlianshitu" unicode="&#59184;" d="M384 253.69600000000003l256 305.088V768a64 64 0 0 0 64 64h192a64 64 0 0 0 64-64v-512a64 64 0 0 0-64-64h-192a64 64 0 0 0-64 64V459.2l-256-305.088V0a64 64 0 0 0-64-64H128a64 64 0 0 0-64 64V512a64 64 0 0 0 64 64h192a64 64 0 0 0 64-64v-258.304zM128 512v-512h192V512H128z m576 256v-512h192V768h-192z" horiz-adv-x="1024" /> <glyph glyph-name="guanlianshitu" unicode="&#59184;" d="M384 253.69600000000003l256 305.088V768a64 64 0 0 0 64 64h192a64 64 0 0 0 64-64v-512a64 64 0 0 0-64-64h-192a64 64 0 0 0-64 64V459.2l-256-305.088V0a64 64 0 0 0-64-64H128a64 64 0 0 0-64 64V512a64 64 0 0 0 64 64h192a64 64 0 0 0 64-64v-258.304zM128 512v-512h192V512H128z m576 256v-512h192V768h-192z" horiz-adv-x="1024" />
<glyph glyph-name="shijian1" unicode="&#59185;" d="M96 819.2h704a32 32 0 1 0 0-64h-704a32 32 0 0 0 0 64z m0-256H448a32 32 0 0 0 0-64H96a32 32 0 0 0 0 64z m0-256h192a32 32 0 0 0 0-64h-192a32 32 0 0 0 0 64z m0-256H256a32 32 0 1 0 0-64H96a32 32 0 1 0 0 64z m576 477.76c158.784 0 288-129.28 288-288 0-158.848-129.216-288-288-288a288.32 288.32 0 0 0-288 288c0 158.72 129.216 288 288 288z m0-512c123.52 0 224 100.48 224 224s-100.48 224-224 224-224-100.48-224-224 100.48-224 224-224z m0 352v-132.928l76.16-65.28a32 32 0 0 0-41.728-48.64L619.136 197.12a32 32 0 0 0-11.136 24.32V368.89599999999996a32 32 0 1 0 64 0z" horiz-adv-x="1024" /> <glyph glyph-name="shijian1" unicode="&#59185;" d="M672 528.96c158.784 0 288-129.28 288-288 0-158.848-129.216-288-288-288a288.32 288.32 0 0 0-288 288c0 158.72 129.216 288 288 288zM256 38.39999999999998c17.664 0 32-16.768 32-37.44 0-20.672-14.336-37.44-32-37.44H96c-17.664 0-32 16.768-32 37.44 0 20.672 14.336 37.44 32 37.44H256z m416 426.56c-123.52 0-224-100.48-224-224s100.48-224 224-224 224 100.48 224 224-100.48 224-224 224z m-32-64a32 32 0 0 0 32-32v-132.928l76.16-65.28a32 32 0 0 0-41.728-48.64L619.136 197.12a32 32 0 0 0-11.136 24.32V368.89599999999996a32 32 0 0 0 32 32zM288 294.4c17.664 0 32-16.768 32-37.44 0-20.672-14.336-37.44-32-37.44h-192c-17.664 0-32 16.768-32 37.44 0 20.672 14.336 37.44 32 37.44h192z m160 256c17.664 0 32-16.768 32-37.44 0-20.672-14.336-37.44-32-37.44H96c-17.664 0-32 16.768-32 37.44 0 20.672 14.336 37.44 32 37.44H448z m352 256c17.664 0 32-16.768 32-37.44 0-20.672-14.336-37.44-32-37.44h-704c-17.664 0-32 16.768-32 37.44 0 20.672 14.336 37.44 32 37.44h704z" horiz-adv-x="1024" />
<glyph glyph-name="zimu" unicode="&#59186;" d="M207.616 795.328h64.768L416 458.368h-61.12L320 545.28H159.552l-34.944-86.848H64l143.616 336.96z m-30.784-207.616h125.824l-61.632 152.448h-2.048l-62.144-152.448zM94.656 330.88h290.432v-43.008l-229.12-263.936h242.304v-46.016h-320v42.56l229.76 264.448H94.592V330.88zM511.872 800h448a32 32 0 1 0 0-64h-448a32 32 0 0 0 0 64z m0-256h320a32 32 0 1 0 0-64h-320a32 32 0 0 0 0 64z m0-256h192a32 32 0 1 0 0-64h-192a32 32 0 1 0 0 64z m0-256h128a32 32 0 1 0 0-64h-128a32 32 0 1 0 0 64z" horiz-adv-x="1024" /> <glyph glyph-name="zimu" unicode="&#59186;" d="M256 38.39999999999998c17.664 0 32-16.768 32-37.44 0-20.672-14.336-37.44-32-37.44H96c-17.664 0-32 16.768-32 37.44 0 20.672 14.336 37.44 32 37.44H256z m458.24 462.528a32 32 0 0 0 29.44-19.456l197.568-463.424a31.552 31.552 0 0 0-28.992-43.968h-26.24a32 32 0 0 0-29.632 20.032l-38.592 95.68a32 32 0 0 1-29.632 20.032H580.672a32 32 0 0 1-29.696-20.032l-38.592-95.68a32 32 0 0 0-29.632-20.032H456.96a31.296 31.296 0 0 0-28.8 43.52l197.76 463.872a32 32 0 0 0 29.44 19.456h58.88z m-27.776-86.336h-3.328l-97.152-238.336h196.8l-96.32 238.336zM288 294.4c17.664 0 32-16.768 32-37.44 0-20.672-14.336-37.44-32-37.44h-192c-17.664 0-32 16.768-32 37.44 0 20.672 14.336 37.44 32 37.44h192z m160 256c17.664 0 32-16.768 32-37.44 0-20.672-14.336-37.44-32-37.44H96c-17.664 0-32 16.768-32 37.44 0 20.672 14.336 37.44 32 37.44H448z m352 256c17.664 0 32-16.768 32-37.44 0-20.672-14.336-37.44-32-37.44h-704c-17.664 0-32 16.768-32 37.44 0 20.672 14.336 37.44 32 37.44h704z" horiz-adv-x="1024" />
<glyph glyph-name="normal92" unicode="&#59187;" d="M704 768h192a64 64 0 0 0 64-64v-704a64 64 0 0 0-64-64H128a64 64 0 0 0-64 64V704a64 64 0 0 0 64 64h192v32a32 32 0 0 0 64 0V768h256v32a32 32 0 1 0 64 0V768z m0-64v-32a32 32 0 1 0-64 0V704H384v-32a32 32 0 0 0-64 0V704H128v-704h768V704h-192zM256 384h128v-128H256V384z m0-192h128v-128H256v128z m192 192h128v-128H448V384z m0 192h128v-128H448V576z m0-384h128v-128H448v128z m192 192h128v-128h-128V384z m0 192h128v-128h-128V576z" horiz-adv-x="1024" /> <glyph glyph-name="normal92" unicode="&#59187;" d="M704 768h192a64 64 0 0 0 64-64v-704a64 64 0 0 0-64-64H128a64 64 0 0 0-64 64V704a64 64 0 0 0 64 64h192v32a32 32 0 0 0 64 0V768h256v32a32 32 0 1 0 64 0V768z m0-64v-32a32 32 0 1 0-64 0V704H384v-32a32 32 0 0 0-64 0V704H128v-704h768V704h-192zM256 384h128v-128H256V384z m0-192h128v-128H256v128z m192 192h128v-128H448V384z m0 192h128v-128H448V576z m0-384h128v-128H448v128z m192 192h128v-128h-128V384z m0 192h128v-128h-128V576z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 414 KiB

After

Width:  |  Height:  |  Size: 416 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
dist/lib/base/tree/customtree.d.ts vendored

@ -4,7 +4,7 @@ export declare class CustomTree extends Widget {
static EVENT_CHANGE: string; static EVENT_CHANGE: string;
initTree(nodes: any, ...args: any[]): void; initTree(nodes: any, ...args: any[]): void;
stroke(...args: any[]): void; stroke(...args: any[]): void;
populate(nodes: any, ...args: any[]): void; populate(nodes?: any, ...args: any[]): void;
getAllButtons<T>(): T[]; getAllButtons<T>(): T[];
getAllLeaves<T>(): T[]; getAllLeaves<T>(): T[];
getNodeById(id: any): any; getNodeById(id: any): any;

2
dist/resource.css vendored

File diff suppressed because one or more lines are too long

2
dist/utils.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-8-12 21:32:20 */ /*! time: 2021-8-19 23:30:26 */
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

2
package.json

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

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

@ -120,67 +120,72 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, {
lgap: 10, lgap: 10,
}] }]
}, { }, {
type: "bi.vertical_adapt", el: {
rgap: 5, type: "bi.vertical_adapt",
items: [{ columnSize: [16, 10, 'fill', 12, c.RGB_WIDTH, 12, c.RGB_WIDTH, 12, c.RGB_WIDTH],
el: {
type: "bi.layout", rgap: 5,
cls: "color-picker-editor-display bi-card bi-border", items: [{
height: 16, el: {
width: 16, type: "bi.layout",
ref: function (_ref) { cls: "color-picker-editor-display bi-card bi-border",
self.colorShow = _ref; height: 16,
} width: 16,
}, ref: function (_ref) {
width: 16 self.colorShow = _ref;
}, {
type: "bi.label",
text: "#",
width: 10
}, {
type: "bi.small_text_editor",
ref: function (_ref) {
self.hexEditor = _ref;
},
cls: "color-picker-editor-input",
validationChecker: this._hexChecker,
allowBlank: true,
errorText: BI.i18nText("BI-Color_Picker_Error_Text_Hex"),
width: c.HEX_WIDTH,
height: 20,
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
self._checkHexEditor();
if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) {
self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
} }
},
width: 16
}, {
type: "bi.label",
text: "#",
width: 10
}, {
type: "bi.small_text_editor",
ref: function (_ref) {
self.hexEditor = _ref;
},
cls: "color-picker-editor-input",
validationChecker: this._hexChecker,
allowBlank: true,
errorText: BI.i18nText("BI-Color_Picker_Error_Text_Hex"),
width: c.HEX_WIDTH,
height: 20,
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
self._checkHexEditor();
if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) {
self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
} }
}]
}, RGB[0], {
el: BI.extend(Ws[0], {
ref: function (_ref) {
self.R = _ref
}
}),
width: c.RGB_WIDTH
}, RGB[1], {
el: BI.extend(Ws[1], {
ref: function (_ref) {
self.G = _ref
}
}),
width: c.RGB_WIDTH
}, RGB[2], {
el: BI.extend(Ws[2], {
ref: function (_ref) {
self.B = _ref
}
}),
rgap: -5,
width: c.RGB_WIDTH
}] }]
}, RGB[0], { }
el: BI.extend(Ws[0], {
ref: function (_ref) {
self.R = _ref
}
}),
width: c.RGB_WIDTH
}, RGB[1], {
el: BI.extend(Ws[1], {
ref: function (_ref) {
self.G = _ref
}
}),
width: c.RGB_WIDTH
}, RGB[2], {
el: BI.extend(Ws[2], {
ref: function (_ref) {
self.B = _ref
}
}),
width: c.RGB_WIDTH
}]
}] }]
}, },
left: 0, left: 0,

103
src/core/wrapper/layout.js

@ -198,6 +198,21 @@ BI.Layout = BI.inherit(BI.Widget, {
return this.element; return this.element;
}, },
// 不依赖于this.options.items进行更新
_updateItemAt: function (oldIndex, newIndex, item) {
var del = this._children[this._getChildName(oldIndex)];
delete this._children[this._getChildName(oldIndex)];
var w = this._addElement(newIndex, item);
this._children[this._getChildName(newIndex)] = w;
if (oldIndex > 0) {
this._children[this._getChildName(oldIndex - 1)].element.after(w.element);
} else {
w.element.prependTo(this._getWrapper());
}
del._destroy();
w._mount();
},
_addItemAt: function (index, item) { _addItemAt: function (index, item) {
for (var i = this.options.items.length; i > index; i--) { for (var i = this.options.items.length; i > index; i--) {
this._children[this._getChildName(i)] = this._children[this._getChildName(i - 1)]; this._children[this._getChildName(i)] = this._children[this._getChildName(i - 1)];
@ -286,35 +301,13 @@ BI.Layout = BI.inherit(BI.Widget, {
}, },
shouldUpdateItem: function (index, item) { shouldUpdateItem: function (index, item) {
if (index < 0 || index > this.options.items.length - 1) {
return false;
}
var child = this._children[this._getChildName(index)]; var child = this._children[this._getChildName(index)];
if (!child.shouldUpdate) { if (!child || !child.shouldUpdate) {
return null; return null;
} }
return child.shouldUpdate(this._getOptions(item)); return child.shouldUpdate(this._getOptions(item));
}, },
updateItemAt: function (index, item) {
if (index < 0 || index > this.options.items.length - 1) {
return;
}
var del = this._children[this._getChildName(index)];
delete this._children[this._getChildName(index)];
this.options.items.splice(index, 1);
var w = this._addElement(index, item);
this.options.items.splice(index, 0, item);
this._children[this._getChildName(index)] = w;
if (index > 0) {
this._children[this._getChildName(index - 1)].element.after(w.element);
} else {
w.element.prependTo(this._getWrapper());
}
del._destroy();
w._mount();
},
addItems: function (items, context) { addItems: function (items, context) {
var self = this, o = this.options; var self = this, o = this.options;
var fragment = BI.Widget._renderEngine.createFragment(); var fragment = BI.Widget._renderEngine.createFragment();
@ -384,9 +377,9 @@ BI.Layout = BI.inherit(BI.Widget, {
}); });
}, },
patchItem: function (oldVnode, vnode, index) { patchItem: function (oldVnode, vnode, oldIndex, newIndex) {
var shouldUpdate = this.shouldUpdateItem(index, vnode); var shouldUpdate = this.shouldUpdateItem(oldIndex, vnode);
var child = this._children[this._getChildName(index)]; var child = this._children[this._getChildName(oldIndex)];
if (shouldUpdate) { if (shouldUpdate) {
return child._update(this._getOptions(vnode), shouldUpdate); return child._update(this._getOptions(vnode), shouldUpdate);
} }
@ -394,7 +387,7 @@ BI.Layout = BI.inherit(BI.Widget, {
// if (child.update) { // if (child.update) {
// return child.update(this._getOptions(vnode)); // return child.update(this._getOptions(vnode));
// } // }
return this.updateItemAt(index, vnode); return this._updateItemAt(oldIndex, newIndex, vnode);
} }
}, },
@ -424,23 +417,23 @@ BI.Layout = BI.inherit(BI.Widget, {
} else if (BI.isNull(oldEndVnode)) { } else if (BI.isNull(oldEndVnode)) {
oldEndVnode = oldCh[--oldEndIdx]; oldEndVnode = oldCh[--oldEndIdx];
} else if (sameVnode(oldStartVnode, newStartVnode, oldStartIdx, newStartIdx)) { } else if (sameVnode(oldStartVnode, newStartVnode, oldStartIdx, newStartIdx)) {
updated = this.patchItem(oldStartVnode, newStartVnode, oldStartIdx) || updated; updated = this.patchItem(oldStartVnode, newStartVnode, oldStartIdx, newStartIdx) || updated;
children[oldStartVnode.key == null ? oldStartIdx : oldStartVnode.key] = this._children[this._getChildName(oldStartIdx)]; children[oldStartVnode.key == null ? oldStartIdx : oldStartVnode.key] = this._children[this._getChildName(oldStartIdx)];
oldStartVnode = oldCh[++oldStartIdx]; oldStartVnode = oldCh[++oldStartIdx];
newStartVnode = newCh[++newStartIdx]; newStartVnode = newCh[++newStartIdx];
} else if (sameVnode(oldEndVnode, newEndVnode, oldEndIdx, newEndIdx)) { } else if (sameVnode(oldEndVnode, newEndVnode, oldEndIdx, newEndIdx)) {
updated = this.patchItem(oldEndVnode, newEndVnode, oldEndIdx) || updated; updated = this.patchItem(oldEndVnode, newEndVnode, oldEndIdx, newEndIdx) || updated;
children[oldEndVnode.key == null ? oldEndIdx : oldEndVnode.key] = this._children[this._getChildName(oldEndIdx)]; children[oldEndVnode.key == null ? oldEndIdx : oldEndVnode.key] = this._children[this._getChildName(oldEndIdx)];
oldEndVnode = oldCh[--oldEndIdx]; oldEndVnode = oldCh[--oldEndIdx];
newEndVnode = newCh[--newEndIdx]; newEndVnode = newCh[--newEndIdx];
} else if (sameVnode(oldStartVnode, newEndVnode)) { } else if (sameVnode(oldStartVnode, newEndVnode)) {
updated = this.patchItem(oldStartVnode, newEndVnode, oldStartIdx) || updated; updated = this.patchItem(oldStartVnode, newEndVnode, oldStartIdx, newStartIdx) || updated;
children[oldStartVnode.key == null ? oldStartIdx : oldStartVnode.key] = this._children[this._getChildName(oldStartIdx)]; children[oldStartVnode.key == null ? oldStartIdx : oldStartVnode.key] = this._children[this._getChildName(oldStartIdx)];
insertBefore(oldStartVnode, oldEndVnode, true); insertBefore(oldStartVnode, oldEndVnode, true);
oldStartVnode = oldCh[++oldStartIdx]; oldStartVnode = oldCh[++oldStartIdx];
newEndVnode = newCh[--newEndIdx]; newEndVnode = newCh[--newEndIdx];
} else if (sameVnode(oldEndVnode, newStartVnode)) { } else if (sameVnode(oldEndVnode, newStartVnode)) {
updated = this.patchItem(oldEndVnode, newStartVnode, oldEndIdx) || updated; updated = this.patchItem(oldEndVnode, newStartVnode, oldEndIdx, newEndIdx) || updated;
children[oldEndVnode.key == null ? oldEndIdx : oldEndVnode.key] = this._children[this._getChildName(oldEndIdx)]; children[oldEndVnode.key == null ? oldEndIdx : oldEndVnode.key] = this._children[this._getChildName(oldEndIdx)];
insertBefore(oldEndVnode, oldStartVnode); insertBefore(oldEndVnode, oldStartVnode);
oldEndVnode = oldCh[--oldEndIdx]; oldEndVnode = oldCh[--oldEndIdx];
@ -448,13 +441,13 @@ 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)) { // 不存在就把新的放到左边 if (BI.isNull(sameOldVnode)) { // 不存在就把新的放到左边
var node = addNode(newStartVnode); var node = addNode(newStartVnode, newStartIdx);
insertBefore(node, oldStartVnode); insertBefore(node, oldStartVnode);
newStartVnode = newCh[++newStartIdx]; newStartVnode = newCh[++newStartIdx];
} else { // 如果新节点在就旧节点区间中存在就复用一下 } else { // 如果新节点在就旧节点区间中存在就复用一下
BI.each(oldCh, function (index, child) { BI.each(oldCh, function (index, child) {
if (child && sameVnode(child, newStartVnode)) { if (child && sameVnode(child, newStartVnode)) {
updated = self.patchItem(sameOldVnode, newStartVnode, index) || updated; updated = self.patchItem(sameOldVnode, newStartVnode, index, index) || updated;
children[sameOldVnode.key == null ? index : sameOldVnode.key] = self._children[self._getChildName(index)]; children[sameOldVnode.key == null ? index : sameOldVnode.key] = self._children[self._getChildName(index)];
oldCh[index] = undefined; oldCh[index] = undefined;
insertBefore(sameOldVnode, oldStartVnode); insertBefore(sameOldVnode, oldStartVnode);
@ -493,7 +486,7 @@ BI.Layout = BI.inherit(BI.Widget, {
function addNode (vnode, index) { function addNode (vnode, index) {
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._addElement(key, vnode); return children[key] = self._addElement(index, vnode);
} }
function addVnodes (before, vnodes, startIdx, endIdx) { function addVnodes (before, vnodes, startIdx, endIdx) {
@ -509,7 +502,7 @@ BI.Layout = BI.inherit(BI.Widget, {
if (BI.isNotNull(ch)) { if (BI.isNotNull(ch)) {
var node = self._getOptions(ch); var node = self._getOptions(ch);
var key = node.key == null ? startIdx : node.key; var key = node.key == null ? startIdx : node.key;
delete self._children[self._getChildName(key)]; delete self._children[self._getChildName(startIdx)];
children[key]._destroy(); children[key]._destroy();
} }
} }
@ -550,34 +543,23 @@ BI.Layout = BI.inherit(BI.Widget, {
return updated; return updated;
}, },
forceUpdate: function (opt) {
if (this._isMounted) {
BI.each(this._children, function (i, c) {
c.destroy();
});
this._children = {};
}
this.options.items = opt.items;
this.stroke(opt.items);
},
update: function (opt) { update: function (opt) {
var o = this.options; var o = this.options;
var items = opt.items || []; var items = opt.items || [];
var updated = this.updateChildren(o.items, items); var oldItems = o.items;
this.options.items = items; this.options.items = items;
return updated; return this.updateChildren(oldItems, items);
// var updated, i, len;
// for (i = 0, len = Math.min(o.items.length, items.length); i < len; i++) {
// if (!this._compare(o.items[i], items[i])) {
// updated = this.updateItemAt(i, items[i]) || updated;
// }
// }
// if (o.items.length > items.length) {
// var deleted = [];
// for (i = items.length; i < o.items.length; i++) {
// deleted.push(this._children[this._getChildName(i)]);
// delete this._children[this._getChildName(i)];
// }
// o.items.splice(items.length);
// BI.each(deleted, function (i, w) {
// w._destroy();
// })
// } else if (items.length > o.items.length) {
// for (i = o.items.length; i < items.length; i++) {
// this.addItemAt(i, items[i]);
// }
// }
// return updated;
}, },
stroke: function (items) { stroke: function (items) {
@ -616,7 +598,6 @@ BI.Layout = BI.inherit(BI.Widget, {
}, },
populate: function (items) { populate: function (items) {
var self = this, o = this.options;
items = items || []; items = items || [];
if (this._isMounted) { if (this._isMounted) {
this.update({items: items}); this.update({items: items});
@ -627,7 +608,7 @@ BI.Layout = BI.inherit(BI.Widget, {
}, },
resize: function () { resize: function () {
this.stroke(this.options.items);
} }
}); });
BI.shortcut("bi.layout", BI.Layout); BI.shortcut("bi.layout", BI.Layout);

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

@ -35,10 +35,6 @@ BI.AbsoluteCenterLayout = BI.inherit(BI.Layout, {
return w; return w;
}, },
resize: function () {
// console.log("absolute_center_adapt布局不需要resize");
},
populate: function (items) { populate: function (items) {
BI.AbsoluteCenterLayout.superclass.populate.apply(this, arguments); BI.AbsoluteCenterLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();

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

@ -42,7 +42,7 @@ BI.AbsoluteHorizontalLayout = BI.inherit(BI.Layout, {
}, },
resize: function () { resize: function () {
// console.log("absolute_horizontal_adapt布局不需要resize"); this.layout.resize();
}, },
populate: function (items) { populate: function (items) {

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

@ -80,7 +80,7 @@ BI.AbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
resize: function () { resize: function () {
// console.log("absolute_left_right_vertical_adapt布局不需要resize"); this.layout.stroke(this._formatItems())
}, },
addItem: function () { addItem: function () {
@ -132,7 +132,7 @@ BI.AbsoluteRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
resize: function () { resize: function () {
this.layout.stroke([{}].concat(this.options.items))
}, },
addItem: function () { addItem: function () {
@ -141,7 +141,7 @@ BI.AbsoluteRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
this.layout.populate(items); this.layout.populate([{}].concat(items));
} }
}); });
BI.shortcut("bi.absolute_right_vertical_adapt", BI.AbsoluteRightVerticalAdaptLayout); BI.shortcut("bi.absolute_right_vertical_adapt", BI.AbsoluteRightVerticalAdaptLayout);

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

@ -42,7 +42,7 @@ BI.AbsoluteVerticalLayout = BI.inherit(BI.Layout, {
}, },
resize: function () { resize: function () {
// console.log("absolute_vertical_adapt布局不需要resize"); this.layout.resize();
}, },
populate: function (items) { populate: function (items) {

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

@ -43,7 +43,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
}, },
resize: function () { resize: function () {
// console.log("center_adapt布局不需要resize"); this.layout.resize();
}, },
populate: function (items) { populate: function (items) {

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

@ -76,7 +76,8 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
resize: function () { resize: function () {
// console.log("left_right_vertical_adapt布局不需要resize"); this.left.stroke(this.options.items.left);
this.right.stroke(this.options.items.right);
}, },
addItem: function () { addItem: function () {
@ -129,7 +130,7 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
resize: function () { resize: function () {
// console.log("left_vertical_adapt布局不需要resize"); this.layout.resize();
}, },
addItem: function () { addItem: function () {
@ -181,7 +182,7 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
resize: function () { resize: function () {
this.layout.resize();
}, },
addItem: function () { addItem: function () {

30
src/core/wrapper/layout/adapt/adapt.table.js

@ -24,13 +24,25 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
this.$table = BI.Widget._renderEngine.createElement("<div>").css({ this.$table = BI.Widget._renderEngine.createElement("<div>").css({
position: "relative", position: "relative",
display: "table", display: "table",
width: (o.horizontalAlign === BI.HorizontalAlign.Center || o.horizontalAlign === BI.HorizontalAlign.Stretch) ? "100%" : "auto", width: (o.horizontalAlign === BI.HorizontalAlign.Center || o.horizontalAlign === BI.HorizontalAlign.Stretch || this._hasFill()) ? "100%" : "auto",
height: (o.verticalAlign !== BI.VerticalAlign.Top) ? "100%" : "auto", height: (o.verticalAlign !== BI.VerticalAlign.Top) ? "100%" : "auto",
"white-space": "nowrap" "white-space": "nowrap"
}); });
this.populate(this.options.items); this.populate(this.options.items);
}, },
_hasFill: function () {
var o = this.options;
if (o.columnSize.length > 0) {
return o.columnSize.indexOf("fill") >= 0;
}
return BI.some(o.items, function (i, item) {
if (item.width === "fill") {
return true;
}
});
},
_addElement: function (i, item) { _addElement: function (i, item) {
var o = this.options; var o = this.options;
var td, width = ""; var td, width = "";
@ -40,17 +52,7 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
((columnSize * 100).toFixed(1) + "%") ((columnSize * 100).toFixed(1) + "%")
: (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); : (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap);
} }
function hasFill() { if ((BI.isNull(columnSize) || columnSize === "") && this._hasFill()) {
if (o.columnSize.length > 0) {
return o.columnSize.indexOf("fill") >= 0;
}
return BI.some(o.items, function (i, item) {
if (item.width === "fill") {
return true;
}
});
}
if ((BI.isNull(columnSize) || columnSize === "") && hasFill()) {
width = 2; width = 2;
} }
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
@ -100,10 +102,6 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
this.element.append(this.$table); this.element.append(this.$table);
}, },
resize: function () {
// console.log("center_adapt布局不需要resize");
},
populate: function (items) { populate: function (items) {
BI.TableAdaptLayout.superclass.populate.apply(this, arguments); BI.TableAdaptLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();

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

@ -43,7 +43,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
resize: function () { resize: function () {
// console.log("vertical_adapt布局不需要resize"); this.layout.resize();
}, },
populate: function (items) { populate: function (items) {

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

@ -32,10 +32,6 @@ BI.HorizontalAutoLayout = BI.inherit(BI.Layout, {
return w; return w;
}, },
resize: function () {
// console.log("horizontal_adapt布局不需要resize");
},
populate: function (items) { populate: function (items) {
BI.HorizontalAutoLayout.superclass.populate.apply(this, arguments); BI.HorizontalAutoLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();

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

@ -44,6 +44,10 @@ BI.InlineCenterAdaptLayout = BI.inherit(BI.Layout, {
}; };
}, },
resize: function () {
this.layout.resize();
},
populate: function (items) { populate: function (items) {
this.layout.populate.apply(this.layout, arguments); this.layout.populate.apply(this.layout, arguments);
} }

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

@ -44,6 +44,10 @@ BI.InlineHorizontalAdaptLayout = BI.inherit(BI.Layout, {
}; };
}, },
resize: function () {
this.layout.resize();
},
populate: function (items) { populate: function (items) {
this.layout.populate.apply(this.layout, arguments); this.layout.populate.apply(this.layout, arguments);
} }

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

@ -44,6 +44,10 @@ BI.InlineVerticalAdaptLayout = BI.inherit(BI.Layout, {
}; };
}, },
resize: function () {
this.layout.resize();
},
populate: function (items) { populate: function (items) {
this.layout.populate.apply(this.layout, arguments); this.layout.populate.apply(this.layout, arguments);
} }

17
src/core/wrapper/layout/fill/float.fill.horizontal.js

@ -19,9 +19,6 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, {
this.populate(this.options.items); this.populate(this.options.items);
}, },
resize: function () {
// console.log("填充布局不需要resize");
},
addItem: function (item) { addItem: function (item) {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("不能添加子组件");
@ -79,8 +76,12 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, {
} }
var top = o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0), var top = o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0),
bottom = o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0); bottom = o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0);
if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) {
w.element.css({
height: "calc(100% - " + ((top + bottom) / BI.pixRatio + BI.pixUnit) + ")"
});
}
w.element.css({ w.element.css({
height: "calc(100% - " + ((top + bottom) / BI.pixRatio + BI.pixUnit) + ")",
position: "relative" position: "relative"
}); });
return w; return w;
@ -123,6 +124,14 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, {
}); });
}, },
resize: function () {
// console.log("填充布局不需要resize");
},
update: function (opt) {
return this.forceUpdate(opt);
},
populate: function (items) { populate: function (items) {
BI.FloatHorizontalFillLayout.superclass.populate.apply(this, arguments); BI.FloatHorizontalFillLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();

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

@ -24,7 +24,7 @@ BI.FlexCenterLayout = BI.inherit(BI.Layout, {
return { return {
type: "bi.flex_horizontal", type: "bi.flex_horizontal",
ref: function (_ref) { ref: function (_ref) {
self.wrapper = _ref; self.layout = _ref;
}, },
horizontalAlign: o.horizontalAlign, horizontalAlign: o.horizontalAlign,
verticalAlign: o.verticalAlign, verticalAlign: o.verticalAlign,
@ -42,15 +42,11 @@ BI.FlexCenterLayout = BI.inherit(BI.Layout, {
}, },
resize: function () { resize: function () {
// console.log("flex_center_adapt布局不需要resize"); this.layout.resize();
},
update: function (opt) {
return this.wrapper.update(opt);
}, },
populate: function (items) { populate: function (items) {
this.wrapper.populate(items); this.layout.populate(items);
} }
}); });
BI.shortcut("bi.flex_center_adapt", BI.FlexCenterLayout); BI.shortcut("bi.flex_center_adapt", BI.FlexCenterLayout);

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

@ -25,7 +25,7 @@ BI.FlexHorizontalCenter = BI.inherit(BI.Layout, {
return { return {
type: "bi.flex_vertical", type: "bi.flex_vertical",
ref: function (_ref) { ref: function (_ref) {
self.wrapper = _ref; self.layout = _ref;
}, },
horizontalAlign: o.horizontalAlign, horizontalAlign: o.horizontalAlign,
verticalAlign: o.verticalAlign, verticalAlign: o.verticalAlign,
@ -43,15 +43,11 @@ BI.FlexHorizontalCenter = BI.inherit(BI.Layout, {
}, },
resize: function () { resize: function () {
// console.log("flex_vertical_center_adapt布局不需要resize"); this.layout.resize();
},
update: function (opt) {
return this.wrapper.update(opt);
}, },
populate: function (items) { populate: function (items) {
this.wrapper.populate(items); this.layout.populate(items);
} }
}); });
BI.shortcut("bi.flex_horizontal_adapt", BI.FlexHorizontalCenter); BI.shortcut("bi.flex_horizontal_adapt", BI.FlexHorizontalCenter);

4
src/core/wrapper/layout/flex/flex.horizontal.js

@ -78,10 +78,6 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
return w; return w;
}, },
resize: function () {
// console.log("flex_horizontal布局不需要resize");
},
populate: function (items) { populate: function (items) {
BI.FlexHorizontalLayout.superclass.populate.apply(this, arguments); BI.FlexHorizontalLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();

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

@ -25,17 +25,17 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
ref: function (_ref) { ref: function (_ref) {
self.layout = _ref; self.layout = _ref;
}, },
items: this._formatItems(), items: this._formatItems(o.items),
scrollx: o.scrollx, scrollx: o.scrollx,
scrolly: o.scrolly, scrolly: o.scrolly,
scrollable: o.scrollable scrollable: o.scrollable
}; };
}, },
_formatItems: function () { _formatItems: function (items) {
var o = this.options; var o = this.options;
var leftItems = o.items.left || []; var leftItems = items.left || [];
var rightItems = o.items.right || []; var rightItems = items.right || [];
leftItems = BI.map(leftItems, function (i, item) { leftItems = BI.map(leftItems, function (i, item) {
var json = { var json = {
el: BI.stripEL(item) el: BI.stripEL(item)
@ -72,7 +72,7 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
resize: function () { resize: function () {
// console.log("left_right_vertical_adapt布局不需要resize"); this.layout.stroke(this._formatItems(this.options.items));
}, },
addItem: function () { addItem: function () {
@ -81,8 +81,7 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
this.options.items = items; this.layout.populate(this._formatItems(items));
this.layout.populate(this._formatItems());
} }
}); });
BI.shortcut("bi.flex_left_right_vertical_adapt", BI.FlexLeftRightVerticalAdaptLayout); BI.shortcut("bi.flex_left_right_vertical_adapt", BI.FlexLeftRightVerticalAdaptLayout);

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

@ -26,7 +26,7 @@ BI.FlexVerticalCenter = BI.inherit(BI.Layout, {
return { return {
type: "bi.flex_horizontal", type: "bi.flex_horizontal",
ref: function (_ref) { ref: function (_ref) {
self.wrapper = _ref; self.layout = _ref;
}, },
verticalAlign: o.verticalAlign, verticalAlign: o.verticalAlign,
horizontalAlign: o.horizontalAlign, horizontalAlign: o.horizontalAlign,
@ -44,15 +44,11 @@ BI.FlexVerticalCenter = BI.inherit(BI.Layout, {
}, },
resize: function () { resize: function () {
// console.log("flex_vertical_center_adapt布局不需要resize"); this.layout.resize();
},
update: function (opt) {
return this.wrapper.update(opt);
}, },
populate: function (items) { populate: function (items) {
this.wrapper.populate(items); this.layout.populate(items);
} }
}); });
BI.shortcut("bi.flex_vertical_adapt", BI.FlexVerticalCenter); BI.shortcut("bi.flex_vertical_adapt", BI.FlexVerticalCenter);

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

@ -77,10 +77,6 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, {
return w; return w;
}, },
resize: function () {
// console.log("flex_vertical布局不需要resize");
},
populate: function (items) { populate: function (items) {
BI.FlexVerticalLayout.superclass.populate.apply(this, arguments); BI.FlexVerticalLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();

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

@ -27,7 +27,7 @@ BI.FlexWrapperCenterLayout = BI.inherit(BI.Layout, {
return { return {
type: "bi.flex_scrollable_horizontal", type: "bi.flex_scrollable_horizontal",
ref: function (_ref) { ref: function (_ref) {
self.wrapper = _ref; self.layout = _ref;
}, },
horizontalAlign: o.horizontalAlign, horizontalAlign: o.horizontalAlign,
verticalAlign: o.verticalAlign, verticalAlign: o.verticalAlign,
@ -44,12 +44,12 @@ BI.FlexWrapperCenterLayout = BI.inherit(BI.Layout, {
}; };
}, },
update: function (opt) { resize: function () {
return this.wrapper.update(opt); this.layout.resize();
}, },
populate: function (items) { populate: function (items) {
this.wrapper.populate(items); this.layout.populate(items);
} }
}); });
BI.shortcut("bi.flex_scrollable_center_adapt", BI.FlexWrapperCenterLayout); BI.shortcut("bi.flex_scrollable_center_adapt", BI.FlexWrapperCenterLayout);

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

@ -27,7 +27,7 @@ BI.FlexWrapperHorizontalCenter = BI.inherit(BI.Layout, {
return { return {
type: "bi.flex_scrollable_vertical", type: "bi.flex_scrollable_vertical",
ref: function (_ref) { ref: function (_ref) {
self.wrapper = _ref; self.layout = _ref;
}, },
horizontalAlign: o.horizontalAlign, horizontalAlign: o.horizontalAlign,
verticalAlign: o.verticalAlign, verticalAlign: o.verticalAlign,
@ -44,12 +44,12 @@ BI.FlexWrapperHorizontalCenter = BI.inherit(BI.Layout, {
}; };
}, },
update: function (opt) { resize: function () {
return this.wrapper.update(opt); this.layout.resize();
}, },
populate: function (items) { populate: function (items) {
this.wrapper.populate(items); this.layout.populate(items);
} }
}); });
BI.shortcut("bi.flex_scrollable_horizontal_adapt", BI.FlexWrapperHorizontalCenter); BI.shortcut("bi.flex_scrollable_horizontal_adapt", BI.FlexWrapperHorizontalCenter);

4
src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js

@ -84,10 +84,6 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, {
return this.$wrapper; return this.$wrapper;
}, },
resize: function () {
// console.log("flex_wrapper_horizontal布局不需要resize");
},
populate: function (items) { populate: function (items) {
BI.FlexWrapperHorizontalLayout.superclass.populate.apply(this, arguments); BI.FlexWrapperHorizontalLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();

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

@ -27,7 +27,7 @@ BI.FlexWrapperVerticalCenter = BI.inherit(BI.Layout, {
return { return {
type: "bi.flex_scrollable_horizontal", type: "bi.flex_scrollable_horizontal",
ref: function (_ref) { ref: function (_ref) {
self.wrapper = _ref; self.layout = _ref;
}, },
verticalAlign: o.verticalAlign, verticalAlign: o.verticalAlign,
horizontalAlign: o.horizontalAlign, horizontalAlign: o.horizontalAlign,
@ -44,12 +44,12 @@ BI.FlexWrapperVerticalCenter = BI.inherit(BI.Layout, {
}; };
}, },
update: function (opt) { resize: function () {
return this.wrapper.update(opt); this.layout.resize();
}, },
populate: function (items) { populate: function (items) {
this.wrapper.populate(items); this.layout.populate(items);
} }
}); });
BI.shortcut("bi.flex_scrollable_vertical_adapt", BI.FlexWrapperVerticalCenter); BI.shortcut("bi.flex_scrollable_vertical_adapt", BI.FlexWrapperVerticalCenter);

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

@ -84,10 +84,6 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, {
return this.$wrapper; return this.$wrapper;
}, },
resize: function () {
// console.log("flex_wrapper_vertical布局不需要resize");
},
populate: function (items) { populate: function (items) {
BI.FlexWrapperVerticalLayout.superclass.populate.apply(this, arguments); BI.FlexWrapperVerticalLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();

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

@ -24,10 +24,6 @@ BI.FloatAbsoluteCenterLayout = BI.inherit(BI.Layout, {
return w; return w;
}, },
resize: function () {
// console.log("float_absolute_center_adapt布局不需要resize");
},
populate: function (items) { populate: function (items) {
BI.FloatAbsoluteCenterLayout.superclass.populate.apply(this, arguments); BI.FloatAbsoluteCenterLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();

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

@ -31,37 +31,40 @@ BI.FloatAbsoluteHorizontalLayout = BI.inherit(BI.Layout, {
}, },
hgap: "50%", hgap: "50%",
vgap: o.vgap, vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap, tgap: o.tgap,
bgap: o.bgap bgap: o.bgap,
// lgap和rgap不传的话内部不会设置left和right
lgap: o.lgap,
rgap: o.rgap
}; };
}, },
_formatItems: function (items) { _formatItems: function (items) {
if (this.options.horizontalAlign !== BI.HorizontalAlign.Center) { var o = this.options;
if (o.horizontalAlign === BI.HorizontalAlign.Left) {
return items; return items;
} }
var cls = o.horizontalAlign === BI.HorizontalAlign.Right ? "bi-abs-r-x-item" : "bi-abs-c-x-item";
return BI.map(items, function (i, item) { return BI.map(items, function (i, item) {
if (!item || BI.isEmptyObject(item)) { if (!item || BI.isEmptyObject(item)) {
return item; return item;
} }
var el = BI.stripEL(item); var el = BI.stripEL(item);
if (BI.isWidget(el)) { if (BI.isWidget(el)) {
el.element.addClass("bi-abs-c-x-item"); el.element.addClass(cls);
} else { } else {
el.cls = (el.cls || "") + "bi-abs-c-x-item"; el.cls = (el.cls || "") + cls;
} }
return item; return item;
}); });
}, },
resize: function () { resize: function () {
// console.log("float_absolute_horizontal_adapt布局不需要resize"); this.layout.stroke(this._formatItems(this.options.items));
}, },
populate: function (items) { populate: function (items) {
this.layout.populate.apply(this, arguments); this.layout.populate(this._formatItems(items));
} }
}); });
BI.shortcut("bi.absolute_horizontal_float", BI.FloatAbsoluteHorizontalLayout); BI.shortcut("bi.absolute_horizontal_float", BI.FloatAbsoluteHorizontalLayout);

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

@ -27,7 +27,7 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
self.layout = _ref; self.layout = _ref;
}, },
verticalAlign: o.verticalAlign, verticalAlign: o.verticalAlign,
items: this._formatItems(), items: this._formatItems(o.items),
vgap: "50%", vgap: "50%",
scrollx: o.scrollx, scrollx: o.scrollx,
scrolly: o.scrolly, scrolly: o.scrolly,
@ -35,10 +35,10 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}; };
}, },
_formatItems: function () { _formatItems: function (items) {
var o = this.options; var o = this.options;
var leftItems = o.items.left || []; var leftItems = items.left || [];
var rightItems = o.items.right || []; var rightItems = items.right || [];
leftItems = BI.map(leftItems, function (i, item) { leftItems = BI.map(leftItems, function (i, item) {
var el = BI.stripEL(item); var el = BI.stripEL(item);
if (o.verticalAlign === BI.VerticalAlign.Middle) { if (o.verticalAlign === BI.VerticalAlign.Middle) {
@ -97,7 +97,7 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
resize: function () { resize: function () {
// console.log("absolute_left_right_vertical_adapt布局不需要resize"); this.layout.stroke(this._formatItems(this.options.items));
}, },
addItem: function () { addItem: function () {
@ -106,8 +106,7 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
this.options.items = items; this.layout.populate(this._formatItems(items));
this.layout.populate(this._formatItems());
} }
}); });
BI.shortcut("bi.absolute_left_right_vertical_float", BI.FloatAbsoluteLeftRightVerticalAdaptLayout); BI.shortcut("bi.absolute_left_right_vertical_float", BI.FloatAbsoluteLeftRightVerticalAdaptLayout);
@ -162,7 +161,7 @@ BI.FloatAbsoluteRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
resize: function () { resize: function () {
this.layout.stroke([{}].concat(this._formatItems(this.options.items)));
}, },
addItem: function () { addItem: function () {
@ -171,7 +170,7 @@ BI.FloatAbsoluteRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
this.layout.populate(items); this.layout.populate([{}].concat(this._formatItems(items)));
} }
}); });
BI.shortcut("bi.absolute_right_vertical_float", BI.FloatAbsoluteRightVerticalAdaptLayout); BI.shortcut("bi.absolute_right_vertical_float", BI.FloatAbsoluteRightVerticalAdaptLayout);

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

@ -33,35 +33,38 @@ BI.FloatAbsoluteVerticalLayout = BI.inherit(BI.Layout, {
hgap: o.hgap, hgap: o.hgap,
lgap: o.lgap, lgap: o.lgap,
rgap: o.rgap, rgap: o.rgap,
// tgap和bgap不传的话内部不会设置top和bottom
tgap: o.tgap, tgap: o.tgap,
bgap: o.bgap bgap: o.bgap
}; };
}, },
_formatItems: function (items) { _formatItems: function (items) {
if (this.options.verticalAlign !== BI.VerticalAlign.Middle) { var o = this.options;
if (o.verticalAlign === BI.VerticalAlign.Top) {
return items; return items;
} }
var cls = o.verticalAlign === BI.VerticalAlign.Bottom ? "bi-abs-b-y-item" : "bi-abs-c-y-item";
return BI.map(items, function (i, item) { return BI.map(items, function (i, item) {
if (!item || BI.isEmptyObject(item)) { if (!item || BI.isEmptyObject(item)) {
return item; return item;
} }
var el = BI.stripEL(item); var el = BI.stripEL(item);
if (BI.isWidget(el)) { if (BI.isWidget(el)) {
el.element.addClass("bi-abs-c-y-item"); el.element.addClass(cls);
} else { } else {
el.cls = (el.cls || "") + "bi-abs-c-y-item"; el.cls = (el.cls || "") + cls;
} }
return item; return item;
}); });
}, },
resize: function () { resize: function () {
// console.log("float_absolute_vertical_adapt布局不需要resize"); this.layout.stroke(this._formatItems(this.options.items));
}, },
populate: function (items) { populate: function (items) {
this.layout.populate.apply(this, arguments); this.layout.populate(this._formatItems(items));
} }
}); });
BI.shortcut("bi.absolute_vertical_float", BI.FloatAbsoluteVerticalLayout); BI.shortcut("bi.absolute_vertical_float", BI.FloatAbsoluteVerticalLayout);

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

@ -81,10 +81,6 @@ BI.AbsoluteLayout = BI.inherit(BI.Layout, {
return w; return w;
}, },
resize: function () {
this.stroke(this.options.items);
},
populate: function (items) { populate: function (items) {
BI.AbsoluteLayout.superclass.populate.apply(this, arguments); BI.AbsoluteLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();

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

@ -51,10 +51,6 @@ BI.AdaptiveLayout = BI.inherit(BI.Layout, {
return w; return w;
}, },
resize: function () {
this.stroke(this.options.items);
},
populate: function (items) { populate: function (items) {
BI.AbsoluteLayout.superclass.populate.apply(this, arguments); BI.AbsoluteLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();

5
src/core/wrapper/layout/layout.border.js

@ -16,10 +16,6 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
this.populate(this.options.items); this.populate(this.options.items);
}, },
resize: function () {
this.stroke(this.options.items);
},
addItem: function (item) { addItem: function (item) {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("不能添加子组件");
@ -131,6 +127,7 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
}, },
update: function (opt) { update: function (opt) {
return this.forceUpdate(opt);
}, },
populate: function (items) { populate: function (items) {

11
src/core/wrapper/layout/layout.card.js

@ -19,10 +19,6 @@ BI.CardLayout = BI.inherit(BI.Layout, {
this.populate(this.options.items); this.populate(this.options.items);
}, },
resize: function () {
// console.log("default布局不需要resize");
},
stroke: function (items) { stroke: function (items) {
var self = this, o = this.options; var self = this, o = this.options;
this.showIndex = void 0; this.showIndex = void 0;
@ -48,7 +44,12 @@ BI.CardLayout = BI.inherit(BI.Layout, {
}); });
}, },
update: function () { resize: function () {
// console.log("Card布局不需要resize");
},
update: function (opt) {
return this.forceUpdate(opt);
}, },
empty: function () { empty: function () {

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

@ -27,10 +27,6 @@ BI.DefaultLayout = BI.inherit(BI.Layout, {
return w; return w;
}, },
resize: function () {
// console.log("default布局不需要resize")
},
populate: function (items) { populate: function (items) {
BI.DefaultLayout.superclass.populate.apply(this, arguments); BI.DefaultLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();

30
src/core/wrapper/layout/layout.division.js

@ -11,29 +11,6 @@ BI.DivisionLayout = BI.inherit(BI.Layout, {
columns: null, columns: null,
rows: null, rows: null,
items: [] items: []
// [
// {
// column: 0,
// row: 0,
// width: 0.25,
// height: 0.33,
// el: {type: 'bi.button', text: 'button1'}
// },
// {
// column: 1,
// row: 1,
// width: 0.25,
// height: 0.33,
// el: {type: 'bi.button', text: 'button2'}
// },
// {
// column: 3,
// row: 2,
// width: 0.25,
// height: 0.33,
// el: {type: 'bi.button', text: 'button3'}
// }
// ]
}); });
}, },
render: function () { render: function () {
@ -41,10 +18,6 @@ BI.DivisionLayout = BI.inherit(BI.Layout, {
this.populate(this.options.items); this.populate(this.options.items);
}, },
resize: function () {
this.stroke(this.opitons.items);
},
addItem: function (item) { addItem: function (item) {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("不能添加子组件");
@ -151,7 +124,8 @@ BI.DivisionLayout = BI.inherit(BI.Layout, {
} }
}, },
update: function () { update: function (opt) {
return this.forceUpdate(opt);
}, },
populate: function (items) { populate: function (items) {

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

@ -64,10 +64,6 @@ BI.FloatLeftLayout = BI.inherit(BI.Layout, {
return w; return w;
}, },
resize: function () {
this.stroke(this.options.items);
},
populate: function (items) { populate: function (items) {
BI.FloatLeftLayout.superclass.populate.apply(this, arguments); BI.FloatLeftLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();
@ -141,10 +137,6 @@ BI.FloatRightLayout = BI.inherit(BI.Layout, {
return w; return w;
}, },
resize: function () {
this.stroke(this.options.items);
},
populate: function (items) { populate: function (items) {
BI.FloatRightLayout.superclass.populate.apply(this, arguments); BI.FloatRightLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();

28
src/core/wrapper/layout/layout.grid.js

@ -11,23 +11,6 @@ BI.GridLayout = BI.inherit(BI.Layout, {
columns: null, columns: null,
rows: null, rows: null,
items: [] items: []
/* [
{
column: 0,
row: 0,
el: {type: 'bi.button', text: 'button1'}
},
{
column: 1,
row: 1,
el: {type: 'bi.button', text: 'button2'}
},
{
column: 3,
row: 2,
el: {type: 'bi.button', text: 'button3'}
}
]*/
}); });
}, },
render: function () { render: function () {
@ -35,10 +18,6 @@ BI.GridLayout = BI.inherit(BI.Layout, {
this.populate(this.options.items); this.populate(this.options.items);
}, },
resize: function () {
// console.log("grid布局不需要resize")
},
addItem: function () { addItem: function () {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("不能添加子组件");
@ -119,7 +98,12 @@ BI.GridLayout = BI.inherit(BI.Layout, {
} }
}, },
update: function () { resize: function () {
// console.log("grid布局不需要resize")
},
update: function (opt) {
return this.forceUpdate(opt);
}, },
populate: function (items) { populate: function (items) {

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

@ -52,23 +52,32 @@ 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 left = o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0), var length = o.hgap;
right = o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0); var fillCount = 0, autoCount = 0;
for (var k = 0; k < i; k++) { for (var k = 0, len = o.columnSize.length || o.items.length; k < len; k++) {
left += o.hgap + o.lgap + o.rgap + (o.items[k].lgap || 0) + (o.items[k].rgap || 0) + (o.items[k].hgap || 0) + (o.columnSize[k] || o.items[k].width); var cz = o.columnSize.length > 0 ? o.columnSize[k] : o.items[k].width;
} if (cz === "fill") {
for (var k = i + 1, len = o.columnSize.length || o.items.length; k < len; k++) { fillCount++;
right += o.hgap + o.lgap + o.rgap + (o.items[k].lgap || 0) + (o.items[k].rgap || 0) + (o.items[k].hgap || 0) + (o.columnSize[k] || o.items[k].width); cz = 0;
} else if (cz === "" || BI.isNull(cz)) {
autoCount++;
cz = 0;
}
length += o.hgap + o.lgap + o.rgap + (o.items[k].lgap || 0) + (o.items[k].rgap || 0) + (o.items[k].hgap || 0) + cz;
} }
if (columnSize === "fill") { if (columnSize === "fill") {
w.element.css("min-width", "calc(100% - " + ((left + right) / BI.pixRatio + BI.pixUnit) + ")"); w.element.css("min-width", "calc((100% - " + (length / BI.pixRatio + BI.pixUnit) + ")" + (fillCount > 1 ? "/" + fillCount : "") + ")");
} }
if (o.horizontalAlign === BI.HorizontalAlign.Stretch || !(o.scrollable === true || o.scrollx === true)) { if (o.horizontalAlign === BI.HorizontalAlign.Stretch || !(o.scrollable === true || o.scrollx === true)) {
w.element.css("max-width", "calc(100% - " + ((left + right) / BI.pixRatio + BI.pixUnit) + ")"); if (columnSize === "fill") {
w.element.css("max-width", "calc((100% - " + (length / BI.pixRatio + BI.pixUnit) + ")" + (fillCount > 1 ? "/" + fillCount : "") + ")");
} else {
w.element.css("max-width", "calc((100% - " + (length / BI.pixRatio + BI.pixUnit) + ")" + (autoCount > 1 ? "/" + autoCount : "") + ")");
}
} }
} }
this._handleGap(w, item, i); this._handleGap(w, item, i);
if (o.verticalAlign === BI.VerticalAlign.Stretch) { 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.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0),
bottom = o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0); bottom = o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0);
w.element.css("height", "calc(100% - " + ((top + bottom) / BI.pixRatio + BI.pixUnit) + ")"); w.element.css("height", "calc(100% - " + ((top + bottom) / BI.pixRatio + BI.pixUnit) + ")");
@ -76,14 +85,6 @@ BI.InlineLayout = BI.inherit(BI.Layout, {
return w; return w;
}, },
resize: function () {
this.stroke(this.options.items);
},
addItem: function (item) {
throw new Error("不能添加子组件");
},
populate: function (items) { populate: function (items) {
BI.InlineLayout.superclass.populate.apply(this, arguments); BI.InlineLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();

16
src/core/wrapper/layout/layout.lattice.js

@ -31,22 +31,6 @@ BI.LatticeLayout = BI.inherit(BI.Layout, {
return w; return w;
}, },
addItem: function (item) {
var w = BI.LatticeLayout.superclass.addItem.apply(this, arguments);
this.resize();
return w;
},
addItemAt: function (item) {
var w = BI.LatticeLayout.superclass.addItemAt.apply(this, arguments);
this.resize();
return w;
},
resize: function () {
this.stroke(this.options.items);
},
populate: function (items) { populate: function (items) {
BI.LatticeLayout.superclass.populate.apply(this, arguments); BI.LatticeLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();

10
src/core/wrapper/layout/layout.table.js

@ -121,14 +121,8 @@ BI.TableLayout = BI.inherit(BI.Layout, {
// console.log("table布局不需要resize"); // console.log("table布局不需要resize");
}, },
addItem: function (arr) { update: function (opt) {
if (!BI.isArray(arr)) { return this.forceUpdate(opt);
throw new Error("必须是数组", arr);
}
return BI.TableLayout.superclass.addItem.apply(this, arguments);
},
update: function () {
}, },
populate: function (items) { populate: function (items) {

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

@ -23,9 +23,6 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
this.populate(this.options.items); this.populate(this.options.items);
}, },
resize: function () {
this.stroke(this.options.items);
},
addItem: function (item) { addItem: function (item) {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("不能添加子组件");
@ -122,12 +119,8 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
}); });
}, },
update: function () { update: function (opt) {
var updated; return this.forceUpdate(opt);
BI.each(this._children, function (i, child) {
updated = child.update() || updated;
});
return updated;
}, },
populate: function (items) { populate: function (items) {
@ -162,10 +155,6 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
this.populate(this.options.items); this.populate(this.options.items);
}, },
resize: function () {
this.stroke(this.options.items);
},
addItem: function (item) { addItem: function (item) {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("不能添加子组件");
@ -262,7 +251,8 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
}); });
}, },
update: function () { update: function (opt) {
return this.forceUpdate(opt);
}, },
populate: function (items) { populate: function (items) {

10
src/core/wrapper/layout/layout.td.js

@ -176,14 +176,8 @@ BI.TdLayout = BI.inherit(BI.Layout, {
// console.log("td布局不需要resize"); // console.log("td布局不需要resize");
}, },
addItem: function (arr) { update: function (opt) {
if (!BI.isArray(arr)) { return this.forceUpdate(opt);
throw new Error("必须是数组", arr);
}
return BI.TdLayout.superclass.addItem.apply(this, arguments);
},
update: function () {
}, },
populate: function (items) { populate: function (items) {

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

@ -42,10 +42,6 @@ BI.VerticalLayout = BI.inherit(BI.Layout, {
return w; return w;
}, },
resize: function () {
this.stroke(this.options.items);
},
populate: function (items) { populate: function (items) {
BI.VerticalLayout.superclass.populate.apply(this, arguments); BI.VerticalLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();

11
src/core/wrapper/layout/layout.window.js

@ -25,10 +25,6 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
this.populate(this.options.items); this.populate(this.options.items);
}, },
resize: function () {
this.stroke(this.options.items);
},
addItem: function (item) { addItem: function (item) {
// do nothing // do nothing
throw new Error("不能添加子组件"); throw new Error("不能添加子组件");
@ -171,7 +167,12 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
} }
}, },
update: function () { resize: function () {
// console.log("window布局不需要resize");
},
update: function (opt) {
return this.forceUpdate(opt);
}, },
populate: function (items) { populate: function (items) {

8
src/core/wrapper/layout/middle/middle.center.js

@ -48,7 +48,7 @@ BI.CenterLayout = BI.inherit(BI.Layout, {
return { return {
type: "bi.grid", type: "bi.grid",
ref: function (_ref) { ref: function (_ref) {
self.wrapper = _ref; self.layout = _ref;
}, },
columns: list.length, columns: list.length,
rows: 1, rows: 1,
@ -65,12 +65,8 @@ BI.CenterLayout = BI.inherit(BI.Layout, {
throw new Error("不能添加子组件"); throw new Error("不能添加子组件");
}, },
update: function (opt) {
return this.wrapper.update(opt);
},
populate: function (items) { populate: function (items) {
this.wrapper.populate.apply(this.wrapper, arguments); this.layout.populate.apply(this.layout, arguments);
} }
}); });
BI.shortcut("bi.center", BI.CenterLayout); BI.shortcut("bi.center", BI.CenterLayout);

8
src/core/wrapper/layout/middle/middle.float.center.js

@ -49,7 +49,7 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, {
return { return {
type: "bi.left", type: "bi.left",
ref: function (_ref) { ref: function (_ref) {
self.wrapper = _ref; self.layout = _ref;
}, },
items: list items: list
}; };
@ -64,12 +64,8 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, {
throw new Error("不能添加子组件"); throw new Error("不能添加子组件");
}, },
update: function (opt) {
return this.wrapper.update(opt);
},
populate: function (items) { populate: function (items) {
this.wrapper.populate.apply(this.wrapper, arguments); this.layout.populate.apply(this.layout, arguments);
} }
}); });
BI.shortcut("bi.float_center", BI.FloatCenterLayout); BI.shortcut("bi.float_center", BI.FloatCenterLayout);

8
src/core/wrapper/layout/middle/middle.horizontal.js

@ -46,7 +46,7 @@ BI.HorizontalCenterLayout = BI.inherit(BI.Layout, {
return { return {
type: "bi.grid", type: "bi.grid",
ref: function (_ref) { ref: function (_ref) {
self.wrapper = _ref; self.layout = _ref;
}, },
columns: list.length, columns: list.length,
rows: 1, rows: 1,
@ -63,12 +63,8 @@ BI.HorizontalCenterLayout = BI.inherit(BI.Layout, {
throw new Error("不能添加子组件"); throw new Error("不能添加子组件");
}, },
update: function (opt) {
return this.wrapper.update(opt);
},
populate: function (items) { populate: function (items) {
this.wrapper.populate.apply(this.wrapper, arguments); this.layout.populate.apply(this.layout, arguments);
} }
}); });
BI.shortcut("bi.horizontal_center", BI.HorizontalCenterLayout); BI.shortcut("bi.horizontal_center", BI.HorizontalCenterLayout);

8
src/core/wrapper/layout/middle/middle.vertical.js

@ -47,7 +47,7 @@ BI.VerticalCenterLayout = BI.inherit(BI.Layout, {
return { return {
type: "bi.grid", type: "bi.grid",
ref: function (_ref) { ref: function (_ref) {
self.wrapper = _ref; self.layout = _ref;
}, },
columns: 1, columns: 1,
rows: list.length, rows: list.length,
@ -64,12 +64,8 @@ BI.VerticalCenterLayout = BI.inherit(BI.Layout, {
throw new Error("不能添加子组件"); throw new Error("不能添加子组件");
}, },
update: function (opt) {
return this.wrapper.update(opt);
},
populate: function (items) { populate: function (items) {
this.wrapper.populate.apply(this.wrapper, arguments); this.layout.populate.apply(this.layout, arguments);
} }
}); });
BI.shortcut("bi.vertical_center", BI.VerticalCenterLayout); BI.shortcut("bi.vertical_center", BI.VerticalCenterLayout);

12
src/less/core/wrapper/float.absolute.less

@ -24,4 +24,14 @@
-webkit-transform: translate(-50%, -50%); /* Safari 和 Chrome */ -webkit-transform: translate(-50%, -50%); /* Safari 和 Chrome */
-o-transform: translate(-50%, -50%); /* Opera */ -o-transform: translate(-50%, -50%); /* Opera */
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }
.bi-abs-b-y-item {
bottom: 0;
margin-top: auto;
}
.bi-abs-r-x-item {
right: 0;
margin-left: auto;
}

2
typescript/base/tree/customtree.ts

@ -8,7 +8,7 @@ export declare class CustomTree extends Widget {
stroke(...args: any[]): void; stroke(...args: any[]): void;
populate(nodes: any, ...args: any[]): void; populate(nodes?: any, ...args: any[]): void;
getAllButtons<T>(): T[]; getAllButtons<T>(): T[];

Loading…
Cancel
Save