Browse Source

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

es6
iapyang 3 years ago
parent
commit
414144f004
  1. 7
      changelog.md
  2. 2
      dist/fix/fix.compact.js
  3. BIN
      dist/font/iconfont.eot
  4. 30
      dist/font/iconfont.svg
  5. BIN
      dist/font/iconfont.ttf
  6. BIN
      dist/font/iconfont.woff
  7. BIN
      dist/font/iconfont.woff2
  8. 6
      examples/config-render.html
  9. 445
      examples/dev.html
  10. 6
      examples/effect.html
  11. 6
      examples/hooks.html
  12. 6
      examples/loader-context.html
  13. 6
      examples/resize.html
  14. 6
      examples/style.html
  15. 6
      examples/tab-context.html
  16. 6
      examples/test-id.html
  17. 6
      examples/virtual-group.html
  18. 6
      examples/visible.html
  19. 6
      examples/worker.html
  20. 419
      examples/响应式布局.html
  21. 8
      examples/插件设计.html
  22. 3
      i18n/i18n.cn.js
  23. 2
      package.json
  24. 16
      src/base/single/button/button.basic.js
  25. 17
      src/base/single/button/button.node.js
  26. 13
      src/base/single/input/input.js
  27. 1
      src/base/single/input/radio/radio.js
  28. 1
      src/case/editor/editor.sign.js
  29. 2
      src/case/ztree/0.treeview.js
  30. 83
      src/core/6.inject.js
  31. 4
      src/core/platform/web/config.js
  32. 55
      src/core/wrapper/layout.js
  33. 8
      src/core/wrapper/layout/adapt/absolute.center.js
  34. 11
      src/core/wrapper/layout/adapt/adapt.table.js
  35. 14
      src/core/wrapper/layout/fill/float.fill.horizontal.js
  36. 2
      src/core/wrapper/layout/flex/flex.horizontal.js
  37. 2
      src/core/wrapper/layout/flex/flex.vertical.js
  38. 2
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js
  39. 2
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js
  40. 28
      src/core/wrapper/layout/layout.absolute.js
  41. 12
      src/core/wrapper/layout/layout.adaptive.js
  42. 40
      src/core/wrapper/layout/layout.border.js
  43. 8
      src/core/wrapper/layout/layout.card.js
  44. 20
      src/core/wrapper/layout/layout.flow.js
  45. 16
      src/core/wrapper/layout/layout.inline.js
  46. 14
      src/core/wrapper/layout/layout.table.js
  47. 72
      src/core/wrapper/layout/layout.tape.js
  48. 39
      src/core/wrapper/layout/layout.td.js
  49. 16
      src/core/wrapper/layout/layout.window.js
  50. 8
      src/core/wrapper/layout/middle/middle.center.js
  51. 8
      src/core/wrapper/layout/middle/middle.float.center.js
  52. 8
      src/core/wrapper/layout/middle/middle.horizontal.js
  53. 8
      src/core/wrapper/layout/middle/middle.vertical.js
  54. 70
      src/core/wrapper/layout/responsive/responsive.flex.horizontal.js
  55. 72
      src/core/wrapper/layout/responsive/responsive.flex.wrapper.horizontal.js
  56. 81
      src/core/wrapper/layout/responsive/responsive.inline..js
  57. 10
      src/less/base/single/button/switch.less
  58. 11
      src/less/core/wrapper/flex.horizontal.less
  59. 13
      src/less/core/wrapper/flex.wrapper.horizontal.less
  60. 1
      src/less/modern.less
  61. 0
      src/polyfill/number.js
  62. 49
      src/snabbdom/element2Snabbdom.js
  63. 1052
      src/snabbdom/snabbdom.js
  64. 3
      src/widget/multiselect/multiselect.insert.combo.js
  65. 3
      src/widget/multiselect/multiselect.insert.combo.nobar.js
  66. 3
      src/widget/multiselectlist/multiselectlist.insert.js
  67. 3
      src/widget/multiselectlist/multiselectlist.insert.nobar.js
  68. 6
      src/widget/numberinterval/numberinterval.js

7
changelog.md

@ -1,6 +1,13 @@
# 更新日志
2.0(2021-12)
- 支持BI.config(function(){})进行系统配置
2.0(2021-11)
- 限制了复选下拉框一次粘贴添加值个数最大2000
2.0(2021-10)
- combo增加window.blur事件触发隐藏
2.0(2021-09)
- 支持自动watch
- 支持h函数传递left、right,优化left_right_vertical_adapt布局的jsx写法

2
dist/fix/fix.compact.js vendored

@ -55,6 +55,8 @@
Fix.Model.target = target = targetStack.pop();
}
BI.Model = Fix.Model;
var oldWatch = Fix.watch;
Fix.watch = function (model, expOrFn, cb, options) {
if (BI.isPlainObject(cb)) {

BIN
dist/font/iconfont.eot vendored

Binary file not shown.

30
dist/font/iconfont.svg vendored

@ -14,6 +14,36 @@
/>
<missing-glyph />
<glyph glyph-name="jianbiaoyuju" unicode="&#59523;" d="M320 768h64v-768h-64zM608 256h64v-256H608zM128 191.68v64h768v-64zM128 480V544h192v-64zM543.744 832a32 32 0 0 0 5.76-63.488l-5.76-0.512H160a32 32 0 0 1-31.488-26.24L128 736v-704a32 32 0 0 1 26.24-31.488L160 0h704a32 32 0 0 1 31.488 26.24L896 32V415.872a32 32 0 0 0 63.488 5.76l0.512-5.76V32a96 96 0 0 0-86.784-95.552L864-64H160a96 96 0 0 0-95.552 86.784L64 32V736A96 96 0 0 0 150.784 831.552L160 832h383.744zM512 640m32 0l384 0q32 0 32-32l0 0q0-32-32-32l-384 0q-32 0-32 32l0 0q0 32 32 32ZM704 384m0 32l0 384q0 32 32 32l0 0q32 0 32-32l0-384q0-32-32-32l0 0q-32 0-32 32Z" horiz-adv-x="1024" />
<glyph glyph-name="canshufuzhi1" unicode="&#59513;" d="M910.2336 839.099733c31.402667 0 56.900267-25.463467 56.900267-56.900266V327.099733H910.2336V782.199467H113.800533V-14.233600000000024H568.900267v-56.900267H113.800533C82.397867-71.13386700000001 56.900267-45.636266999999975 56.900267-14.233600000000024V782.199467C56.900267 813.602133 82.363733 839.099733 113.800533 839.099733H910.2336zM910.2336 839.099733c31.402667 0 56.900267-25.463467 56.900267-56.900266v-227.5328H56.900267V782.199467C56.900267 813.602133 82.363733 839.099733 113.800533 839.099733H910.2336zM170.666667 440.866133m28.433066 0l512.034134 0q28.433067 0 28.433066-28.433066l0-0.034134q0-28.433067-28.433066-28.433066l-512.034134 0q-28.433067 0-28.433066 28.433066l0 0.034134q0 28.433067 28.433066 28.433066ZM170.666667 213.33333300000004m28.433066 0l341.367467 0q28.433067 0 28.433067-28.433066l0-0.034134q0-28.433067-28.433067-28.433066l-341.367467 0q-28.433067 0-28.433066 28.433066l0 0.034134q0 28.433067 28.433066 28.433066ZM540.4672 497.7664a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m0-56.900267a28.433067 28.433067 0 1 1 0-56.866133 28.433067 28.433067 0 0 1 0 56.866133zM540.4672 440.866133a28.433067 28.433067 0 1 1 0-56.866133 28.433067 28.433067 0 0 1 0 56.866133zM312.900267 270.199467a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m0-56.866134A28.433067 28.433067 0 1 1 312.900267 156.43306700000005a28.433067 28.433067 0 0 1 0 56.900266zM312.900267 213.33333300000004A28.433067 28.433067 0 1 1 312.900267 156.43306700000005a28.433067 28.433067 0 0 1 0 56.900266zM698.641067-71.13386700000001l28.091733 77.550934h135.9872l29.696-77.550934h74.717867l-136.192 341.333334h-72.669867l-132.471467-341.333334H698.606933z m141.994666 135.0656h-92.808533L793.770667 190.56640000000004l46.8992-126.634667z" horiz-adv-x="1024" />
<glyph glyph-name="xunijiedian1" unicode="&#59514;" d="M512 583.099733a199.099733 199.099733 0 1 1 0-398.199466 199.099733 199.099733 0 0 1 0 398.199466zM241.083733 92.16A396.629333 396.629333 0 0 1 512-14.267733c82.670933 0 161.416533 25.258667 227.566933 71.3728l13.960534 10.24 34.542933-45.226667A453.188267 453.188267 0 0 0 512-71.099733a453.393067 453.393067 0 0 0-296.2432 109.568l-13.380267 11.9808 38.7072 41.6768zM845.1072 694.0672A453.5296 453.5296 0 0 0 967.099733 384c0-95.163733-29.320533-185.9584-82.875733-261.905067l-11.025067-15.018666-45.124266 34.645333A396.288 396.288 0 0 1 910.2336 384c0 96.119467-34.133333 186.811733-95.0272 258.184533l-11.741867 13.141334 41.642667 38.775466z m-693.384533-31.982933l45.021866-34.816A396.288 396.288 0 0 1 113.800533 384c0-70.724267 18.432-138.683733 52.872534-198.4512l8.942933-14.779733-48.0256-30.5152A453.051733 453.051733 0 0 0 56.900267 384c0 102.058667 33.6896 199.031467 94.8224 278.1184zM512 839.099733c80.622933 0 158.208-21.026133 226.474667-60.245333l15.5648-9.386667-30.276267-48.128A396.1856 396.1856 0 0 1 512 782.199467c-82.670933 0-161.450667-25.258667-227.566933-71.3728l-13.994667-10.24-34.5088 45.226666A453.188267 453.188267 0 0 0 512 839.099733zM967.099733 62.805333v-133.905066h-135.5776v56.866133h78.711467V62.805333h56.866133z m-853.333333 1.4336v-78.472533h77.550933v-56.866133H56.900267v135.338666h56.866133zM195.925333 839.099733v-56.866133H113.7664v-84.957867H56.900267V839.099733H195.925333z m771.1744 0v-140.6976h-56.866133V782.2336h-83.3536V839.099733h140.219733z" horiz-adv-x="1024" />
<glyph glyph-name="SQL-jiaoben" unicode="&#59516;" d="M786.090667 839.099733l181.009066-175.035733v-665.156267a70.007467 70.007467 0 0 0-69.973333-70.007466H126.8736a70.007467 70.007467 0 0 0-70.007467 69.973333V769.1264c0 38.673067 31.3344 70.007467 69.973334 70.007467H786.090667zM910.199467 384H113.7664v-385.092267c0-6.3488 4.5056-11.639467 10.478933-12.868266l2.6624-0.273067h770.184534c6.3488 0 11.639467 4.5056 12.868266 10.478933l0.273067 2.6624L910.199467 384zM503.125333 684.3392c-28.945067 0-53.1456-8.6016-72.567466-25.838933-23.8592-21.060267-35.771733-52.189867-35.771734-93.320534 0-40.8576 11.605333-71.816533 34.816-92.910933 19.182933-17.5104 43.4176-26.282667 72.738134-26.282667 14.062933 0 26.146133 1.706667 36.215466 5.051734 4.778667 1.6384 10.3424 4.1984 16.5888 7.714133l4.778667 2.833067 27.204267-25.668267 24.610133 25.668267-25.941333 24.302933a83.968 83.968 0 0 1 17.544533 32.221867c4.881067 13.550933 7.338667 30.378667 7.338667 50.414933 0 37.888-11.434667 67.3792-34.235734 88.4736-19.7632 18.2272-44.202667 27.306667-73.3184 27.306667z m-229.1712-0.3072c-28.433067 0-49.9712-6.656-64.648533-20.002133-14.677333-13.346133-21.981867-30.1056-21.981867-50.2784 0-22.084267 7.5776-38.331733 22.766934-48.7424 7.953067-5.5296 21.640533-10.683733 41.028266-15.4624l7.543467-1.809067 23.825067-5.3248c13.994667-3.072 24.234667-6.587733 30.72-10.581333 6.519467-4.027733 9.762133-9.796267 9.762133-17.237334 0-12.731733-6.5536-21.435733-19.694933-26.112-6.929067-2.4576-15.940267-3.6864-27.0336-3.6864-18.5344 0-31.6416 4.642133-39.253334 13.9264a40.106667 40.106667 0 0 0-7.406933 17.2032l-1.024 5.870934H183.637333c0-23.4496 8.430933-41.847467 25.224534-55.261867 16.7936-13.380267 39.867733-20.0704 69.2224-20.0704 28.706133 0 50.926933 6.826667 66.6624 20.3776 15.735467 13.6192 23.620267 30.72 23.620266 51.268267 0 20.0704-6.724267 35.396267-20.1728 45.9776-7.406933 5.870933-17.92 10.683733-31.470933 14.5408l-7.031467 1.809066-38.8096 9.3184c-14.9504 3.584-24.746667 6.690133-29.354666 9.3184a19.387733 19.387733 0 0 0-10.6496 18.056534c0 8.738133 3.584 15.5648 10.820266 20.48 7.236267 4.881067 16.930133 7.304533 29.013334 7.304533 10.922667 0 20.036267-1.877333 27.374933-5.632 9.6256-5.0176 15.36-12.970667 17.169067-23.995733l0.546133-4.881067h45.226667c-0.8192 23.893333-9.591467 42.1888-26.350934 54.749867-16.759467 12.5952-37.000533 18.875733-60.757333 18.875733z m419.669334-6.587733h-47.069867V452.266667h158.583467v40.482133h-111.5136V677.444267z m-190.805334-32.9728c19.8656 0 34.952533-6.894933 45.294934-20.718934 10.3424-13.789867 15.496533-33.314133 15.496533-58.5728 0-11.025067-1.1264-20.650667-3.345067-28.8768-1.092267-4.130133-2.730667-8.772267-5.0176-13.9264l-2.491733-5.3248-22.766933 21.674667-24.2688-25.361067 22.766933-21.674666a60.5184 60.5184 0 0 0-26.112-5.802667c-14.404267 0-26.7264 4.334933-37.000533 12.970667-15.872 13.346133-23.825067 35.464533-23.825067 66.321066 0 26.385067 5.5296 46.1824 16.657067 59.392 11.093333 13.277867 25.941333 19.899733 44.612266 19.899734z m248.046934 137.762133v-159.232h159.3344l-159.3344 159.232zM365.704533 229.99040000000002l-80.452266-80.418133 80.452266-80.4864-40.209066-40.209067L204.8 149.50400000000002l120.695467 120.695467zM657.3056 229.99040000000002l80.452267-80.452267-80.452267-80.452266 40.2432-40.209067 120.661333 120.661333-120.661333 120.695467z" horiz-adv-x="1024" />
<glyph glyph-name="tiaojianfenzhi" unicode="&#59517;" d="M56.900267 644.061867m56.900266 0l113.7664 0q56.900267 0 56.900267-56.900267l0-373.828267q0-56.900267-56.900267-56.900266l-113.7664 0q-56.900267 0-56.900266 56.900266l0 373.828267q0 56.900267 56.900266 56.900267ZM711.133867 725.333333h56.900266v-113.7664h-56.900266zM749.021867 824.900267l92.501333-138.786134A11.3664 11.3664 0 0 0 832.068267 668.433067h-185.002667a11.3664 11.3664 0 0 0-9.489067 17.681066l92.501334 138.786134a11.3664 11.3664 0 0 0 18.944 0zM397.960533 411.613867v-56.900267H284.194133v56.900267zM497.527467 373.691733l-138.786134-92.501333a11.3664 11.3664 0 0 0-17.681066 9.454933v185.0368a11.3664 11.3664 0 0 0 17.681066 9.489067l138.786134-92.501333a11.3664 11.3664 0 0 0 0-18.978134zM711.133867 42.666667h56.900266V156.433067h-56.900266zM749.021867-56.900267l92.501333 138.752a11.3664 11.3664 0 0 1-9.454933 17.681067h-185.002667a11.3664 11.3664 0 0 1-9.489067-17.681067l92.501334-138.786133a11.3664 11.3664 0 0 1 18.944 0zM946.9952 444.347733l-147.114667 147.114667a85.333333 85.333333 0 0 1-120.695466-0.1024l-146.773334-147.080533a85.333333 85.333333 0 0 1 0-120.5248l146.8416-147.114667a85.333333 85.333333 0 0 1 120.695467 0l147.0464 147.0464a85.333333 85.333333 0 0 1 0 120.661333z m-187.2896 106.837334l147.080533-147.0464a28.433067 28.433067 0 0 0 0-40.2432L759.7056 216.849067a28.4672 28.4672 0 0 0-40.277333 0l-146.705067 147.080533a28.433067 28.433067 0 0 0 0 40.174933l146.7392 147.080534a28.433067 28.433067 0 0 0 40.2432 0z" horiz-adv-x="1024" />
<glyph glyph-name="shujutongbu" unicode="&#59518;" d="M871.901867 213.33333300000004a398.677333 398.677333 0 0 0-303.0016-223.505066v57.5488A341.640533 341.640533 0 0 1 807.662933 213.33333300000004zM455.099733 778.171733v-57.5488a341.640533 341.640533 0 0 1-279.722666-279.722666H117.828267a398.472533 398.472533 0 0 0 337.237333 337.271466zM483.566933 384c15.701333 0 28.433067-12.731733 28.433067-28.433067v-284.4672c0-15.701333-12.731733-28.433067-28.433067-28.433066H85.333333a28.433067 28.433067 0 0 0-28.433066 28.433066v284.4672c0 15.701333 12.731733 28.433067 28.433066 28.433067h398.2336z m-28.4672-56.866133h-341.333333v-227.566934h341.333333v227.566934zM312.900267 42.66666699999996v-56.900267H256V42.66666699999996zM426.666667-14.233600000000024a28.433067 28.433067 0 1 0 0-56.866133H142.2336a28.433067 28.433067 0 1 0 0 56.866133H426.666667zM910.2336 668.4330669999999c31.402667 0 56.866133-25.463467 56.866133-56.866134v-113.800533c0-31.402667-25.463467-56.866133-56.866133-56.866133h-341.333333c-31.402667 0-56.900267 25.463467-56.900267 56.866133V611.5669330000001c0 31.402667 25.463467 56.866133 56.900267 56.866134h341.333333z m-284.4672-85.333334a28.433067 28.433067 0 1 1 0-56.866133 28.433067 28.433067 0 0 1 0 56.866133zM910.2336 839.099733c31.402667 0 56.866133-25.463467 56.866133-56.866133v-170.666667H512v170.666667c0 31.402667 25.463467 56.866133 56.900267 56.866133h341.333333z m0-56.866133h-341.333333l-0.034134-113.7664h341.333334V782.2336zM967.099733 497.7664v-170.666667c0-31.402667-25.463467-56.866133-56.866133-56.866133h-341.333333c-31.402667 0-56.900267 25.463467-56.900267 56.866133v170.666667h455.099733z m-56.900266-56.866133h-341.333334v-113.800534h341.333334v113.800534zM625.7664 725.333333m-34.133333 0a34.133333 34.133333 0 1 1 68.266666 0 34.133333 34.133333 0 1 1-68.266666 0ZM625.7664 384m-34.133333 0a34.133333 34.133333 0 1 1 68.266666 0 34.133333 34.133333 0 1 1-68.266666 0ZM170.666667 213.33333300000004m28.433066 0l170.7008 0q28.433067 0 28.433067-28.433066l0-0.034134q0-28.433067-28.433067-28.433066l-170.7008 0q-28.433067 0-28.433066 28.433066l0 0.034134q0 28.433067 28.433066 28.433066Z" horiz-adv-x="1024" />
<glyph glyph-name="keshihuazhuanhuan" unicode="&#59515;" d="M568.900267 839.099733c31.402667 0 56.866133-25.463467 56.866133-56.866133V554.666667h-227.5328c-29.764267 0-54.203733-22.869333-56.661333-51.985067l-0.238934-4.9152v-227.5328H113.7664c-31.402667 0-56.866133 25.463467-56.866133 56.866133V782.2336c0 31.402667 25.463467 56.866133 56.866133 56.866133h455.133867z m0-56.866133H113.7664v-455.133867l170.666667 0.068267 0.068266 173.056 0.341334 7.304533a113.800533 113.800533 0 0 0 107.076266 103.867734l6.314667 0.170666h170.632533v170.666667zM910.2336 497.7664c31.402667 0 56.866133-25.463467 56.866133-56.866133v-455.133867c0-31.402667-25.463467-56.866133-56.866133-56.866133H455.099733c-31.402667 0-56.866133 25.463467-56.866133 56.866133V440.900267c0 31.402667 25.463467 56.866133 56.866133 56.866133h455.133867zM548.420267 384H491.52v-341.333333h56.900267V384z m113.7664-136.533333h-56.900267v-204.8H662.186667v204.8z m113.7664-68.266667h-56.866134v-136.533333h56.866134v136.533333z m102.4 0h-56.866134v-136.533333h56.866134v136.533333zM753.629867 863.8464c58.231467-33.1776 95.1296-66.56 110.114133-102.468267 13.789867-33.041067 14.574933-82.261333 3.8912-149.265066l-2.116267-12.765867-56.046933 9.796267c11.1616 63.726933 11.1616 107.8272 1.774933 130.321066-8.533333 20.3776-33.9968 44.2368-76.936533 69.802667l-8.840533 5.12 28.16 49.4592zM763.869867 722.295467l80.418133-80.452267 80.4864 80.452267 40.209067-40.209067-120.661334-120.695467L723.626667 682.0864zM270.370133-95.84640000000002c-58.231467 33.1776-95.1296 66.56-110.114133 102.468267-13.789867 33.041067-14.574933 82.261333-3.8912 149.265066l2.116267 12.765867 56.046933-9.796267c-11.1616-63.726933-11.1616-107.8272-1.774933-130.321066 8.533333-20.3776 33.9968-44.2368 76.936533-69.802667l8.840533-5.12-28.16-49.4592zM262.587733 45.70453299999997l-80.452266 80.452267-80.452267-80.452267L61.44 85.91359999999997l120.695467 120.695467 120.661333-120.695467zM170.666667 725.333333h284.433066v-56.900266H170.666667zM170.666667 611.5669330000001h284.433066V554.666667H170.666667zM170.666667 497.800533h113.7664v-56.900266H170.666667z" horiz-adv-x="1024" />
<glyph glyph-name="DBbiaoshuchu" unicode="&#59522;" d="M740.010667 839.099733l170.222933-171.4176v-306.0736c0-31.402667-25.4976-56.900267-56.900267-56.900266H170.666667c-31.402667 0-56.900267 25.4976-56.900267 56.900266V782.2336c0 31.402667 25.4976 56.866133 56.900267 56.866133h569.344zM853.333333 623.274667h-119.261866a51.2 51.2 0 0 0-51.2 51.2V782.2336H170.666667v-420.625067h682.666666V623.274667zM910.2336 384c31.402667 0 56.866133-25.463467 56.866133-56.900267v-341.333333c0-31.402667-25.463467-56.866133-56.866133-56.866133H113.7664c-31.402667 0-56.866133 25.463467-56.866133 56.866133v341.333333c0 31.402667 25.463467 56.900267 56.866133 56.900267h796.4672z m-252.859733-113.7664H537.6V42.66666699999996h111.7184c12.629333 0 24.302933 1.024 35.054933 3.072 10.752 2.048 20.104533 5.870933 27.989334 11.434666 7.031467 4.846933 12.9024 10.820267 17.578666 17.92 7.3728 10.683733 11.0592 22.801067 11.0592 36.283734 0 13.073067-3.208533 24.1664-9.6256 33.348266-6.417067 9.147733-15.906133 15.837867-28.535466 20.0704 8.260267 3.8912 14.506667 8.192 18.773333 12.970667 7.543467 8.430933 11.332267 19.592533 11.332267 33.450667a54.613333 54.613333 0 0 1-11.3664 34.781866c-11.537067 14.404267-30.481067 22.4256-56.866134 23.9616l-7.338666 0.273067z m-269.550934 0H281.6V42.66666699999996h106.222933c37.205333 0 64.785067 14.165333 82.602667 42.461866 13.175467 20.992 19.729067 46.626133 19.729067 76.868267 0 11.946667-1.536 24.507733-4.676267 37.6832a97.553067 97.553067 0 0 1-17.544533 36.727467 81.169067 81.169067 0 0 1-41.984 28.8768 125.1328 125.1328 0 0 1-29.2864 4.642133l-8.874667 0.3072z m260.334934-127.3856c10.717867-0.1024 19.012267-1.365333 24.917333-3.857067 10.581333-4.437333 15.906133-12.561067 15.906133-24.3712 0-13.994667-5.461333-23.483733-16.384-28.433066-6.0416-2.6624-14.472533-3.9936-25.258666-3.9936H586.752v60.654933h61.371733z m-269.038934 87.8592c23.415467 0 39.048533-6.212267 46.8992-18.602667 7.850667-12.424533 11.810133-30.173867 11.810134-53.3504 0-16.759467-2.628267-31.232-7.850667-43.349333-9.6256-22.152533-26.555733-33.211733-50.858667-33.211733H331.605333v148.48h47.5136z m261.8368 0c11.946667 0 21.742933-1.194667 29.457067-3.549867 8.9088-3.413333 13.380267-10.410667 13.380267-20.992 0-9.557333-3.413333-16.247467-10.1376-20.002133-6.724267-3.754667-15.530667-5.632-26.3168-5.632H586.752v50.176h54.1696zM540.433067 578.116267a28.433067 28.433067 0 0 0 3.584-56.661334l-3.584-0.238933h-170.666667a28.433067 28.433067 0 0 0-3.549867 56.661333l3.549867 0.238934h170.666667zM610.269867 577.1264c14.506667-14.506667 15.4624-37.444267 2.901333-53.077333l-2.901333-3.242667-72.3968-72.362667a28.433067 28.433067 0 0 0-42.5984 37.546667l2.389333 2.6624 60.3136 60.347733-60.347733 60.3136a28.433067 28.433067 0 0 0-2.389334 37.546667l2.389334 2.696533c10.24 10.24 26.385067 11.025067 37.546666 2.3552l2.696534-2.389333 72.362666-72.362667z" horiz-adv-x="1024" />
<glyph glyph-name="shujujishuru" unicode="&#59521;" d="M56.900267 164.522667C146.6368 87.108267 308.8384 42.666667 512 42.666667c19.182933 0 38.161067 0.341333 56.832 1.092266l-0.068267-1.092266 0.034134-112.469334a1218.56 1218.56 0 0 0-56.797867-1.297066c-247.1936 0-448.3072 73.864533-454.9632 165.956266l-0.170667 4.7104V164.522667z m0 182.818133c91.067733-66.696533 261.597867-115.029333 455.133866-115.029333 46.865067 0 92.398933 2.4576 135.7824 7.0656a283.511467 283.511467 0 0 1-73.0112-138.3424c-20.48-0.989867-41.472-1.467733-62.805333-1.467734-249.002667 0-448.238933 67.8912-454.929067 138.581334l-0.170666 3.618133v105.5744z m910.2336 205.550933v-111.991466l-0.4096-5.700267c-10.24-69.905067-208.042667-136.533333-454.690134-136.533333-249.0368 0-448.273067 67.925333-454.9632 138.581333l-0.170666 3.652267v111.991466c91.136-68.4032 261.802667-111.991467 455.133866-111.991466 193.262933 0 363.963733 43.588267 455.099734 111.957333zM512.034133 839.099733c251.323733 0 455.099733-76.3904 455.099734-170.666666 0-92.672-197.0176-168.106667-442.5728-170.5984l-12.526934-0.068267c-9.147733 0-18.2272 0.1024-27.2384 0.341333-234.564267 5.154133-421.341867 76.970667-427.690666 165.649067l-0.2048 4.676267 0.170666 4.7104c6.656 92.091733 207.7696 165.956267 454.9632 165.956266zM869.922133 252.142933l-157.2864-165.614933-49.8688-105.335467a34.133333 34.133333 0 0 1 42.052267-46.830933l109.124267 37.956267 165.819733 169.642666c15.018667 15.36 15.1552 39.867733 0.3072 55.364267l-53.828267 56.251733a39.8336 39.8336 0 0 1-56.32-1.4336z m28.910934-52.155733l28.672-30.037333-144.861867-148.2752-45.226667-15.701334 22.7328 48.0256 138.683734 145.988267z" horiz-adv-x="1024" />
<glyph glyph-name="RestAPIshuru" unicode="&#59520;" d="M584.9088 839.099733c10.786133 0 20.616533-6.075733 25.429333-15.701333l30.378667-60.7232a397.789867 397.789867 0 0 0 142.4384-82.295467l67.925333 4.027734a28.433067 28.433067 0 0 0 26.350934-14.165334l67.754666-117.3504a28.433067 28.433067 0 0 0-0.9216-29.9008l-37.410133-56.661333a399.906133 399.906133 0 0 0 0-164.590933l20.7872-31.505067h-102.741333a284.433067 284.433067 0 0 1-284.330667-275.7632l-0.136533-8.704v-56.866133h-91.0336a28.433067 28.433067 0 0 0-23.415467 12.288l-2.048 3.413333-30.344533 60.7232a397.789867 397.789867 0 0 0-142.472534 82.3296l-67.8912-4.061867a28.433067 28.433067 0 0 0-24.098133 10.8544l-2.218667 3.310934-67.754666 117.3504a28.433067 28.433067 0 0 0-1.092267 26.4192l1.979733 3.4816 37.410134 56.695466A399.906133 399.906133 0 0 0 118.920533 384c0 28.228267 2.935467 55.739733 8.533334 82.295467l-37.410134 56.661333a28.433067 28.433067 0 0 0-2.6624 26.3168l1.774934 3.618133 67.754666 117.3504A28.433067 28.433067 0 0 0 179.2 684.373333h3.9936l67.925333-3.9936a397.789867 397.789867 0 0 0 142.4384 82.295467l30.378667 60.7232a28.433067 28.433067 0 0 0 25.429333 15.701333h135.509334z m-190.0544-254.976h-58.026667L249.173333 338.5344h53.6576l16.9984 50.517333h90.5216l15.837867-50.517333h55.637333l-86.971733 245.6576z m226.304 0h-106.973867v-245.623466h50.9952v88.337066h52.155734c27.2384 0 48.162133 5.973333 62.839466 17.988267 14.677333 11.9808 21.981867 32.494933 21.981867 61.508267 0 26.555733-7.304533 46.148267-21.981867 58.811733-13.038933 11.264-30.037333 17.5104-50.961066 18.773333l-8.055467 0.238934z m166.5024 0h-50.9952v-245.623466h50.9952V584.157867z m-422.331733-56.149333l30.685866-96.6656H333.687467l31.6416 96.6656z m247.671466 13.5168c12.117333 0 21.504-2.730667 28.2624-8.192 6.724267-5.4272 10.069333-14.5408 10.069334-27.306667 0-12.765867-3.345067-22.1184-10.069334-27.989333-6.724267-5.905067-16.145067-8.874667-28.2624-8.874667h-47.8208v72.362667h47.8208zM830.634667 225.34826699999996l-148.957867-149.4016-46.865067-94.3104a34.133333 34.133333 0 0 1 41.301334-47.581867l102.741333 34.030933 156.672 152.746667a39.8336 39.8336 0 0 1-0.1024 56.32l-48.469333 48.298667a39.8336 39.8336 0 0 1-56.32-0.1024z m28.228266-52.224l24.132267-24.029867-134.519467-131.140267-38.434133-12.731733 18.432 37.0688 130.389333 130.833067z" horiz-adv-x="1024" />
<glyph glyph-name="DBbiaoshuru" unicode="&#59519;" d="M740.010667 839.099733l170.222933-171.4176v-306.0736c0-31.402667-25.4976-56.900267-56.900267-56.900266H170.666667c-31.402667 0-56.900267 25.4976-56.900267 56.900266V782.2336c0 31.402667 25.4976 56.866133 56.900267 56.866133h569.344zM853.333333 623.274667h-119.261866a51.2 51.2 0 0 0-51.2 51.2V782.2336H170.666667v-420.625067h682.666666V623.274667zM910.2336 384c31.402667 0 56.866133-25.463467 56.866133-56.900267v-341.333333c0-31.402667-25.463467-56.866133-56.866133-56.866133H113.7664c-31.402667 0-56.866133 25.463467-56.866133 56.866133v341.333333c0 31.402667 25.463467 56.900267 56.866133 56.900267h796.4672z m-252.859733-113.7664H537.6V42.66666699999996h111.7184c12.629333 0 24.302933 1.024 35.054933 3.072 10.752 2.048 20.104533 5.870933 27.989334 11.434666 7.031467 4.846933 12.9024 10.820267 17.578666 17.92 7.3728 10.683733 11.0592 22.801067 11.0592 36.283734 0 13.073067-3.208533 24.1664-9.6256 33.348266-6.417067 9.147733-15.906133 15.837867-28.535466 20.0704 8.260267 3.8912 14.506667 8.192 18.773333 12.970667 7.543467 8.430933 11.332267 19.592533 11.332267 33.450667a54.613333 54.613333 0 0 1-11.3664 34.781866c-11.537067 14.404267-30.481067 22.4256-56.866134 23.9616l-7.338666 0.273067z m-269.550934 0H281.6V42.66666699999996h106.222933c37.205333 0 64.785067 14.165333 82.602667 42.461866 13.175467 20.992 19.729067 46.626133 19.729067 76.868267 0 11.946667-1.536 24.507733-4.676267 37.6832a97.553067 97.553067 0 0 1-17.544533 36.727467 81.169067 81.169067 0 0 1-41.984 28.8768 125.1328 125.1328 0 0 1-29.2864 4.642133l-8.874667 0.3072z m260.334934-127.3856c10.717867-0.1024 19.012267-1.365333 24.917333-3.857067 10.581333-4.437333 15.906133-12.561067 15.906133-24.3712 0-13.994667-5.461333-23.483733-16.384-28.433066-6.0416-2.6624-14.472533-3.9936-25.258666-3.9936H586.752v60.654933h61.371733z m-269.038934 87.8592c23.415467 0 39.048533-6.212267 46.8992-18.602667 7.850667-12.424533 11.810133-30.173867 11.810134-53.3504 0-16.759467-2.628267-31.232-7.850667-43.349333-9.6256-22.152533-26.555733-33.211733-50.858667-33.211733H331.605333v148.48h47.5136z m261.8368 0c11.946667 0 21.742933-1.194667 29.457067-3.549867 8.9088-3.413333 13.380267-10.410667 13.380267-20.992 0-9.557333-3.413333-16.247467-10.1376-20.002133-6.724267-3.754667-15.530667-5.632-26.3168-5.632H586.752v50.176h54.1696zM393.454933 568.1493330000001l-5.3248-7.441066-43.4176-89.053867a33.143467 33.143467 0 0 1 40.379734-46.08l94.651733 31.8464 10.3424 6.280533 152.917333 147.012267a38.843733 38.843733 0 0 1-0.2048 54.852267l-48.7424 48.469333a38.638933 38.638933 0 0 1-54.613333 0l-145.988267-145.885867z m173.294934 94.993067l25.019733-24.917333-135.4752-130.1504-38.7072-13.1072 18.1248 37.205333 131.072 130.9696z" horiz-adv-x="1024" />
<glyph glyph-name="qingyingyong" unicode="&#59512;" d="M496 859.712a32 32 0 0 0 32 0l387.968-224a32 32 0 0 0 16-27.712v-448a32 32 0 0 0-16-27.712l-387.968-224a32 32 0 0 0-32 0l-387.968 224a32 32 0 0 0-16 27.712v448a32 32 0 0 0 16 27.712zM512 795.072L155.968 589.504v-410.944l325.888-188.16V364.16L236.288 500.544a32 32 0 0 0 25.792 58.304l5.312-2.304 248.128-137.856 324.16 187.136L512 795.072z m355.968-246.784L545.92 362.304l-0.064-369.728 322.112 185.984V548.288z" horiz-adv-x="1024" />
<glyph glyph-name="zaiExcelbiaozhongfenxi" unicode="&#59511;" d="M736.448 0c17.408 0 31.552-14.336 31.552-32s-14.08-32-31.552-32H287.552a31.488 31.488 0 0 0-27.328 16 32.384 32.384 0 0 0 0 32 31.488 31.488 0 0 0 27.328 16h448.896zM832 832a128 128 0 0 0 128-128v-512a128 128 0 0 0-128-128H192a128 128 0 0 0-128 128V704a128 128 0 0 0 128 128h640z m0-64H192a64 64 0 0 1-63.552-56.512L128 704v-512a64 64 0 0 1 56.512-63.552L192 128h640a64 64 0 0 1 63.552 56.512L896 192V704a64 64 0 0 1-56.512 63.552L832 768z m-96-80l-77.76-195.648a86.784 86.784 0 0 0-21.76-27.776c9.728-7.68 17.728-16.512 23.616-26.432l3.968-7.68L736 204.8h-85.504L586.88 410.624c-4.928 10.88-17.472 18.56-32.192 20.352l-6.4 0.384H479.936c-15.104 0-28.8-6.272-35.84-16l-2.56-4.48-71.04-206.08H288l76.544 226.56a88.32 88.32 0 0 0 18.368 25.472 92.352 92.352 0 0 0-31.488 34.688L288 687.68h84.544l57.664-176.32c5.184-10.432 17.92-17.856 32.96-19.52l5.76 0.64 11.008 0.32h71.04c12.992 2.432 23.68 9.408 28.16 18.816l69.248 176.384H736z" horiz-adv-x="1024" />
<glyph glyph-name="liebiao" unicode="&#59510;" d="M960 832a64 64 0 0 0 63.552-56.512L1024 768v-768a64 64 0 0 0-56.512-63.552L960-64H64a64 64 0 0 0-63.552 56.512L0 0V768a64 64 0 0 0 56.512 63.552L64 832h896z m0-64H64v-768h896V768zM256 256a64 64 0 1 0 0-128 64 64 0 0 0 0 128z m544-32a32 32 0 1 0 0-64h-384a32 32 0 1 0 0 64h384zM256 448a64 64 0 1 0 0-128 64 64 0 0 0 0 128z m544-32a32 32 0 1 0 0-64h-384a32 32 0 0 0 0 64h384zM256 640a64 64 0 1 0 0-128 64 64 0 0 0 0 128z m544-32a32 32 0 1 0 0-64h-384a32 32 0 0 0 0 64h384z" horiz-adv-x="1024" />
<glyph glyph-name="a-bianzu18" unicode="&#59509;" d="M64 224v-192a32 32 0 0 1 26.24-31.488L96 0h192v-64h-192a96 96 0 0 0-95.552 86.784L0 32v192h64z m960 0v-192a96 96 0 0 0-96-96h-192v64h192a32 32 0 0 1 32 32v192h64zM736 576a64 64 0 0 0 63.552-56.512L800 512v-128a64 64 0 0 0 63.552-56.512L864 320v-64a64 64 0 0 0-56.512-63.552L800 192h-64a64 64 0 0 0-63.552 56.512L672 256V320a64 64 0 0 0 56.512 63.552L736 384V512h-192v-128a64 64 0 0 0 63.552-56.512L608 320v-64a64 64 0 0 0-56.512-63.552L544 192h-64a64 64 0 0 0-63.552 56.512L416 256V320a64 64 0 0 0 56.512 63.552L480 384V512h-192v-128a64 64 0 0 0 63.552-56.512L352 320v-64a64 64 0 0 0-56.512-63.552L288 192h-64a64 64 0 0 0-63.552 56.512L160 256V320a64 64 0 0 0 56.512 63.552L224 384V512a64 64 0 0 0 64 64h448z m-448-256h-64v-64h64V320z m256 0h-64v-64h64V320z m256 0h-64v-64h64V320z m-512 512v-64h-192a32 32 0 0 1-32-32v-192H0v192A96 96 0 0 0 96 832h192z m640 0a96 96 0 0 0 95.552-86.784L1024 736v-192h-64v192a32 32 0 0 1-26.24 31.488L928 768h-192V832h192z" horiz-adv-x="1024" />
<glyph glyph-name="panding" unicode="&#59508;" d="M791.296 768a104.704 104.704 0 0 0 13.952-208.512c-17.792-43.264-42.048-82.688-69.952-113.088C703.36 411.712 653.44 384 608 384H442.24c-58.88 0-99.392-24.064-127.104-54.208a205.44 205.44 0 0 1-47.616-89.6l0.064-36.672a104.768 104.768 0 1 0-69.76 0V564.48a104.768 104.768 0 1 0 69.76 0v-183.36l4.288 4.352c39.04 38.656 94.912 68.352 170.304 68.352H608c16.96 0 49.664 11.328 75.84 39.808 19.392 21.12 37.504 49.024 51.84 80.896A104.704 104.704 0 0 0 791.296 768z m-558.592-628.352a34.88 34.88 0 1 1 0-69.824 34.88 34.88 0 0 1 0 69.76z m0 558.528a34.88 34.88 0 1 1 0-69.76 34.88 34.88 0 0 1 0 69.76z m558.528 0a34.88 34.88 0 1 1 0-69.76 34.88 34.88 0 0 1 0 69.76z" horiz-adv-x="1024" />
<glyph glyph-name="canshuyulan" unicode="&#59507;" d="M630.592-25.536a261.632 261.632 0 1 0 0 523.264 261.632 261.632 0 0 0 0-523.264z m0 465.536a203.904 203.904 0 1 1 203.904-203.904 204.48 204.48 0 0 1-203.904 203.904zM498.368 185.28a28.864 28.864 0 0 0-28.864 28.864c0 102.4 83.008 185.408 185.344 185.408a29.44 29.44 0 0 0 28.928-28.864c0-16-12.928-28.864-28.928-28.864-70.336-0.32-127.296-57.28-127.616-127.68 0-15.936-12.928-28.8-28.864-28.8z m369.984-141.184l58.88-58.88a32 32 0 1 0-45.248-45.248l-58.88 58.88a32 32 0 1 0 45.248 45.248zM384.768 0a32 32 0 0 0 5.76-63.488l-5.76-0.512H160a96 96 0 0 0-95.552 86.784L64 32V526.208l0.32 0.064 0.128 1.472a96 96 0 0 0 19.84 49.92l6.016 6.912L296.32 802.048a96 96 0 0 0 59.84 29.44L366.08 832H800a96 96 0 0 0 95.552-86.784L896 736v-227.264a32 32 0 0 0-26.24-31.488l-5.76-0.512a32 32 0 0 0-31.488 26.24L832 508.736V736a32 32 0 0 1-26.24 31.488L800 768H416.384l0.064-209.792A96 96 0 0 0 329.728 462.72l-9.28-0.448L128 462.272V32a32 32 0 0 1 26.24-31.488L160 0h224.768zM346.688 761.472l-3.904-3.456-206.016-217.472a32 32 0 0 1-7.808-14.272h191.488a32 32 0 0 1 31.488 26.24l0.512 5.76v206.72a32 32 0 0 1-5.76-3.52z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 426 KiB

After

Width:  |  Height:  |  Size: 451 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.

6
examples/config-render.html

@ -2,8 +2,10 @@
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.css"/>
<script src="../dist/2.0/fineui.js"></script>
<!-- <link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.min.css"/>
<script src="../dist/2.0/fineui.js"></script> -->
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css" />
<script src="http://fanruan.design/fineui/2.0/fineui.min.js"></script>
</head>
<body>
<div id="wrapper"></div>

445
examples/dev.html

@ -1,46 +1,419 @@
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="http://localhost:9001/fineui.css"/>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,minimum-scale=1" />
<meta http-equiv="x-ua-compatible" content="IE=edge" />
<title>PullRequest | Code Review as a Service</title>
<meta
name="description"
content="PullRequest is a platform for code review, built for teams of all sizes. We have thousands of on-demand reviewers and they are backed by best-in-class automation tools. Because code quality is important."
/>
<meta name="theme-color" content="#28557a" />
<link
rel="stylesheet"
type="text/css"
href="https://fanruan.design/fineui/2.0/fineui_without_normalize.css"
/>
<!-- <script src="../dist/2.0/fineui.js"></script>-->
<script src="http://localhost:9001/fineui.js"></script>
</head>
<body>
<div id="wrapper"></div>
<script>
BI.config("bi.provider.system", function (provider) {
<style>
*,
:after,
:before {
box-sizing: border-box;
}
* {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
html {
font-family: sans-serif;
line-height: 1.15;
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: transparent;
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, segoe ui, Roboto,
helvetica neue, Arial, noto sans, liberation sans, sans-serif,
apple color emoji, segoe ui emoji, segoe ui symbol, noto color emoji;
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #212529;
text-align: left;
height: 100vh;
background-color: #fff;
}
#wrapper {
height: 100vh;
}
.nav {
box-shadow: 0 2px 5px rgb(0 0 0 / 16%), 0 2px 10px rgb(0 0 0 / 12%);
}
.nav-logo {
background-image: url(https://www.pullrequest.com/images/pullrequest-logo.svg);
background-repeat: no-repeat;
background-position: 50%;
background-size: contain;
}
.image {
background-image: url(https://www.pullrequest.com/images/figures/home/hero-graphic.png);
background-repeat: no-repeat;
background-size: contain;
}
.demo {
cursor: pointer;
border-radius: 3px;
font-weight: 600;
color: #fff;
background: #4aa4e0 linear-gradient(180deg, #65b2e5, #4aa4e0) repeat-x;
border: 1px solid #4aa4e0;
}
.signup {
cursor: pointer;
border-radius: 3px;
font-weight: 600;
color: #4aa4e0;
border: 1px solid #4aa4e0;
}
.wave {
background-image: url(https://www.pullrequest.com/images/textures/home/wave1.png);
background-size: cover;
background-repeat: repeat-x;
}
</style>
</head>
<body>
<div id="wrapper"></div>
<script>
BI.config("bi.provider.system", function (provider) {
provider.setResponsiveMode(true);
});
var Widget = BI.inherit(BI.Widget, {
});
var Widget = BI.inherit(BI.Widget, {
props: {},
render: function () {
return {
type: "bi.vertical",
items: [{
return [
{
type: "bi.vertical",
items: [
{
el: {
type: "bi.vertical_adapt",
cls: "nav",
css: {
position: "fixed",
left: 0,
right: 0,
zIndex: 1000,
},
height: 62,
hgap: 16,
items: [
{
type: "bi.layout",
cls: "nav-logo",
width: 185,
height: 46,
},
],
},
},
{
tgap: 112,
el: {
type: "bi.center_adapt",
verticalAlign: "top",
height: 300,
columnSize: [300, "fill"],
items: [{
type: "bi.label",
css: {background: "#eee"},
text: "123"
}, {
type: "bi.label",
css: {background: "#e0e0e0"},
text: "123"
}]
}]
};
}
});
BI.shortcut("demo.responsive", Widget);
BI.createWidget({
columnSize: ["fill", "fill"],
vgap: 24,
items: [
{
el: {
type: "bi.vertical",
hgap: 15,
items: [
{
el: {
type: "bi.text",
css: {
fontSize: "24px",
fontWeight: "700",
color: "#092353",
},
text: "Code Review as a Service",
},
},
{
el: {
type: "bi.text",
css: {
fontSize: "16px",
lineHeight: "24px",
color: "#28557a",
},
text: "Increase velocity and reduce technical debt through quality code review by expert engineers backed by best-in-class automation.",
},
tgap: 24,
bgap: 24,
},
{
el: {
type: "bi.vertical_adapt",
vgap: 16,
items: [
{
el: {
type: "bi.label",
hgap: 24,
height: 48,
cls: "demo",
text: "Schedule demo",
},
},
{
el: {
type: "bi.label",
hgap: 24,
height: 48,
cls: "signup",
text: "Sign up",
},
lgap: 30,
rgap: 15,
},
],
},
},
],
},
},
{
el: {
type: "bi.vertical",
hgap: 15,
items: [
{
el: {
type: "bi.vertical",
items: [
{
type: "bi.img",
attributes: {
width: 595,
},
css: {
maxWidth: "100%",
maxHeight: "100%",
},
src: "https://www.pullrequest.com/images/figures/home/hero-graphic.png",
width: "auto",
height: "auto",
},
],
},
},
],
},
},
],
},
},
{
type: "bi.layout",
cls: "wave",
height: 112,
},
{
el: {
type: "bi.center_adapt",
columnSize: ["fill"],
css: {
background: "#f5fbff",
},
hgap: 0.1,
vgap: 64,
items: [
{
el: {
type: "bi.vertical",
hgap: 15,
items: [
{
type: "bi.text",
lineHeight: 30,
css: {
fontSize: "22px",
color: "#092353",
},
text: "Empower your development team with the help of world-class engineers. ",
},
{
type: "bi.text",
lineHeight: 24,
css: {
fontSize: "16px",
color: "#28557a",
},
text: "PullRequest provides on-demand code review by world-class engineers, built for teams of any size. We review within your tools to catch security threats, stop crashes, and fix performance issues before they reach production.",
},
],
},
},
],
},
},
{
el: {
type: "bi.center_adapt",
columnSize: ["fill", "fill"],
vgap: 48,
items: [
{
el: {
type: "bi.vertical",
hgap: 15,
items: [
{
el: {
type: "bi.text",
css: {
fontSize: "24px",
fontWeight: "700",
color: "#092353",
},
text: "Move fast and reduce cycle times.",
},
},
{
el: {
type: "bi.text",
css: {
fontSize: "16px",
lineHeight: "24px",
color: "#28557a",
},
text: "Save time reviewing code so you can focus on shipping new features.",
},
tgap: 24,
bgap: 24,
},
],
},
},
{
el: {
type: "bi.vertical",
hgap: 15,
items: [
{
el: {
type: "bi.vertical",
items: [
{
type: "bi.img",
attributes: {
width: 595,
},
css: {
maxWidth: "100%",
maxHeight: "100%",
},
src: "https://www.pullrequest.com/images/figures/home/velocity.png",
width: "auto",
height: "auto",
},
],
},
},
],
},
},
],
},
},
{
el: {
type: "bi.center_adapt",
css: {
background: "#f5fbff",
},
columnSize: ["fill", "fill"],
vgap: 48,
items: [
{
el: {
type: "bi.vertical",
hgap: 15,
items: [
{
el: {
type: "bi.vertical",
items: [
{
type: "bi.img",
attributes: {
width: 595,
},
css: {
maxWidth: "100%",
maxHeight: "100%",
},
src: "https://www.pullrequest.com/images/figures/home/secure.png",
width: "auto",
height: "auto",
},
],
},
},
],
},
},
{
el: {
type: "bi.vertical",
rgap: 15,
lgap: 0.1,
items: [
{
el: {
type: "bi.text",
css: {
fontSize: "24px",
fontWeight: "700",
color: "#092353",
},
text: "Secure your codebase.",
},
},
{
el: {
type: "bi.text",
css: {
fontSize: "16px",
lineHeight: "24px",
color: "#28557a",
},
text: "Deliver high quality code with an extra line of defense to prevent security vulnerabilities and other fatal flaws.",
},
tgap: 24,
bgap: 24,
},
],
},
},
],
},
},
],
},
];
},
});
BI.shortcut("demo.responsive", Widget);
BI.createWidget({
type: "demo.responsive",
element: "#wrapper"
});
</script>
</body>
element: "#wrapper",
});
</script>
</body>
</html>

6
examples/effect.html

@ -2,8 +2,10 @@
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.css"/>
<script src="../dist/2.0/fineui.js"></script>
<!-- <link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.min.css"/>
<script src="../dist/2.0/fineui.js"></script> -->
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css" />
<script src="http://fanruan.design/fineui/2.0/fineui.min.js"></script>
</head>
<body>
<div id="wrapper"></div>

6
examples/hooks.html

@ -2,8 +2,10 @@
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.css"/>
<script src="../dist/2.0/fineui.js"></script>
<!-- <link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.min.css"/>
<script src="../dist/2.0/fineui.js"></script> -->
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css" />
<script src="http://fanruan.design/fineui/2.0/fineui.min.js"></script>
</head>
<body>
<div id="wrapper"></div>

6
examples/loader-context.html

@ -2,8 +2,10 @@
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.css"/>
<script src="../dist/2.0/fineui.js"></script>
<!-- <link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.min.css"/>
<script src="../dist/2.0/fineui.js"></script> -->
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css" />
<script src="http://fanruan.design/fineui/2.0/fineui.min.js"></script>
</head>
<body>
<div id="wrapper"></div>

6
examples/resize.html

@ -2,8 +2,10 @@
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.css"/>
<script src="../dist/2.0/fineui.js"></script>
<!-- <link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.min.css"/>
<script src="../dist/2.0/fineui.js"></script> -->
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css" />
<script src="http://fanruan.design/fineui/2.0/fineui.min.js"></script>
</head>
<body>
<div id="wrapper"></div>

6
examples/style.html

@ -2,8 +2,10 @@
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.css"/>
<script src="../dist/2.0/fineui.js"></script>
<!-- <link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.min.css"/>
<script src="../dist/2.0/fineui.js"></script> -->
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css" />
<script src="http://fanruan.design/fineui/2.0/fineui.min.js"></script>
</head>
<body>
<div id="wrapper"></div>

6
examples/tab-context.html

@ -2,8 +2,10 @@
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.css"/>
<script src="../dist/2.0/fineui.js"></script>
<!-- <link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.min.css"/>
<script src="../dist/2.0/fineui.js"></script> -->
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css" />
<script src="http://fanruan.design/fineui/2.0/fineui.min.js"></script>
</head>
<body>
<div id="wrapper"></div>

6
examples/test-id.html

@ -2,8 +2,10 @@
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.css"/>
<script src="../dist/2.0/fineui.js"></script>
<!-- <link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.min.css"/>
<script src="../dist/2.0/fineui.js"></script> -->
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css" />
<script src="http://fanruan.design/fineui/2.0/fineui.min.js"></script>
</head>
<body>
<div id="wrapper"></div>

6
examples/virtual-group.html

@ -2,8 +2,10 @@
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.css"/>
<script src="../dist/2.0/fineui.js"></script>
<!-- <link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.min.css"/>
<script src="../dist/2.0/fineui.js"></script> -->
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css" />
<script src="http://fanruan.design/fineui/2.0/fineui.min.js"></script>
</head>
<body>
<div id="wrapper"></div>

6
examples/visible.html

@ -2,8 +2,10 @@
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.css"/>
<script src="../dist/2.0/fineui.js"></script>
<!-- <link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.min.css"/>
<script src="../dist/2.0/fineui.js"></script> -->
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css" />
<script src="http://fanruan.design/fineui/2.0/fineui.min.js"></script>
</head>
<body>
<div id="wrapper"></div>

6
examples/worker.html

@ -2,8 +2,10 @@
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.css"/>
<script src="../dist/2.0/fineui.js"></script>
<!-- <link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.min.css"/>
<script src="../dist/2.0/fineui.js"></script> -->
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css" />
<script src="http://fanruan.design/fineui/2.0/fineui.min.js"></script>
<script src="../dist/fix/worker.compact.js"></script>
<script src="demo.worker.js"></script>
</head>

419
examples/响应式布局.html

@ -0,0 +1,419 @@
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,minimum-scale=1" />
<meta http-equiv="x-ua-compatible" content="IE=edge" />
<title>PullRequest | Code Review as a Service</title>
<meta
name="description"
content="PullRequest is a platform for code review, built for teams of all sizes. We have thousands of on-demand reviewers and they are backed by best-in-class automation tools. Because code quality is important."
/>
<meta name="theme-color" content="#28557a" />
<link
rel="stylesheet"
type="text/css"
href="https://fanruan.design/fineui/2.0/fineui_without_normalize.css"
/>
<!-- <script src="../dist/2.0/fineui.js"></script>-->
<script src="https://fanruan.design/fineui/2.0/fineui.js"></script>
<style>
*,
:after,
:before {
box-sizing: border-box;
}
* {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
html {
font-family: sans-serif;
line-height: 1.15;
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: transparent;
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, segoe ui, Roboto,
helvetica neue, Arial, noto sans, liberation sans, sans-serif,
apple color emoji, segoe ui emoji, segoe ui symbol, noto color emoji;
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #212529;
text-align: left;
height: 100vh;
background-color: #fff;
}
#wrapper {
height: 100vh;
}
.nav {
box-shadow: 0 2px 5px rgb(0 0 0 / 16%), 0 2px 10px rgb(0 0 0 / 12%);
}
.nav-logo {
background-image: url(https://qn.wangchuan.cc/pullrequest-logo.svg);
background-repeat: no-repeat;
background-position: 50%;
background-size: contain;
}
.image {
background-image: url(https://qn.wangchuan.cc/hero-graphic.png);
background-repeat: no-repeat;
background-size: contain;
}
.demo {
cursor: pointer;
border-radius: 3px;
font-weight: 600;
color: #fff;
background: #4aa4e0 linear-gradient(180deg, #65b2e5, #4aa4e0) repeat-x;
border: 1px solid #4aa4e0;
}
.signup {
cursor: pointer;
border-radius: 3px;
font-weight: 600;
color: #4aa4e0;
border: 1px solid #4aa4e0;
}
.wave {
background-image: url(https://qn.wangchuan.cc/wave.png);
background-size: cover;
background-repeat: repeat-x;
}
</style>
</head>
<body>
<div id="wrapper"></div>
<script>
BI.config("bi.provider.system", function (provider) {
provider.setResponsiveMode(true);
});
var Widget = BI.inherit(BI.Widget, {
props: {},
render: function () {
return [
{
type: "bi.vertical",
items: [
{
el: {
type: "bi.vertical_adapt",
cls: "nav",
css: {
position: "fixed",
left: 0,
right: 0,
zIndex: 1000,
},
height: 62,
hgap: 16,
items: [
{
type: "bi.layout",
cls: "nav-logo",
width: 185,
height: 46,
},
],
},
},
{
tgap: 112,
el: {
type: "bi.center_adapt",
columnSize: ["fill", "fill"],
vgap: 24,
items: [
{
el: {
type: "bi.vertical",
hgap: 15,
items: [
{
el: {
type: "bi.text",
css: {
fontSize: "24px",
fontWeight: "700",
color: "#092353",
},
text: "Code Review as a Service",
},
},
{
el: {
type: "bi.text",
css: {
fontSize: "16px",
lineHeight: "24px",
color: "#28557a",
},
text: "Increase velocity and reduce technical debt through quality code review by expert engineers backed by best-in-class automation.",
},
tgap: 24,
bgap: 24,
},
{
el: {
type: "bi.vertical_adapt",
vgap: 16,
items: [
{
el: {
type: "bi.label",
hgap: 24,
height: 48,
cls: "demo",
text: "Schedule demo",
},
},
{
el: {
type: "bi.label",
hgap: 24,
height: 48,
cls: "signup",
text: "Sign up",
},
lgap: 30,
rgap: 15,
},
],
},
},
],
},
},
{
el: {
type: "bi.vertical",
hgap: 15,
items: [
{
el: {
type: "bi.vertical",
items: [
{
type: "bi.img",
attributes: {
width: 595,
},
css: {
maxWidth: "100%",
maxHeight: "100%",
},
src: "https://qn.wangchuan.cc/hero-graphic.png",
width: "auto",
height: "auto",
},
],
},
},
],
},
},
],
},
},
{
type: "bi.layout",
cls: "wave",
height: 112,
},
{
el: {
type: "bi.center_adapt",
columnSize: ["fill"],
css: {
background: "#f5fbff",
},
hgap: 0.1,
vgap: 64,
items: [
{
el: {
type: "bi.vertical",
hgap: 15,
items: [
{
type: "bi.text",
lineHeight: 30,
css: {
fontSize: "22px",
color: "#092353",
},
text: "Empower your development team with the help of world-class engineers. ",
},
{
type: "bi.text",
lineHeight: 24,
css: {
fontSize: "16px",
color: "#28557a",
},
text: "PullRequest provides on-demand code review by world-class engineers, built for teams of any size. We review within your tools to catch security threats, stop crashes, and fix performance issues before they reach production.",
},
],
},
},
],
},
},
{
el: {
type: "bi.center_adapt",
columnSize: ["fill", "fill"],
vgap: 48,
items: [
{
el: {
type: "bi.vertical",
hgap: 15,
items: [
{
el: {
type: "bi.text",
css: {
fontSize: "24px",
fontWeight: "700",
color: "#092353",
},
text: "Move fast and reduce cycle times.",
},
},
{
el: {
type: "bi.text",
css: {
fontSize: "16px",
lineHeight: "24px",
color: "#28557a",
},
text: "Save time reviewing code so you can focus on shipping new features.",
},
tgap: 24,
bgap: 24,
},
],
},
},
{
el: {
type: "bi.vertical",
hgap: 15,
items: [
{
el: {
type: "bi.vertical",
items: [
{
type: "bi.img",
attributes: {
width: 595,
},
css: {
maxWidth: "100%",
maxHeight: "100%",
},
src: "https://qn.wangchuan.cc/velocity.png",
width: "auto",
height: "auto",
},
],
},
},
],
},
},
],
},
},
{
el: {
type: "bi.center_adapt",
css: {
background: "#f5fbff",
},
columnSize: ["fill", "fill"],
vgap: 48,
items: [
{
el: {
type: "bi.vertical",
hgap: 15,
items: [
{
el: {
type: "bi.vertical",
items: [
{
type: "bi.img",
attributes: {
width: 595,
},
css: {
maxWidth: "100%",
maxHeight: "100%",
},
src: "https://qn.wangchuan.cc/secure.png",
width: "auto",
height: "auto",
},
],
},
},
],
},
},
{
el: {
type: "bi.vertical",
rgap: 15,
lgap: 0.1,
items: [
{
el: {
type: "bi.text",
css: {
fontSize: "24px",
fontWeight: "700",
color: "#092353",
},
text: "Secure your codebase.",
},
},
{
el: {
type: "bi.text",
css: {
fontSize: "16px",
lineHeight: "24px",
color: "#28557a",
},
text: "Deliver high quality code with an extra line of defense to prevent security vulnerabilities and other fatal flaws.",
},
tgap: 24,
bgap: 24,
},
],
},
},
],
},
},
],
},
];
},
});
BI.shortcut("demo.responsive", Widget);
BI.createWidget({
type: "demo.responsive",
element: "#wrapper",
});
</script>
</body>
</html>

8
examples/插件设计.html

@ -2,10 +2,10 @@
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.min.css"/>
<script src="../dist/2.0/fineui.js"></script>
<!-- <link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css" />-->
<!-- <script src="http://fanruan.design/fineui/2.0/fineui.min.js"></script>-->
<!-- <link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.min.css"/>
<script src="../dist/2.0/fineui.js"></script> -->
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css" />
<script src="http://fanruan.design/fineui/2.0/fineui.min.js"></script>
</head>
<body>
<div id="wrapper"></div>

3
i18n/i18n.cn.js

@ -197,5 +197,6 @@ BI.i18n = {
"BI-Basic_Year_Month_Range_Error": "请选择{R1}年{R2}月-{R3}年{R4}月的日期",
"BI-Basic_Year_Quarter_Range_Error": "请选择{R1}年{R2}季度-{R3}年{R4}季度的日期",
"BI-Basic_Search_And_Patch_Paste": "搜索,支持批量粘贴、粘贴值通过换行识别",
"BI-Basic_Recommend_Color": "推荐色"
"BI-Basic_Recommend_Color": "推荐色",
"BI-Basic_Too_Much_Value_Get_Two_Thousand": "粘贴的值过多,只能识别出前2000个值"
};

2
package.json

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

16
src/base/single/button/button.basic.js

@ -31,13 +31,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
_init: function () {
BI.BasicButton.superclass._init.apply(this, arguments);
var opts = this.options;
if (opts.selected === true) {
BI.nextTick(BI.bind(function () {
this.setSelected(opts.selected);
}, this));
}
BI.nextTick(BI.bind(this.bindEvent, this));
if (opts.shadow) {
this._createShadow();
}
@ -46,6 +40,14 @@ BI.BasicButton = BI.inherit(BI.Single, {
}
},
_initRef: function () {
if (this.options.selected === true) {
this.setSelected(true);
}
this.bindEvent();
BI.BasicButton.superclass._initRef.apply(this, arguments);
},
// 默认render方法
render: function () {
return this.options.el;

17
src/base/single/button/button.node.js

@ -9,18 +9,17 @@
BI.NodeButton = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.NodeButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend( conf, {
return BI.extend(conf, {
_baseCls: (conf._baseCls || "") + " bi-node",
open: false
});
},
_init: function () {
BI.NodeButton.superclass._init.apply(this, arguments);
var self = this;
BI.nextTick(function () {
self.setOpened(self.isOpened());
});
_initRef: function () {
if (this.isOpened()) {
this.setOpened(this.isOpened());
}
BI.NodeButton.superclass._initRef.apply(this, arguments);
},
doClick: function () {
@ -41,14 +40,14 @@ BI.NodeButton = BI.inherit(BI.BasicButton, {
},
triggerCollapse: function () {
if(this.isOpened()) {
if (this.isOpened()) {
this.setOpened(false);
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, this.getValue(), this);
}
},
triggerExpand: function () {
if(!this.isOpened()) {
if (!this.isOpened()) {
this.setOpened(true);
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, this.getValue(), this);
}

13
src/base/single/input/input.js

@ -24,7 +24,7 @@ BI.Input = BI.inherit(BI.Single, {
var _keydown = BI.debounce(function (keyCode) {
self.onKeyDown(keyCode, ctrlKey);
self._keydown_ = false;
}, BI.EVENT_RESPONSE_TIME);
}, 300);
var _clk = BI.debounce(BI.bind(this._click, this), BI.EVENT_RESPONSE_TIME, {
"leading": true,
"trailing": false
@ -33,7 +33,10 @@ BI.Input = BI.inherit(BI.Single, {
"leading": true,
"trailing": false
});
this._blurDebounce = BI.debounce(BI.bind(this._blur, this), BI.EVENT_RESPONSE_TIME);
this._blurDebounce = BI.debounce(BI.bind(this._blur, this), BI.EVENT_RESPONSE_TIME, {
"leading": true,
"trailing": false
});
this.element
.keydown(function (e) {
inputEventValid = false;
@ -92,7 +95,11 @@ BI.Input = BI.inherit(BI.Single, {
_blur: function () {
var self = this;
blur();
if (self._keydown_ === true) {
BI.delay(blur, 300);
} else {
blur();
}
function blur () {
if (!self.isValid() && self.options.quitChecker.apply(self, [BI.trim(self.getValue())]) !== false) {

1
src/base/single/input/radio/radio.js

@ -19,7 +19,6 @@ BI.Radio = BI.inherit(BI.BasicButton, {
var self = this, o = this.options;
return {
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.layout",
cls: "radio-content",

1
src/case/editor/editor.sign.js

@ -176,6 +176,7 @@ BI.SignEditor = BI.inherit(BI.Widget, {
setWaterMark: function (v) {
this.options.watermark = v;
this._checkText();
this.editor.setWaterMark(v);
},

2
src/case/ztree/0.treeview.js

@ -55,7 +55,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
});
BI.createWidget({
type: "bi.default",
element: this.element,
element: this,
items: [this.tree]
});
},

83
src/core/6.inject.js

@ -150,6 +150,11 @@
}
};
BI.config = BI.config || function (type, configFn, opt) {
if (BI.isFunction(type)) {
opt = configFn;
configFn = type;
type = "bi.provider.system";
}
opt = opt || {};
// 系统配置直接执行
@ -171,84 +176,6 @@
fn: configFn,
opt: opt
});
// // 初始化过或者系统配置需要立刻执行
// if (BI.initialized || "bi.provider.system" === type) {
// if (constantInjection[type]) {
// return (constantInjection[type] = configFn(constantInjection[type]));
// }
// if (providerInjection[type]) {
// if (!providers[type]) {
// providers[type] = new providerInjection[type]();
// }
// // 如果config被重新配置的话,需要删除掉之前的实例
// if (providerInstance[type]) {
// delete providerInstance[type];
// }
// return configFn(providers[type]);
// }
// return BI.Plugin.configWidget(type, configFn, opt);
// }
// if (!configFunctions[type]) {
// configFunctions[type] = [];
// BI.prepares.push(function () {
// var queue = configFunctions[type];
// var dependencies = BI.Providers.getProvider("bi.provider.system").getDependencies();
// var modules = moduleInjectionMap.components[type]
// || moduleInjectionMap.constants[type]
// || moduleInjectionMap.services[type]
// || moduleInjectionMap.stores[type]
// || moduleInjectionMap.models[type]
// || moduleInjectionMap.providers[type];
// for (var i = 0; i < queue.length; i++) {
// var conf = queue[i];
// var version = conf.opt.version;
// var fn = conf.fn;
// if (modules && version) {
// var findVersion = false;
// for (var j = 0; j < modules.length; j++) {
// var module = modules[i];
// if (module && dependencies[module.moduleId] && module.version === version) {
// var minVersion = dependencies[module.moduleId].minVersion,
// maxVersion = dependencies[module.moduleId].maxVersion;
// if (minVersion && (moduleInjection[module.moduleId].version || version) < minVersion) {
// findVersion = true;
// break;
// }
// if (maxVersion && (moduleInjection[module.moduleId].version || version) > maxVersion) {
// findVersion = true;
// break;
// }
// }
// }
// if (findVersion === true) {
// _global.console && console.error("moduleId: [" + module.moduleId + "] 接口: [" + type + "] 接口版本: [" + version + "] 已过期,版本要求为:", dependencies[module.moduleId], "=>", moduleInjection[module.moduleId]);
// continue;
// }
// }
// if (constantInjection[type]) {
// constantInjection[type] = fn(constantInjection[type]);
// continue;
// }
// if (providerInjection[type]) {
// if (!providers[type]) {
// providers[type] = new providerInjection[type]();
// }
// if (providerInstance[type]) {
// delete providerInstance[type];
// }
// fn(providers[type]);
// continue;
// }
// BI.Plugin.configWidget(type, fn);
// }
// configFunctions[type] = null;
// });
// }
// configFunctions[type].push({
// fn: configFn,
// opt: opt
// });
};
BI.getReference = BI.getReference || function (type, fn) {

4
src/core/platform/web/config.js

@ -162,7 +162,7 @@ BI.prepares.push(function () {
});
BI.Plugin.configWidget("bi.flex_horizontal", function (ob) {
if (ob.scrollable === true || ob.scrollx !== false) {
if (ob.hgap > 0 || ob.rgap > 0) {// flex中最后一个margin-right不生效
if (ob.hgap > 0 || ob.lgap > 0 || ob.rgap > 0) {
if (BI.Providers.getProvider("bi.provider.system").getResponsiveMode()) {
return BI.extend({}, ob, {type: "bi.responsive_flex_scrollable_horizontal"});
}
@ -175,7 +175,7 @@ BI.prepares.push(function () {
});
BI.Plugin.configWidget("bi.flex_vertical", function (ob) {
if (ob.scrollable === true || ob.scrollx === true) {
if (ob.hgap > 0 || ob.rgap > 0) {// flex中最后一个margin-right不生效
if (ob.hgap > 0 || ob.lgap > 0 || ob.rgap > 0) {
return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical"});
}
}

55
src/core/wrapper/layout.js

@ -267,26 +267,73 @@ BI.Layout = BI.inherit(BI.Widget, {
this.options.items.splice(index, 1);
},
_clearGap: function (w) {
w.element.css({
"margin-top": "",
"margin-bottom": "",
"margin-left": "",
"margin-right": "",
})
},
_optimiseGap: function (gap) {
return gap > 0 && gap < 1 ? (gap * 100).toFixed(1) + "%" : gap / BI.pixRatio + BI.pixUnit;
},
_handleGap: function (w, item, hIndex, vIndex) {
var o = this.options;
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
var top = ((BI.isNull(vIndex) || vIndex === 0) ? o.vgap : 0) + o.tgap + (item.tgap || 0) + (item.vgap || 0);
w.element.css({
"margin-top": (((BI.isNull(vIndex) || vIndex === 0) ? o.vgap : 0) + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit
"margin-top": this._optimiseGap(top)
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
var left = ((BI.isNull(hIndex) || hIndex === 0) ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0);
w.element.css({
"margin-left": (((BI.isNull(hIndex) || hIndex === 0) ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit
"margin-left": this._optimiseGap(left)
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
var right = o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0);
w.element.css({
"margin-right": (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit
"margin-right": this._optimiseGap(right)
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
var bottom = o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0);
w.element.css({
"margin-bottom": this._optimiseGap(bottom)
});
}
},
// 横向换纵向
_handleReverseGap: function (w, item, index) {
var o = this.options;
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
var top = (index === 0 ? o.vgap : 0) + (index === 0 ? o.tgap : 0) + (item.tgap || 0) + (item.vgap || 0);
w.element.css({
"margin-top": this._optimiseGap(top)
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
var left = o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0);
w.element.css({
"margin-left": this._optimiseGap(left)
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
var right = o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0);
w.element.css({
"margin-right": this._optimiseGap(right)
});
}
// 这里的代码是关键
if (o.vgap + o.hgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
var bottom = (index === o.items.length - 1 ? o.vgap : o.hgap) + (index === o.items.length - 1 ? o.bgap : 0) + (item.bgap || 0) + (item.vgap || 0);
w.element.css({
"margin-bottom": (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit
"margin-bottom": this._optimiseGap(bottom)
});
}
},

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

@ -26,10 +26,10 @@ BI.AbsoluteCenterLayout = BI.inherit(BI.Layout, {
var w = BI.AbsoluteCenterLayout.superclass._addElement.apply(this, arguments);
w.element.css({
position: "absolute",
left: (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit,
right: (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit,
top: (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit,
bottom: (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit,
left: this._optimiseGap(o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0)),
right: this._optimiseGap(o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)),
top: this._optimiseGap(o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)),
bottom: this._optimiseGap(o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)),
margin: "auto"
});
return w;

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

@ -48,9 +48,7 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
var td, width = "";
var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width;
if (columnSize > 0) {
width = columnSize < 1 ?
((columnSize * 100).toFixed(1) + "%")
: (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap);
width = this._optimiseGap(columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap);
}
if ((BI.isNull(columnSize) || columnSize === "") && this._hasFill()) {
width = 2;
@ -71,17 +69,16 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
if (o.verticalAlign === BI.VerticalAlign.Stretch) {
var top = o.vgap + o.tgap + (item.tgap || 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% - " + this._optimiseGap(top + bottom) + ")");
}
// 对于表现为td的元素设置最大宽度,有几点需要注意
// 1、由于直接对td设置最大宽度是在规范中未定义的, 所以要使用类似td:firstChild来迂回实现
// 2、不能给多个td设置最大宽度,这样只会平分宽度
// 3、多百分比宽度就算了
if (columnSize > 0) {
columnSize = columnSize < 1 ? width : width / BI.pixRatio + BI.pixUnit;
td.element.css({
"max-width": columnSize,
"min-width": columnSize
"max-width": width,
"min-width": width
});
}
if (i === 0) {

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

@ -43,42 +43,42 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, {
}
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit
"margin-top": self._optimiseGap(o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0))
});
}
if (desc) {
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": ((i === o.items.length - 1 ? o.hgap : 0) + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit
"margin-right": self._optimiseGap((i === o.items.length - 1 ? o.hgap : 0) + o.rgap + (item.rgap || 0) + (item.hgap || 0))
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit
"margin-left": self._optimiseGap(o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0))
});
}
} else {
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": ((i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit
"margin-left": self._optimiseGap((i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0))
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit
"margin-right": self._optimiseGap(o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0))
});
}
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit
"margin-bottom": self._optimiseGap(o.vgap + o.bgap + (item.bgap || 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);
if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) {
w.element.css({
height: "calc(100% - " + ((top + bottom) / BI.pixRatio + BI.pixUnit) + ")"
height: "calc(100% - " + self._optimiseGap(top + bottom) + ")"
});
}
w.element.css({

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

@ -74,7 +74,7 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
}
}
if (columnSize > 0) {
w.element.width(columnSize < 1 ? ((columnSize * 100).toFixed(1) + "%") : (columnSize / BI.pixRatio + BI.pixUnit));
w.element.width(this._optimiseGap(columnSize));
}
if (columnSize === "fill") {
w.element.addClass("f-f");

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

@ -73,7 +73,7 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, {
}
}
if (rowSize > 0) {
w.element.height(rowSize < 1 ? ((rowSize * 100).toFixed(1) + "%") : (rowSize / BI.pixRatio + BI.pixUnit));
w.element.height(this._optimiseGap(rowSize));
}
if (rowSize === "fill") {
w.element.addClass("f-f");

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

@ -70,7 +70,7 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, {
}
}
if (columnSize > 0) {
w.element.width(columnSize < 1 ? ((columnSize * 100).toFixed(1) + "%") : (columnSize / BI.pixRatio + BI.pixUnit));
w.element.width(this._optimiseGap(columnSize));
}
if (columnSize === "fill") {
w.element.addClass("f-f");

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

@ -70,7 +70,7 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, {
}
}
if (rowSize > 0) {
w.element.height(rowSize < 1 ? ((rowSize * 100).toFixed(1) + "%") : (rowSize / BI.pixRatio + BI.pixUnit));
w.element.height(this._optimiseGap(rowSize));
}
if (rowSize === "fill") {
w.element.addClass("f-f");

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

@ -25,57 +25,57 @@ BI.AbsoluteLayout = BI.inherit(BI.Layout, {
var w = BI.AbsoluteLayout.superclass._addElement.apply(this, arguments);
var left = 0, right = 0, top = 0, bottom = 0;
if (BI.isNotNull(item.left)) {
w.element.css({left: BI.isNumber(item.left) ? item.left / BI.pixRatio + BI.pixUnit : item.left});
w.element.css({left: BI.isNumber(item.left) ? this._optimiseGap(item.left) : item.left});
left += item.left;
}
if (BI.isNotNull(item.right)) {
w.element.css({right: BI.isNumber(item.right) ? item.right / BI.pixRatio + BI.pixUnit : item.right});
w.element.css({right: BI.isNumber(item.right) ? this._optimiseGap(item.right) : item.right});
right += item.right;
}
if (BI.isNotNull(item.top)) {
w.element.css({top: BI.isNumber(item.top) ? item.top / BI.pixRatio + BI.pixUnit : item.top});
w.element.css({top: BI.isNumber(item.top) ? this._optimiseGap(item.top) : item.top});
top += item.top;
}
if (BI.isNotNull(item.bottom)) {
w.element.css({bottom: BI.isNumber(item.bottom) ? item.bottom / BI.pixRatio + BI.pixUnit : item.bottom});
w.element.css({bottom: BI.isNumber(item.bottom) ? this._optimiseGap(item.bottom) : item.bottom});
bottom += item.bottom;
}
if (BI.isNotNull(o.hgap)) {
left += o.hgap;
w.element.css({left: left / BI.pixRatio + BI.pixUnit});
w.element.css({left: this._optimiseGap(left)});
right += o.hgap;
w.element.css({right: right / BI.pixRatio + BI.pixUnit});
w.element.css({right: this._optimiseGap(right)});
}
if (BI.isNotNull(o.vgap)) {
top += o.vgap;
w.element.css({top: top / BI.pixRatio + BI.pixUnit});
w.element.css({top: this._optimiseGap(top)});
bottom += o.vgap;
w.element.css({bottom: bottom / BI.pixRatio + BI.pixUnit});
w.element.css({bottom: this._optimiseGap(bottom)});
}
if (BI.isNotNull(o.lgap)) {
left += o.lgap;
w.element.css({left: left / BI.pixRatio + BI.pixUnit});
w.element.css({left: this._optimiseGap(left)});
}
if (BI.isNotNull(o.rgap)) {
right += o.rgap;
w.element.css({right: right / BI.pixRatio + BI.pixUnit});
w.element.css({right: this._optimiseGap(right)});
}
if (BI.isNotNull(o.tgap)) {
top += o.tgap;
w.element.css({top: top / BI.pixRatio + BI.pixUnit});
w.element.css({top: this._optimiseGap(top)});
}
if (BI.isNotNull(o.bgap)) {
bottom += o.bgap;
w.element.css({bottom: bottom / BI.pixRatio + BI.pixUnit});
w.element.css({bottom: this._optimiseGap(bottom)});
}
if (BI.isNotNull(item.width)) {
w.element.css({width: BI.isNumber(item.width) ? item.width / BI.pixRatio + BI.pixUnit : item.width});
w.element.css({width: BI.isNumber(item.width) ? this._optimiseGap(item.width) : item.width});
}
if (BI.isNotNull(item.height)) {
w.element.css({height: BI.isNumber(item.height) ? item.height / BI.pixRatio + BI.pixUnit : item.height});
w.element.css({height: BI.isNumber(item.height) ? this._optimiseGap(item.height) : item.height});
}
w.element.css({position: "absolute"});
return w;

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

@ -21,32 +21,32 @@ BI.AdaptiveLayout = BI.inherit(BI.Layout, {
w.element.css({position: "relative"});
if (BI.isNotNull(item.left)) {
w.element.css({
left: BI.isNumber(item.left) ? item.left / BI.pixRatio + BI.pixUnit : item.left
left: BI.isNumber(item.left) ? this._optimiseGap(item.left) : item.left
});
}
if (BI.isNotNull(item.right)) {
w.element.css({
right: BI.isNumber(item.right) ? item.right / BI.pixRatio + BI.pixUnit : item.right
right: BI.isNumber(item.right) ? this._optimiseGap(item.right) : item.right
});
}
if (BI.isNotNull(item.top)) {
w.element.css({
top: BI.isNumber(item.top) ? item.top / BI.pixRatio + BI.pixUnit : item.top
top: BI.isNumber(item.top) ? this._optimiseGap(item.top) : item.top
});
}
if (BI.isNotNull(item.bottom)) {
w.element.css({
bottom: BI.isNumber(item.bottom) ? item.bottom / BI.pixRatio + BI.pixUnit : item.bottom
bottom: BI.isNumber(item.bottom) ? this._optimiseGap(item.bottom) : item.bottom
});
}
this._handleGap(w, item);
if (BI.isNotNull(item.width)) {
w.element.css({width: BI.isNumber(item.width) ? item.width / BI.pixRatio + BI.pixUnit : item.width});
w.element.css({width: BI.isNumber(item.width) ? this._optimiseGap(item.width) : item.width});
}
if (BI.isNotNull(item.height)) {
w.element.css({height: BI.isNumber(item.height) ? item.height / BI.pixRatio + BI.pixUnit : item.height});
w.element.css({height: BI.isNumber(item.height) ? this._optimiseGap(item.height) : item.height});
}
return w;
},

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

@ -35,12 +35,12 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
var w = BI._lazyCreateWidget(item);
this.addWidget(this._getChildName("north"), w);
}
this.getWidgetByName(this._getChildName("north")).element.height(item.height / BI.pixRatio + BI.pixUnit)
this.getWidgetByName(this._getChildName("north")).element.height(this._optimiseGap(item.height))
.css({
position: "absolute",
top: (item.top || 0) / BI.pixRatio + BI.pixUnit,
left: (item.left || 0) / BI.pixRatio + BI.pixUnit,
right: (item.right || 0) / BI.pixRatio + BI.pixUnit,
top: this._optimiseGap(item.top || 0),
left: this._optimiseGap(item.left || 0),
right: this._optimiseGap(item.right || 0),
bottom: "initial"
});
}
@ -55,12 +55,12 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
var w = BI._lazyCreateWidget(item);
this.addWidget(this._getChildName("south"), w);
}
this.getWidgetByName(this._getChildName("south")).element.height(item.height / BI.pixRatio + BI.pixUnit)
this.getWidgetByName(this._getChildName("south")).element.height(this._optimiseGap(item.height))
.css({
position: "absolute",
bottom: (item.bottom || 0) / BI.pixRatio + BI.pixUnit,
left: (item.left || 0) / BI.pixRatio + BI.pixUnit,
right: (item.right || 0) / BI.pixRatio + BI.pixUnit,
bottom: this._optimiseGap(item.bottom || 0),
left: this._optimiseGap(item.left || 0),
right: this._optimiseGap(item.right || 0),
top: "initial"
});
}
@ -75,12 +75,12 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
var w = BI._lazyCreateWidget(item);
this.addWidget(this._getChildName("west"), w);
}
this.getWidgetByName(this._getChildName("west")).element.width(item.width / BI.pixRatio + BI.pixUnit)
this.getWidgetByName(this._getChildName("west")).element.width(this._optimiseGap(item.width))
.css({
position: "absolute",
left: (item.left || 0) / BI.pixRatio + BI.pixUnit,
top: top / BI.pixRatio + BI.pixUnit,
bottom: bottom / BI.pixRatio + BI.pixUnit,
left: this._optimiseGap(item.left || 0),
top: this._optimiseGap(top),
bottom: this._optimiseGap(bottom),
right: "initial"
});
}
@ -95,12 +95,12 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
var w = BI._lazyCreateWidget(item);
this.addWidget(this._getChildName("east"), w);
}
this.getWidgetByName(this._getChildName("east")).element.width(item.width / BI.pixRatio + BI.pixUnit)
this.getWidgetByName(this._getChildName("east")).element.width(this._optimiseGap(item.width))
.css({
position: "absolute",
right: (item.right || 0) / BI.pixRatio + BI.pixUnit,
top: top / BI.pixRatio + BI.pixUnit,
bottom: bottom / BI.pixRatio + BI.pixUnit,
right: this._optimiseGap(item.right || 0),
top: this._optimiseGap(top),
bottom: this._optimiseGap(bottom),
left: "initial"
});
}
@ -117,10 +117,10 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
this.getWidgetByName(this._getChildName("center")).element
.css({
position: "absolute",
top: top / BI.pixRatio + BI.pixUnit,
bottom: bottom / BI.pixRatio + BI.pixUnit,
left: left / BI.pixRatio + BI.pixUnit,
right: right / BI.pixRatio + BI.pixUnit
top: this._optimiseGap(top),
bottom: this._optimiseGap(bottom),
left: this._optimiseGap(left),
right: this._optimiseGap(right)
});
}
}

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

@ -38,7 +38,13 @@ BI.CardLayout = BI.inherit(BI.Layout, {
} else {
var w = self.getWidgetByName(self._getChildName(item.cardName));
}
w.element.css({position: "absolute", top: "0", right: "0", bottom: "0", left: "0"});
w.element.css({
position: "relative",
top: "0",
left: "0",
width: "100%",
height: "100%"
});
w.setVisible(false);
}
});

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

@ -30,35 +30,39 @@ BI.FloatLeftLayout = BI.inherit(BI.Layout, {
var w = BI.FloatLeftLayout.superclass._addElement.apply(this, arguments);
w.element.css({position: "relative", float: "left"});
if (BI.isNotNull(item.left)) {
w.element.css({left: BI.isNumber(item.left) ? item.left / BI.pixRatio + BI.pixUnit : item.left});
w.element.css({left: BI.isNumber(item.left) ? this._optimiseGap(item.left) : item.left});
}
if (BI.isNotNull(item.right)) {
w.element.css({right: BI.isNumber(item.right) ? item.right / BI.pixRatio + BI.pixUnit : item.right});
w.element.css({right: BI.isNumber(item.right) ? this._optimiseGap(item.right) : item.right});
}
if (BI.isNotNull(item.top)) {
w.element.css({top: BI.isNumber(item.top) ? item.top / BI.pixRatio + BI.pixUnit : item.top});
w.element.css({top: BI.isNumber(item.top) ? this._optimiseGap(item.top) : item.top});
}
if (BI.isNotNull(item.bottom)) {
w.element.css({bottom: BI.isNumber(item.bottom) ? item.bottom / BI.pixRatio + BI.pixUnit : item.bottom});
w.element.css({bottom: BI.isNumber(item.bottom) ? this._optimiseGap(item.bottom) : item.bottom});
}
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
var top = o.vgap / 2 + o.tgap + (item.tgap || 0) + (item.vgap || 0);
w.element.css({
"margin-top": (o.vgap / 2 + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit
"margin-top": this._optimiseGap(top)
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
var left = o.hgap / 2 + o.lgap + (item.lgap || 0) + (item.hgap || 0);
w.element.css({
"margin-left": (o.hgap / 2 + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit
"margin-left": this._optimiseGap(left)
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
var right = o.hgap / 2 + o.rgap + (item.rgap || 0) + (item.hgap || 0);
w.element.css({
"margin-right": (o.hgap / 2 + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit
"margin-right": this._optimiseGap(right)
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
var bottom = o.vgap / 2 + o.bgap + (item.bgap || 0) + (item.vgap || 0);
w.element.css({
"margin-bottom": (o.vgap / 2 + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit
"margin-bottom": this._optimiseGap(bottom)
});
}
return w;

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

@ -52,7 +52,7 @@ BI.InlineLayout = BI.inherit(BI.Layout, {
});
w.element.addClass("i-item");
if (columnSize === "fill" || columnSize === "") {
var length = o.hgap;
var length = 0, gap = o.hgap;
var fillCount = 0, autoCount = 0;
for (var k = 0, len = o.columnSize.length || o.items.length; k < len; k++) {
var cz = o.columnSize.length > 0 ? o.columnSize[k] : o.items[k].width;
@ -63,16 +63,19 @@ BI.InlineLayout = BI.inherit(BI.Layout, {
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;
gap += o.hgap + o.lgap + o.rgap + (o.items[k].lgap || 0) + (o.items[k].rgap || 0) + (o.items[k].hgap || 0);
length += cz;
}
length = length > 0 && length < 1 ? (length * 100).toFixed(1) + "%" : length / BI.pixRatio + BI.pixUnit;
gap = gap > 0 && gap < 1 ? (gap * 100).toFixed(1) + "%" : gap / BI.pixRatio + BI.pixUnit;
if (columnSize === "fill") {
w.element.css("min-width", "calc((100% - " + (length / BI.pixRatio + BI.pixUnit) + ")" + (fillCount > 1 ? "/" + fillCount : "") + ")");
w.element.css("min-width", "calc((100% - " + length + " - " + gap + ")" + (fillCount > 1 ? "/" + fillCount : "") + ")");
}
if (o.horizontalAlign === BI.HorizontalAlign.Stretch || !(o.scrollable === true || o.scrollx === true)) {
if (columnSize === "fill") {
w.element.css("max-width", "calc((100% - " + (length / BI.pixRatio + BI.pixUnit) + ")" + (fillCount > 1 ? "/" + fillCount : "") + ")");
w.element.css("max-width", "calc((100% - " + length + " - " + gap + ")" + (fillCount > 1 ? "/" + fillCount : "") + ")");
} else {
w.element.css("max-width", "calc((100% - " + (length / BI.pixRatio + BI.pixUnit) + ")" + (autoCount > 1 ? "/" + autoCount : "") + ")");
w.element.css("max-width", "calc((100% - " + length + " - " + gap + ")" + (autoCount > 1 ? "/" + autoCount : "") + ")");
}
}
}
@ -80,7 +83,8 @@ BI.InlineLayout = BI.inherit(BI.Layout, {
if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) {
var top = o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0),
bottom = o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0);
w.element.css("height", "calc(100% - " + ((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 + ")");
}
return w;
},

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

@ -69,8 +69,8 @@ BI.TableLayout = BI.inherit(BI.Layout, {
abs.push(BI.extend({
top: 0,
bottom: 0,
left: o.columnSize[i] < 1 ? (left * 100).toFixed(1) + "%" : left,
width: o.columnSize[i] < 1 ? (o.columnSize[i] * 100).toFixed(1) + "%" : o.columnSize[i]
left: this._optimiseGap(left),
width: this._optimiseGap(o.columnSize[i])
}, arr[i]));
left += o.columnSize[i] + (o.columnSize[i] < 1 ? 0 : o.hgap);
} else {
@ -83,8 +83,8 @@ BI.TableLayout = BI.inherit(BI.Layout, {
abs.push(BI.extend({
top: 0,
bottom: 0,
right: o.columnSize[j] < 1 ? (right * 100).toFixed(1) + "%" : right,
width: o.columnSize[j] < 1 ? (o.columnSize[j] * 100).toFixed(1) + "%" : o.columnSize[j]
right: this._optimiseGap(right),
width: this._optimiseGap(o.columnSize[j])
}, arr[j]));
right += o.columnSize[j] + (o.columnSize[j] < 1 ? 0 : o.hgap);
} else {
@ -96,8 +96,8 @@ BI.TableLayout = BI.inherit(BI.Layout, {
abs.push(BI.extend({
top: 0,
bottom: 0,
left: left < 1 ? (left * 100).toFixed(1) + "%" : left,
right: right < 1 ? (right * 100).toFixed(1) + "%" : right
left: this._optimiseGap(left),
right: this._optimiseGap(right)
}, arr[i]));
}
var w = BI._lazyCreateWidget({
@ -107,7 +107,7 @@ BI.TableLayout = BI.inherit(BI.Layout, {
});
if (this.rows > 0) {
this.getWidgetByName(this._getChildName(this.rows - 1)).element.css({
"margin-bottom": o.vgap / BI.pixRatio + BI.pixUnit
"margin-bottom": this._optimiseGap(o.vgap)
});
}
w.element.css({

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

@ -43,8 +43,8 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
}
w.element.css({
position: "absolute",
top: ((item.vgap || 0) + (item.tgap || 0) + o.vgap + o.tgap) / BI.pixRatio + BI.pixUnit,
bottom: ((item.bgap || 0) + (item.vgap || 0) + o.vgap + o.bgap) / BI.pixRatio + BI.pixUnit
top: self._optimiseGap((item.vgap || 0) + (item.tgap || 0) + o.vgap + o.tgap),
bottom: self._optimiseGap((item.bgap || 0) + (item.vgap || 0) + o.vgap + o.bgap)
});
if (o.verticalAlign === BI.VerticalAlign.Middle) {
w.element.css({
@ -77,17 +77,11 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
var preColumnSize = o.columnSize.length > 0 ? o.columnSize[i - 1] : items[i - 1].width;
left[i] = left[i - 1] + preColumnSize + (items[i - 1].lgap || 0) + (items[i - 1].rgap || 0) + 2 * (items[i - 1].hgap || 0) + o.hgap + o.lgap + o.rgap;
}
if (columnSize < 1 && columnSize > 0) {
w.element.css({
left: (left[i] * 100).toFixed(1) + "%",
width: (columnSize * 100).toFixed(1) + "%"
});
} else {
w.element.css({
left: (left[i] + (item.lgap || 0) + (item.hgap || 0) + o.hgap + o.lgap) / BI.pixRatio + BI.pixUnit,
width: BI.isNumber(columnSize) ? columnSize / BI.pixRatio + BI.pixUnit : ""
});
}
w.element.css({
left: self._optimiseGap(left[i] + (item.lgap || 0) + (item.hgap || 0) + o.hgap + o.lgap),
width: BI.isNumber(columnSize) ? self._optimiseGap(columnSize) : ""
});
if (columnSize === "" || columnSize === "fill") {
return true;
}
@ -102,17 +96,11 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
var nextColumnSize = o.columnSize.length > 0 ? o.columnSize[i + 1] : items[i + 1].width;
right[i] = right[i + 1] + nextColumnSize + (items[i + 1].lgap || 0) + (items[i + 1].rgap || 0) + 2 * (items[i + 1].hgap || 0) + o.hgap + o.lgap + o.rgap;
}
if (columnSize < 1 && columnSize > 0) {
w.element.css({
right: (right[i] * 100).toFixed(1) + "%",
width: (columnSize * 100).toFixed(1) + "%"
});
} else {
w.element.css({
right: (right[i] + (item.rgap || 0) + (item.hgap || 0) + o.hgap + o.rgap) / BI.pixRatio + BI.pixUnit,
width: BI.isNumber(columnSize) ? columnSize / BI.pixRatio + BI.pixUnit : ""
});
}
w.element.css({
right: self._optimiseGap(right[i] + (item.rgap || 0) + (item.hgap || 0) + o.hgap + o.rgap),
width: BI.isNumber(columnSize) ? self._optimiseGap(columnSize) : ""
});
if (columnSize === "" || columnSize === "fill") {
return true;
}
@ -175,8 +163,8 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
}
w.element.css({
position: "absolute",
left: ((item.lgap || 0) + (item.hgap || 0) + o.hgap + o.lgap) / BI.pixRatio + BI.pixUnit,
right: ((item.hgap || 0) + (item.rgap || 0) + o.hgap + o.rgap) / BI.pixRatio + BI.pixUnit
left: self._optimiseGap((item.lgap || 0) + (item.hgap || 0) + o.hgap + o.lgap),
right: self._optimiseGap((item.hgap || 0) + (item.rgap || 0) + o.hgap + o.rgap)
});
if (o.horizontalAlign === BI.HorizontalAlign.Center) {
w.element.css({
@ -209,17 +197,11 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
var preRowSize = o.rowSize.length > 0 ? o.rowSize[i - 1] : items[i - 1].height;
top[i] = top[i - 1] + preRowSize + (items[i - 1].tgap || 0) + (items[i - 1].bgap || 0) + 2 * (items[i - 1].vgap || 0) + o.vgap + o.tgap + o.bgap;
}
if (rowSize < 1 && rowSize > 0) {
w.element.css({
top: (top[i] * 100).toFixed(1) + "%",
height: (rowSize * 100).toFixed(1) + "%"
});
} else {
w.element.css({
top: (top[i] + (item.vgap || 0) + (item.tgap || 0) + o.vgap + o.tgap) / BI.pixRatio + BI.pixUnit,
height: BI.isNumber(rowSize) ? rowSize / BI.pixRatio + BI.pixUnit : ""
});
}
w.element.css({
top: self._optimiseGap(top[i] + (item.vgap || 0) + (item.tgap || 0) + o.vgap + o.tgap),
height: BI.isNumber(rowSize) ? self._optimiseGap(rowSize) : ""
});
if (rowSize === "" || rowSize === "fill") {
return true;
}
@ -234,17 +216,11 @@ BI.VTapeLayout = BI.inherit(BI.Layout, {
var nextRowSize = o.rowSize.length > 0 ? o.rowSize[i + 1] : items[i + 1].height;
bottom[i] = bottom[i + 1] + nextRowSize + (items[i + 1].tgap || 0) + (items[i + 1].bgap || 0) + 2 * (items[i + 1].vgap || 0) + o.vgap + o.tgap + o.bgap;
}
if (rowSize < 1 && rowSize > 0) {
w.element.css({
bottom: (bottom[i] * 100).toFixed(1) + "%",
height: (rowSize * 100).toFixed(1) + "%"
});
} else {
w.element.css({
bottom: (bottom[i] + (item.vgap || 0) + (item.bgap || 0) + o.vgap + o.bgap) / BI.pixRatio + BI.pixUnit,
height: BI.isNumber(rowSize) ? rowSize / BI.pixRatio + BI.pixUnit : ""
});
}
w.element.css({
bottom: self._optimiseGap(bottom[i] + (item.vgap || 0) + (item.bgap || 0) + o.vgap + o.bgap),
height: BI.isNumber(rowSize) ? self._optimiseGap(rowSize) : ""
});
if (rowSize === "" || rowSize === "fill") {
return true;
}

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

@ -75,15 +75,14 @@ BI.TdLayout = BI.inherit(BI.Layout, {
}
}
var height = o.rowSize[idx] === "" ? "" : (o.rowSize[idx] < 1 ? ((o.rowSize[idx] * 100).toFixed(1) + "%") : o.rowSize[idx]);
var rowHeight = BI.isNumber(o.rowSize[idx]) ? (o.rowSize[idx] <= 1 ? height : height / BI.pixRatio + BI.pixUnit) : height;
var height = o.rowSize[idx] === "" ? "" : this._optimiseGap(o.rowSize[idx]);
var tr = BI._lazyCreateWidget({
type: "bi.default",
tagName: "tr",
height: height,
css: {
"max-height": rowHeight,
"min-height": rowHeight
"max-height": height,
"min-height": height
}
});
@ -92,37 +91,16 @@ BI.TdLayout = BI.inherit(BI.Layout, {
if (o.verticalAlign === BI.VerticalAlign.Stretch) {
var top = o.vgap + o.tgap + (arr[i].tgap || 0) + (arr[i].vgap || 0),
bottom = o.vgap + o.bgap + (arr[i].bgap || 0) + (arr[i].vgap || 0);
w.element.css("height", "calc(100% - " + ((top + bottom) / BI.pixRatio + BI.pixUnit) + ")");
w.element.css("height", "calc(100% - " + this._optimiseGap(top + bottom) + ")");
}
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
var item = arr[i];
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": ((i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit
});
}
this._handleGap(w, item, i);
first(w, this.rows++, i);
var width = "";
var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width;
if (columnSize > 0) {
width = columnSize < 1 ?
((columnSize * 100).toFixed(1) + "%")
: (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap);
width = this._optimiseGap(columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap);
}
function hasFill() {
if (o.columnSize.length > 0) {
@ -148,10 +126,9 @@ BI.TdLayout = BI.inherit(BI.Layout, {
// 2、不能给多个td设置最大宽度,这样只会平分宽度
// 3、多百分比宽度就算了
if (columnSize > 0) {
columnSize = columnSize < 1 ? width : width / BI.pixRatio + BI.pixUnit;
td.element.css({
"max-width": columnSize,
"min-width": columnSize
"max-width": width,
"min-width": width
});
}
td.element.css({

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

@ -100,9 +100,9 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
if (BI.isNull(top[i])) {
top[i] = top[i - 1] + (o.rowSize[i - 1] < 1 ? o.rowSize[i - 1] : o.rowSize[i - 1] + o.vgap + o.bgap);
}
var t = top[i] <= 1 ? (top[i] * 100).toFixed(1) + "%" : (top[i] + o.vgap + o.tgap) / BI.pixRatio + BI.pixUnit, h = "";
var t = this._optimiseGap(top[i] + o.vgap + o.tgap), h = "";
if (BI.isNumber(o.rowSize[i])) {
h = o.rowSize[i] <= 1 ? (o.rowSize[i] * 100).toFixed(1) + "%" : o.rowSize[i] / BI.pixRatio + BI.pixUnit;
h = this._optimiseGap(o.rowSize[i]);
}
wi.element.css({top: t, height: h});
first(wi, i, j);
@ -118,9 +118,9 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
if (BI.isNull(bottom[i])) {
bottom[i] = bottom[i + 1] + (o.rowSize[i + 1] < 1 ? o.rowSize[i + 1] : o.rowSize[i + 1] + o.vgap + o.tgap);
}
var b = bottom[i] <= 1 ? (bottom[i] * 100).toFixed(1) + "%" : (bottom[i] + o.vgap + o.bgap) / BI.pixRatio + BI.pixUnit, h = "";
var b = this._optimiseGap(bottom[i] + o.vgap + o.bgap), h = "";
if (BI.isNumber(o.rowSize[i])) {
h = o.rowSize[i] <= 1 ? (o.rowSize[i] * 100).toFixed(1) + "%" : o.rowSize[i] / BI.pixRatio + BI.pixUnit;
h = this._optimiseGap(o.rowSize[i]);
}
wi.element.css({bottom: b, height: h});
first(wi, i, j);
@ -136,9 +136,9 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
if (BI.isNull(left[j])) {
left[j] = left[j - 1] + (o.columnSize[j - 1] < 1 ? o.columnSize[j - 1] : o.columnSize[j - 1] + o.hgap + o.rgap);
}
var l = left[j] <= 1 ? (left[j] * 100).toFixed(1) + "%" : (left[j] + o.hgap + o.lgap) / BI.pixRatio + BI.pixUnit, w = "";
var l = this._optimiseGap(left[j] + o.hgap + o.lgap), w = "";
if (BI.isNumber(o.columnSize[j])) {
w = o.columnSize[j] <= 1 ? (o.columnSize[j] * 100).toFixed(1) + "%" : o.columnSize[j] / BI.pixRatio + BI.pixUnit;
w = this._optimiseGap(o.columnSize[j]);
}
wi.element.css({left: l, width: w});
first(wi, i, j);
@ -154,9 +154,9 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
if (BI.isNull(right[j])) {
right[j] = right[j + 1] + (o.columnSize[j + 1] < 1 ? o.columnSize[j + 1] : o.columnSize[j + 1] + o.hgap + o.lgap);
}
var r = right[j] <= 1 ? (right[j] * 100).toFixed(1) + "%" : (right[j] + o.hgap + o.rgap) / BI.pixRatio + BI.pixUnit, w = "";
var r = this._optimiseGap(right[j] + o.hgap + o.rgap), w = "";
if (BI.isNumber(o.columnSize[j])) {
w = o.columnSize[j] <= 1 ? (o.columnSize[j] * 100).toFixed(1) + "%" : o.columnSize[j] / BI.pixRatio + BI.pixUnit;
w = this._optimiseGap(o.columnSize[j]);
}
wi.element.css({right: r, width: w});
first(wi, i, j);

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

@ -35,10 +35,10 @@ BI.CenterLayout = BI.inherit(BI.Layout, {
var w = BI._lazyCreateWidget(item);
w.element.css({
position: "absolute",
left: (o.hgap + o.lgap) / BI.pixRatio + BI.pixUnit,
right: (o.hgap + o.rgap) / BI.pixRatio + BI.pixUnit,
top: (o.vgap + o.tgap) / BI.pixRatio + BI.pixUnit,
bottom: (o.vgap + o.bgap) / BI.pixRatio + BI.pixUnit,
left: self._optimiseGap(o.hgap + o.lgap),
right: self._optimiseGap(o.hgap + o.rgap),
top: self._optimiseGap(o.vgap + o.tgap),
bottom: self._optimiseGap(o.vgap + o.bgap),
width: "auto",
height: "auto"
});

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

@ -36,10 +36,10 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, {
var w = BI._lazyCreateWidget(item);
w.element.css({
position: "absolute",
left: (o.hgap + o.lgap) / BI.pixRatio + BI.pixUnit,
right: (o.hgap + o.rgap) / BI.pixRatio + BI.pixUnit,
top: (o.vgap + o.tgap) / BI.pixRatio + BI.pixUnit,
bottom: (o.vgap + o.bgap) / BI.pixRatio + BI.pixUnit,
left: self._optimiseGap(o.hgap + o.lgap),
right: self._optimiseGap(o.hgap + o.rgap),
top: self._optimiseGap(o.vgap + o.tgap),
bottom: self._optimiseGap(o.vgap + o.bgap),
width: "auto",
height: "auto"
});

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

@ -34,10 +34,10 @@ BI.HorizontalCenterLayout = BI.inherit(BI.Layout, {
var w = BI._lazyCreateWidget(item);
w.element.css({
position: "absolute",
left: (o.hgap + o.lgap) / BI.pixRatio + BI.pixUnit,
right: (o.hgap + o.rgap) / BI.pixRatio + BI.pixUnit,
top: (o.vgap + o.tgap) / BI.pixRatio + BI.pixUnit,
bottom: (o.vgap + o.bgap) / BI.pixRatio + BI.pixUnit,
left: self._optimiseGap(o.hgap + o.lgap),
right: self._optimiseGap(o.hgap + o.rgap),
top: self._optimiseGap(o.vgap + o.tgap),
bottom: self._optimiseGap(o.vgap + o.bgap),
width: "auto"
});
list[i].el.addItem(w);

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

@ -35,10 +35,10 @@ BI.VerticalCenterLayout = BI.inherit(BI.Layout, {
var w = BI._lazyCreateWidget(item);
w.element.css({
position: "absolute",
left: (o.hgap + o.lgap) / BI.pixRatio + BI.pixUnit,
right: (o.hgap + o.rgap) / BI.pixRatio + BI.pixUnit,
top: (o.vgap + o.tgap) / BI.pixRatio + BI.pixUnit,
bottom: (o.vgap + o.bgap) / BI.pixRatio + BI.pixUnit,
left: self._optimiseGap(o.hgap + o.lgap),
right: self._optimiseGap(o.hgap + o.rgap),
top: self._optimiseGap(o.vgap + o.tgap),
bottom: self._optimiseGap(o.vgap + o.bgap),
height: "auto"
});
list[i].el.addItem(w);

70
src/core/wrapper/layout/responsive/responsive.flex.horizontal.js

@ -6,42 +6,52 @@
* @extends BI.FlexHorizontalLayout
*/
BI.ResponsiveFlexHorizontalLayout = BI.inherit(BI.FlexHorizontalLayout, {
props: function () {
return BI.extend(BI.ResponsiveFlexHorizontalLayout.superclass.props.apply(this, arguments), {
extraCls: "bi-responsive-f-h"
});
},
// props: function () {
// return BI.extend(BI.ResponsiveFlexHorizontalLayout.superclass.props.apply(this, arguments), {
// // extraCls: "bi-responsive-f-h"
// });
// },
_addElement: function (i, item) {
var w = BI.ResponsiveFlexHorizontalLayout.superclass._addElement.apply(this, arguments);
var o = this.options;
var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width >= 1 ? null : item.width;
if (o.columnSize.length > 0) {
if (item.width >= 1 && o.columnSize[i] >= 1 && o.columnSize[i] !== item.width) {
columnSize = null;
}
mounted: function () {
var self = this, o = this.options;
if (o.horizontalAlign !== BI.HorizontalAlign.Center){
return;
}
if (columnSize === "fill") {
// 给自适应列设置一个min-width
var length = 0;
var fillCount = 0, autoCount = 0;
for (var k = 0, len = o.columnSize.length || o.items.length; k < len; k++) {
var cz = o.columnSize.length > 0 ? o.columnSize[k] : o.items[k].width;
if (cz === "fill") {
fillCount++;
cz = 0;
} else if (cz === "" || BI.isNull(cz)) {
autoCount++;
cz = 0;
var defaultResize = function () {
if (o.scrollable !== true && o.scrollx !== true) {
var clientWidth = document.body.clientWidth;
if(self.element.width() > 2/3 * clientWidth){
if (clientWidth <= 768) {
BI.each(self._children, function (i, child) {
self._clearGap(child);
self._handleReverseGap(child, o.items[i], i | 0);
});
self.element.css("flex-direction", "column");
}
}
length += cz;
}
var count = (o.columnSize.length || o.items.length) - fillCount - autoCount;
if (count > 0) {
w.element.css("min-width", length / count / BI.pixRatio + BI.pixUnit);
}
var resize = function () {
defaultResize();
if (o.scrollable !== true && o.scrollx !== true) {
var clientWidth = document.body.clientWidth;
if(self.element.width() > 2/3 * clientWidth){
if (clientWidth > 768) {
BI.each(self._children, function (i, child) {
self._clearGap(child);
})
self.resize();
self.element.css("flex-direction", "row");
}
}
}
}
return w;
this.unResize = BI.Resizers.add(this.getName(), resize);
defaultResize();
},
destroyed: function () {
this.unResize();
}
});
BI.shortcut("bi.responsive_flex_horizontal", BI.ResponsiveFlexHorizontalLayout);

72
src/core/wrapper/layout/responsive/responsive.flex.wrapper.horizontal.js

@ -6,42 +6,54 @@
* @extends BI.FlexWrapperHorizontalLayout
*/
BI.ResponsiveFlexWrapperHorizontalLayout = BI.inherit(BI.FlexWrapperHorizontalLayout, {
props: function () {
return BI.extend(BI.ResponsiveFlexWrapperHorizontalLayout.superclass.props.apply(this, arguments), {
extraCls: "bi-responsive-f-h"
});
},
// props: function () {
// return BI.extend(BI.ResponsiveFlexWrapperHorizontalLayout.superclass.props.apply(this, arguments), {
// extraCls: "bi-responsive-f-h"
// });
// },
_addElement: function (i, item) {
var w = BI.ResponsiveFlexHorizontalLayout.superclass._addElement.apply(this, arguments);
var o = this.options;
var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width >= 1 ? null : item.width;
if (o.columnSize.length > 0) {
if (item.width >= 1 && o.columnSize[i] >= 1 && o.columnSize[i] !== item.width) {
columnSize = null;
}
mounted: function () {
var self = this, o = this.options;
if (o.horizontalAlign !== BI.HorizontalAlign.Center){
return;
}
if (columnSize === "fill") {
// 给自适应列设置一个min-width
var length = 0;
var fillCount = 0, autoCount = 0;
for (var k = 0, len = o.columnSize.length || o.items.length; k < len; k++) {
var cz = o.columnSize.length > 0 ? o.columnSize[k] : o.items[k].width;
if (cz === "fill") {
fillCount++;
cz = 0;
} else if (cz === "" || BI.isNull(cz)) {
autoCount++;
cz = 0;
var defaultResize = function () {
if (o.scrollable !== true && o.scrollx !== true) {
var clientWidth = document.body.clientWidth;
if(self.element.width() > 2/3 * clientWidth){
if (clientWidth <= 768) {
BI.each(self._children, function (i, child) {
self._clearGap(child);
self._handleReverseGap(child, o.items[i], i | 0);
});
self.element.css("flex-direction", "column");
self.$wrapper.element.css("flex-direction", "column");
}
}
length += cz;
}
var count = (o.columnSize.length || o.items.length) - fillCount - autoCount;
if (count > 0) {
w.element.css("min-width", length / count / BI.pixRatio + BI.pixUnit);
}
var resize = function () {
defaultResize();
if (o.scrollable !== true && o.scrollx !== true) {
var clientWidth = document.body.clientWidth;
if(self.element.width() > 2/3 * clientWidth){
if (clientWidth > 768) {
BI.each(self._children, function (i, child) {
self._clearGap(child);
})
self.resize();
self.element.css("flex-direction", "row");
self.$wrapper.element.css("flex-direction", "row");
}
}
}
}
return w;
this.unResize = BI.Resizers.add(this.getName(), resize);
defaultResize();
},
destroyed: function () {
this.unResize();
}
});
BI.shortcut("bi.responsive_flex_scrollable_horizontal", BI.ResponsiveFlexWrapperHorizontalLayout);

81
src/core/wrapper/layout/responsive/responsive.inline..js

@ -6,60 +6,45 @@
* @extends BI.InlineLayout
*/
BI.ResponsiveInlineLayout = BI.inherit(BI.InlineLayout, {
_addElement: function (i, item) {
var o = this.options;
var w = BI.InlineLayout.superclass._addElement.apply(this, arguments);
var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width >= 1 ? null : item.width;
if (o.columnSize.length > 0) {
if (item.width >= 1 && o.columnSize[i] >= 1 && o.columnSize[i] !== item.width) {
columnSize = null;
}
}
if (columnSize > 0) {
w.element.width(columnSize < 1 ? ((columnSize * 100).toFixed(1) + "%") : (columnSize / BI.pixRatio + BI.pixUnit));
mounted: function () {
var self = this, o = this.options;
if (o.horizontalAlign !== BI.HorizontalAlign.Center){
return;
}
w.element.css({
position: "relative",
"vertical-align": o.verticalAlign
});
w.element.addClass("i-item");
if (columnSize === "fill" || columnSize === "") {
var length = o.hgap, czs = 0;
var fillCount = 0, autoCount = 0;
for (var k = 0, len = o.columnSize.length || o.items.length; k < len; k++) {
var cz = o.columnSize.length > 0 ? o.columnSize[k] : o.items[k].width;
if (cz === "fill") {
fillCount++;
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;
czs += cz;
}
if (columnSize === "fill") {
var count = (o.columnSize.length || o.items.length) - fillCount - autoCount;
if (count > 0) {
w.element.css("min-width", czs / count / BI.pixRatio + BI.pixUnit);
var defaultResize = function () {
if (o.scrollable !== true && o.scrollx !== true) {
var clientWidth = document.body.clientWidth;
if(self.element.width() > 2/3 * clientWidth){
if (clientWidth <= 768) {
BI.each(self._children, function (i, child) {
self._clearGap(child);
self._handleReverseGap(child, o.items[i], i | 0);
child.elemenet.css("display", "");
});
}
}
w.element.css("width", "calc((100% - " + (length / BI.pixRatio + BI.pixUnit) + ")" + (fillCount > 1 ? "/" + fillCount : "") + ")");
}
if (o.horizontalAlign === BI.HorizontalAlign.Stretch || !(o.scrollable === true || o.scrollx === true)) {
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 : "") + ")");
}
var resize = function () {
defaultResize();
if (o.scrollable !== true && o.scrollx !== true) {
var clientWidth = document.body.clientWidth;
if(self.element.width() > 2/3 * clientWidth){
if (clientWidth > 768) {
BI.each(self._children, function (i, child) {
self._clearGap(child);
})
self.resize();
}
}
}
}
this._handleGap(w, item, i);
if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) {
var top = o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0),
bottom = o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0);
w.element.css("height", "calc(100% - " + ((top + bottom) / BI.pixRatio + BI.pixUnit) + ")");
}
return w;
this.unResize = BI.Resizers.add(this.getName(), resize);
defaultResize();
},
destroyed: function () {
this.unResize();
}
});
BI.shortcut("bi.responsive_inline", BI.ResponsiveInlineLayout);

10
src/less/base/single/button/switch.less

@ -3,7 +3,7 @@
.bi-switch{
.border-radius(40px 40px 40px 40px);
background-color: @color-bi-background-dark-gray;
&:active, &.active {
&.active {
background-color: @color-bi-background-highlight;
}
& .circle-button{
@ -11,23 +11,17 @@
}
&.disabled {
background-color: @color-bi-background-disabled;
&:active {
background-color: @color-bi-background-disabled;
}
}
}
.bi-theme-dark {
.bi-switch{
background-color: @color-bi-background-dark-gray-theme-dark;
&:active, &.active {
&.active {
background-color: @color-bi-background-highlight;
}
&.disabled {
background-color: @color-bi-background-disabled-theme-dark;
&:active {
background-color: @color-bi-background-disabled-theme-dark;
}
}
}
}

11
src/less/core/wrapper/flex.horizontal.less

@ -62,17 +62,6 @@
-o-flex-wrap: nowrap;
flex-wrap: nowrap;
&.bi-responsive-f-h {
/* 09版 */
/*-webkit-box-lines: multiple;*/
/* 12版 */
-webkit-flex-wrap: wrap;
-moz-flex-wrap: wrap;
-ms-flex-wrap: wrap;
-o-flex-wrap: wrap;
flex-wrap: wrap;
}
&.v-middle {
/* 09版 */
-webkit-box-align: center;

13
src/less/core/wrapper/flex.wrapper.horizontal.less

@ -269,17 +269,4 @@
flex-grow: 1;
}
}
&.bi-responsive-f-h {
& .f-s-h-w {
/* 09版 */
/*-webkit-box-lines: multiple;*/
/* 12版 */
-webkit-flex-wrap: wrap;
-moz-flex-wrap: wrap;
-ms-flex-wrap: wrap;
-o-flex-wrap: wrap;
flex-wrap: wrap;
}
}
}

1
src/less/modern.less

@ -18,7 +18,6 @@
//base case
@import "base/pane.less";
@import "base/calendar/calendar.year.less";
@import "base/colorchooser/colorchooser.trigger.less";
@import "base/colorchooser/colorchooser.popup.less";
@import "base/colorchooser/colorpicker/button.colorpicker.less";

0
src/core/proto/number.js → src/polyfill/number.js

49
src/snabbdom/element2Snabbdom.js

@ -1,49 +0,0 @@
!function () {
var patch = BI.Snabbdom.init([BI.Snabbdom.attributesModule, BI.Snabbdom.classModule, BI.Snabbdom.datasetModule, BI.Snabbdom.propsModule, BI.Snabbdom.styleModule, BI.Snabbdom.eventListenersModule]);
BI.Element2Vnode = function (parentNode) {
if (parentNode.nodeType === 3) {
return BI.Snabbdom.vnode(undefined, undefined, undefined, parentNode.textContent, parentNode);
}
var data = BI.jQuery._data(parentNode);
var on = {};
BI.each(data && data.events, function (eventName, events) {
on[eventName] = function () {
var ob = this, args = arguments;
BI.each(events, function (i, ev) {
ev.handler.apply(ob, args);
});
};
});
var attrs = {};
var elmAttrs = parentNode.attributes;
var elmChildren = parentNode.childNodes;
var key = parentNode.getAttribute("key");
for (var i = 0, n = elmAttrs.length; i < n; i++) {
var name = elmAttrs[i].nodeName;
if (name !== "id" && name !== "class") {
attrs[name] = elmAttrs[i].nodeValue;
}
}
var vnode = BI.Snabbdom.vnode(parentNode.nodeName, {
class: BI.makeObject(parentNode.classList),
attrs: attrs,
key: key,
on: on,
hook: {
create: function () {
BI.each(BI.Widget._renderEngine.createElement(parentNode).data("__widgets"), function (i, w) {
w.element = BI.Widget._renderEngine.createElement(vnode.elm);
});
}
}
}, BI.map(elmChildren, function (i, childNode) {
return BI.Element2Vnode(childNode);
}), undefined, parentNode);
return vnode;
};
BI.patchVNode = function (element, node) {
patch(element, node);
};
}();

1052
src/snabbdom/snabbdom.js

File diff suppressed because it is too large Load Diff

3
src/widget/multiselect/multiselect.insert.combo.js

@ -81,7 +81,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
self._joinKeywords(keywords.slice(0, 2000), function () {
if (BI.endWith(last, BI.BlankSplitChar)) {
self.combo.setValue(self.storeValue);
assertShowValue();
@ -93,6 +93,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
}
self._dataChange = true;
});
keywords.length > 2000 && BI.Msg.alert(BI.i18nText("BI-Basic_Prompt"), BI.i18nText("BI-Basic_Too_Much_Value_Get_Two_Thousand"));
}
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_SEARCHING);
});

3
src/widget/multiselect/multiselect.insert.combo.nobar.js

@ -76,7 +76,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
self._joinKeywords(keywords.slice(0, 2000), function () {
if (BI.endWith(last, BI.BlankSplitChar)) {
self.combo.setValue(self.storeValue);
assertShowValue();
@ -88,6 +88,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
}
self._dataChange = true;
});
keywords.length > 2000 && BI.Msg.alert(BI.i18nText("BI-Basic_Prompt"), BI.i18nText("BI-Basic_Too_Much_Value_Get_Two_Thousand"));
}
});

3
src/widget/multiselectlist/multiselectlist.insert.js

@ -126,7 +126,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
self._joinKeywords(keywords.slice(0, 2000), function () {
if (BI.endWith(last, BI.BlankSplitChar)) {
self.adapter.setValue(self.storeValue);
assertShowValue();
@ -138,6 +138,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
}
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
});
keywords.length > 2000 && BI.Msg.alert(BI.i18nText("BI-Basic_Prompt"), BI.i18nText("BI-Basic_Too_Much_Value_Get_Two_Thousand"));
}
}
}, {

3
src/widget/multiselectlist/multiselectlist.insert.nobar.js

@ -129,7 +129,7 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
self._joinKeywords(keywords.slice(0, 2000), function () {
if (BI.endWith(last, BI.BlankSplitChar)) {
self.adapter.setValue(self.storeValue);
assertShowValue();
@ -141,6 +141,7 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
}
self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE);
});
keywords.length > 2000 && BI.Msg.alert(BI.i18nText("BI-Basic_Prompt"), BI.i18nText("BI-Basic_Too_Much_Value_Get_Two_Thousand"));
}
}
}, {

6
src/widget/numberinterval/numberinterval.js

@ -66,7 +66,7 @@ BI.NumberInterval = BI.inherit(BI.Single, {
});
BI.createWidget({
type: "bi.absolute",
element: this.smallEditor.element,
element: this.smallEditor,
items: [{
el: this.smallTip,
top: 0,
@ -104,7 +104,7 @@ BI.NumberInterval = BI.inherit(BI.Single, {
});
BI.createWidget({
type: "bi.absolute",
element: this.bigEditor.element,
element: this.bigEditor,
items: [{
el: this.bigTip,
top: 0,
@ -548,4 +548,4 @@ BI.NumberInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.NumberInterval.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.NumberInterval.EVENT_VALID = "EVENT_VALID";
BI.NumberInterval.EVENT_ERROR = "EVENT_ERROR";
BI.shortcut("bi.number_interval", BI.NumberInterval);
BI.shortcut("bi.number_interval", BI.NumberInterval);

Loading…
Cancel
Save