Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/router/router.js
es6
Kobi 3 years ago
parent
commit
aa84949b7b
  1. 2
      bi.lessconfig.json
  2. BIN
      dist/font/iconfont.eot
  3. 22
      dist/font/iconfont.svg
  4. BIN
      dist/font/iconfont.ttf
  5. BIN
      dist/font/iconfont.woff
  6. BIN
      dist/font/iconfont.woff2
  7. 2
      package.json
  8. 8
      src/base/combination/group.button.js
  9. 8
      src/base/combination/group.virtual.js
  10. 1
      src/base/foundation/message.js
  11. 2
      src/base/layer/layer.popup.js
  12. 49
      src/base/pager/pager.js
  13. 6
      src/case/button/node/node.arrow.js
  14. 6
      src/case/button/switch.js
  15. 8
      src/case/combo/bubblecombo/combo.bubble.js
  16. 19
      src/case/list/list.select.js
  17. 26
      src/case/ztree/0.treeview.js
  18. 18
      src/core/2.base.js
  19. 5
      src/core/controller/controller.broadcast.js
  20. 12
      src/core/platform/web/dom.js
  21. 3
      src/core/wrapper/layout/flex/flex.horizontal.js
  22. 3
      src/core/wrapper/layout/flex/flex.vertical.js
  23. 2
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js
  24. 2
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js
  25. 2
      src/core/wrapper/layout/sticky/sticky.horizontal.js
  26. 2
      src/core/wrapper/layout/sticky/sticky.vertical.js
  27. 7
      src/less/base/single/button/button.half.less
  28. 4
      src/less/base/tree/tree.expander.less
  29. 1
      src/less/base/view/popupview.less
  30. 1
      src/less/lib/theme.less
  31. 3
      src/router/router.js
  32. 1
      src/widget/downlist/item.downlistgroup.js
  33. 77
      src/widget/downlist/popup.downlist.js
  34. 8
      src/widget/editor/editor.search.js
  35. 66
      src/widget/multilayerdownlist/popup.downlist.js
  36. 24
      src/widget/multiselect/multiselect.combo.js
  37. 6
      src/widget/multiselect/multiselect.combo.nobar.js
  38. 17
      src/widget/multiselect/multiselect.insert.combo.js
  39. 15
      src/widget/multiselect/multiselect.insert.combo.nobar.js
  40. 2
      src/widget/singleselect/singleselect.combo.js
  41. 2
      src/widget/singleselect/singleselect.insert.combo.js
  42. 10
      src/widget/singleselect/singleselect.loader.js
  43. 2
      src/widget/singleselect/singleselect.popup.view.js
  44. 2
      src/widget/singleselect/singleselectlist.insert.js
  45. 2
      typescript/base/combination/combo.ts
  46. 2
      typescript/base/foundation/message.ts
  47. 4
      typescript/case/combo/bubblecombo/combo.bubble.ts
  48. 6
      webpack/webpack.dev.js
  49. 1
      webpack/webpack.prod.js

2
bi.lessconfig.json

@ -15,7 +15,7 @@
"@color-bi-background-active-radio-content": "#2C60DB", "@color-bi-background-active-radio-content": "#2C60DB",
"@color-bi-background-disabled-active-radio-content": "#D0D4DA", "@color-bi-background-disabled-active-radio-content": "#D0D4DA",
"@color-bi-background-disabled-active-radio-content-theme-dark": "#606479", "@color-bi-background-disabled-active-radio-content-theme-dark": "#606479",
"@color-bi-background-disabled-active-checkbox-content": "#D0D4DA", "@color-bi-background-disabled-active-checkbox-content": "#FFFFFF",
"@color-bi-background-disabled-active-checkbox-content-theme-dark": "#606479", "@color-bi-background-disabled-active-checkbox-content-theme-dark": "#606479",
"@color-bi-background-tooltip-success": "#2E3A4D", "@color-bi-background-tooltip-success": "#2E3A4D",
"@color-bi-text-header-background": "#647185", "@color-bi-text-header-background": "#647185",

BIN
dist/font/iconfont.eot vendored

Binary file not shown.

22
dist/font/iconfont.svg vendored

@ -14,6 +14,28 @@
/> />
<missing-glyph /> <missing-glyph />
<glyph glyph-name="xiazaimoban" unicode="&#59581;" d="M896 294.4a38.4 38.4 0 0 0 38.4-38.4v-256a38.4 38.4 0 0 0-38.4-38.4H128a38.4 38.4 0 0 0-38.4 38.4v256a38.4 38.4 0 1 0 76.8 0v-217.6h691.2V256a38.4 38.4 0 0 0 38.4 38.4zM512 768a38.4 38.4 0 0 0 38.4-38.4v-472.32l115.52 115.456a38.4 38.4 0 0 0 54.4-54.272l-181.12-181.056a38.4 38.4 0 0 0-54.4 0l-181.12 181.056a38.4 38.4 0 1 0 54.4 54.272L473.6 257.28V729.6A38.4 38.4 0 0 0 512 768z" horiz-adv-x="1024" />
<glyph glyph-name="xuqiufankui" unicode="&#59582;" d="M879.552 405.504l52.416-36.672a64 64 0 0 0 15.68-89.152l-208-297.088a64 64 0 0 0-32.512-24.064l-91.2-29.888a32 32 0 0 0-41.984 29.376l-3.136 95.936a64 64 0 0 0 11.52 38.784l208 297.088a64 64 0 0 0 89.216 15.68zM864 832a64 64 0 0 0 64-64v-288a32 32 0 1 0-64 0V768h-704v-768H512a32 32 0 1 0 0-64H160a64 64 0 0 0-64 64V768a64 64 0 0 0 64 64h704z m-21.184-478.912l-208-297.088 1.728-53.248 50.688 16.576 208 297.088-52.416 36.672zM416 256a32 32 0 1 0 0-64h-128a32 32 0 1 0 0 64h128z m128 192a32 32 0 0 0 0-64h-256a32 32 0 0 0 0 64h256z m192 192a32 32 0 1 0 0-64h-448a32 32 0 0 0 0 64h448z" horiz-adv-x="1024" />
<glyph glyph-name="guanlianneirong" unicode="&#59583;" d="M896 576a64 64 0 0 0 64-64v-512a64 64 0 0 0-64-64H384a64 64 0 0 0-64 64v96a32 32 0 1 0 64 0V0h512V512H384v-160a32 32 0 0 0-64 0V512a64 64 0 0 0 64 64h512zM128 192a64 64 0 0 0-64 64V768a64 64 0 0 0 64 64h512a64 64 0 0 0 64-64v-96a32 32 0 1 0-64 0V768H128v-512h512V416a32 32 0 1 0 64 0V256a64 64 0 0 0-64-64H128z" horiz-adv-x="1024" />
<glyph glyph-name="quxiaoshoucang" unicode="&#59584;" d="M340.736 1.792a96 96 0 0 0-139.328 101.184l32.768 190.72L95.552 428.8a96 96 0 0 0 53.248 163.84l191.488 27.776 85.632 173.504a96 96 0 0 0 172.16 0l85.632-173.44 191.488-27.904a96 96 0 0 0 53.248-163.712L789.76 293.76l32.768-190.72a96 96 0 0 0-139.328-101.248L512 91.84l-171.264-90.048z" horiz-adv-x="1024" />
<glyph glyph-name="shoucang1" unicode="&#59585;" d="M512 164.16l201.024-105.728a32 32 0 0 1 46.464 33.728l-38.4 223.872 162.624 158.592a32 32 0 0 1-17.728 54.592l-224.768 32.64-100.48 203.712a32 32 0 0 1-57.408 0L382.72 561.856l-224.768-32.64a32 32 0 0 1-17.728-54.592l162.624-158.592-38.4-223.872a32 32 0 0 1 46.464-33.728L512 164.16z m-171.264-162.368a96 96 0 0 0-139.328 101.184l32.768 190.72L95.552 428.8a96 96 0 0 0 53.248 163.84l191.488 27.776 85.632 173.504a96 96 0 0 0 172.16 0l85.632-173.44 191.488-27.904a96 96 0 0 0 53.248-163.712L789.76 293.76l32.768-190.72a96 96 0 0 0-139.328-101.248L512 91.84l-171.264-90.048z" horiz-adv-x="1024" />
<glyph glyph-name="shuaxin2" unicode="&#59586;" d="M196.352 355.52a320 320 0 0 1 521.472-217.92l-29.44 36.352a32 32 0 0 0 19.712 51.776l144.96 23.616a32 32 0 0 0 34.944-43.2l-53.248-136.896a32 32 0 0 0-54.656-8.512l-22.08 27.2-5.12-4.352a384 384 0 0 0-620.224 266.112 32 32 0 1 0 63.68 5.824zM509.888 768a384 384 0 0 0 375.68-348.544 32 32 0 1 0-63.744-5.76 320 320 0 0 1-521.472 217.92l29.44-36.48a32 32 0 0 0-19.712-51.648l-144.96-23.68a32 32 0 0 0-34.944 43.2l53.248 136.896a32 32 0 0 0 54.656 8.512l22.08-27.136 5.12 4.288a382.528 382.528 0 0 0 244.608 82.432z" horiz-adv-x="1024" />
<glyph glyph-name="ruhezhizuo" unicode="&#59587;" d="M512 832a448 448 0 1 0 0-896A448 448 0 0 0 512 832z m0-64a384 384 0 1 1 0-768A384 384 0 0 1 512 768z m-0.384-576c18.112 0 33.856-5.952 46.208-17.792 11.52-11.904 18.176-27.136 18.176-45.76A62.784 62.784 0 0 0 511.616 64a63.488 63.488 0 0 0-45.44 18.624C453.76 94.528 448 109.76 448 128.448c0 18.624 5.76 33.92 18.176 45.76a62.72 62.72 0 0 0 45.44 17.792z m8.064 448c45.44 0 82.432-12.352 110.4-38.528 27.968-25.472 41.92-60.352 41.92-104.768 0-36.352-9.088-66.176-25.856-89.408a142.08 142.08 0 0 0-5.44-5.888l-8.768-8.704c-10.432-10.176-25.728-24.576-45.888-42.88-12.544-10.88-21.632-23.296-27.904-36.352a106.24 106.24 0 0 1-10.496-47.296V256H467.2v10.24c0 27.52 4.224 51.584 14.016 71.232 9.088 19.648 36.288 50.176 81.728 92.352l8.32 10.176c12.608 16 18.944 33.472 18.944 51.648 0 24-7.04 42.88-19.584 56.704-13.248 13.824-32.128 20.352-55.872 20.352-30.72 0-52.48-9.408-65.728-29.824-11.84-16.64-17.408-40.704-17.408-71.232H352c0 53.76 14.72 96 45.44 126.528C427.456 624.704 467.968 640 519.68 640z" horiz-adv-x="1024" />
<glyph glyph-name="binghangqushu" unicode="&#59580;" d="M576 832a64 64 0 0 0 64-64v-96a32 32 0 0 0-64 0V768H128v-768h448v96a32 32 0 1 0 64 0V0a64 64 0 0 0-64-64H128a64 64 0 0 0-64 64V768a64 64 0 0 0 64 64h448z m221.12-472.32a12.8 12.8 0 0 0 6.592-1.792l154.24-92.16a12.8 12.8 0 0 0 0-22.016l-154.24-92.16a12.8 12.8 0 0 0-19.392 10.88v60.288h-384.64a32 32 0 1 0 0 64h384.64v60.16c0 7.04 5.76 12.8 12.8 12.8z m0 258.56a12.8 12.8 0 0 0 6.592-1.792l154.24-92.16a12.8 12.8 0 0 0 0-22.016l-154.24-92.16a12.8 12.8 0 0 0-19.392 10.944v60.288h-384.64a32 32 0 0 0 0 64h384.64v60.16c0 7.04 5.76 12.8 12.8 12.8z" horiz-adv-x="1024" />
<glyph glyph-name="xiayi" unicode="&#59569;" d="M864 832A96 96 0 0 0 960 736v-704a96 96 0 0 0-96-96h-704A96 96 0 0 0 64 32v704A96 96 0 0 0 160 832z m0-64h-704a32 32 0 0 1-32-32v-704a32 32 0 0 1 32-32h704a32 32 0 0 1 32 32v704a32 32 0 0 1-32 32zM512 640.32a32 32 0 0 0 32-32v-394.688l169.92 161.536 4.544 3.584a32 32 0 0 0 39.616-49.92l-190.08-180.672-3.2-2.56c-32.832-25.344-81.92-23.104-111.872 5.312l-187.008 177.92-3.84 4.352a32 32 0 0 0 48 41.984L480 213.44v394.88a32 32 0 0 0 32 32z" horiz-adv-x="1024" />
<glyph glyph-name="shangyi" unicode="&#59568;" d="M864 832A96 96 0 0 0 960 736v-704a96 96 0 0 0-96-96h-704A96 96 0 0 0 64 32v704A96 96 0 0 0 160 832z m0-64h-704a32 32 0 0 1-32-32v-704a32 32 0 0 1 32-32h704a32 32 0 0 1 32 32v704a32 32 0 0 1-32 32zM564.8 622.72l3.2-2.56 190.08-180.672a32 32 0 0 0-39.616-49.92l-4.48 3.584L544 554.688V160a32 32 0 1 0-64 0V554.88L310.08 393.152a32 32 0 0 0-48 42.048l3.84 4.288 187.008 177.92c29.888 28.416 79.04 30.656 111.872 5.312z" horiz-adv-x="1024" />
<glyph glyph-name="ziduanshezhi1" unicode="&#59567;" d="M618.816 839.168a269.632 269.632 0 0 1-30.976-56.96H113.792v-284.416h528.256c21.76-23.232 47.616-42.56 76.416-56.96l-92.8 0.064v-113.792h227.648v85.76c19.648 0.96 38.72 4.096 56.96 9.024v-436.096c0-31.424-25.536-56.96-56.96-56.96H113.792a56.896 56.896 0 0 0-56.96 56.96V782.208c0 31.424 25.536 56.96 56.96 56.96h505.024zM341.312 99.584H113.792v-113.792h227.52v113.792z m512 0H625.728v-113.792h227.584v113.792z m-512 170.688H113.792v-113.856l227.52 0.064V270.272z m284.416 0v-113.792h227.584V270.144l-227.584 0.064zM341.312 440.96H113.728v-113.792h227.584V440.96z m538.88 397.184l1.28-0.576c2.752-1.088 9.6-4.16 21.632-10.944 15.936-9.088 21.632-13.824 21.632-13.824a24.32 24.32 0 0 0 7.04-23.68l-1.92-5.632a58.368 58.368 0 0 1 6.336-43.392 59.776 59.776 0 0 1 34.688-27.072l5.952-1.28a24.448 24.448 0 0 0 17.28-17.856h0.128s1.28-7.104 1.28-25.408c0-18.176-1.28-25.28-1.28-25.28a24.448 24.448 0 0 0-17.28-17.792l-5.568-1.408a59.712 59.712 0 0 1-35.008-27.136 58.176 58.176 0 0 1-6.4-43.2l1.792-5.76a24.32 24.32 0 0 0-7.04-23.68s-5.568-4.672-21.568-13.76c-15.872-9.024-22.912-11.52-22.912-11.52a24.768 24.768 0 0 0-24.256 5.76l-3.904 4.224a60.544 60.544 0 0 1-82.688 0l-4.032-4.096a24.896 24.896 0 0 0-24.256-5.888s-6.848 2.496-22.848 11.584a153.6 153.6 0 0 0-21.568 13.824 24.128 24.128 0 0 0-7.04 23.68l1.664 5.44a58.368 58.368 0 0 1-6.4 43.456 59.456 59.456 0 0 1-34.88 27.2l-5.76 1.28A24.32 24.32 0 0 0 627.2 643.2s-1.024 5.44-1.28 19.008l-0.064 6.272c0 18.24 1.28 25.344 1.28 25.344a24.448 24.448 0 0 0 17.28 17.792l5.76 1.344a58.624 58.624 0 0 1 41.28 70.4l-1.728 5.76a23.872 23.872 0 0 0 7.04 23.552s5.568 4.736 21.504 13.888c16 8.96 22.912 11.52 22.912 11.52a24.768 24.768 0 0 0 24.32-5.76l4.032-4.352a60.16 60.16 0 0 1 41.216-16.192 59.904 59.904 0 0 1 41.088 16l4.16 4.48a24.768 24.768 0 0 0 24.256 5.76zM810.688 741.12c-40.768 0-73.728-32.512-73.728-72.704 0-40.192 33.024-72.704 73.728-72.704 40.64 0 73.6 32.512 73.6 72.704 0 40.192-32.96 72.704-73.6 72.704z" horiz-adv-x="1024" />
<glyph glyph-name="a-weizhizuojuzhong" unicode="&#59559;" d="M321.856 309.212l40.192-40.2a8 8 0 0 1 11.316-0.004l91.984 91.952a8 8 0 0 0 8.924 1.644l97.144-43.46a8 8 0 0 1 8.928 1.648l125.948 126.036a8 8 0 0 1 0 11.312l-40.192 40.2a8 8 0 0 1-11.312 0.004l-89.156-89.124a8.008 8.008 0 0 0-8.924-1.644l-97.148 43.46a7.996 7.996 0 0 1-8.924-1.648l-128.78-128.864a8 8 0 0 1 0-11.312zM200 64a8 8 0 0 0-8 8V696a8 8 0 0 0 8 8h624a8 8 0 0 0 8-8v-624a8 8 0 0 0-8-8H200z m56 64h512V638.908L256 640v-512zM64 272v224a8 8 0 0 0 8 8h64a8 8 0 0 0 8-8v-224a8 8 0 0 0-8-8H72a8 8 0 0 0-8 8z" horiz-adv-x="1024" /> <glyph glyph-name="a-weizhizuojuzhong" unicode="&#59559;" d="M321.856 309.212l40.192-40.2a8 8 0 0 1 11.316-0.004l91.984 91.952a8 8 0 0 0 8.924 1.644l97.144-43.46a8 8 0 0 1 8.928 1.648l125.948 126.036a8 8 0 0 1 0 11.312l-40.192 40.2a8 8 0 0 1-11.312 0.004l-89.156-89.124a8.008 8.008 0 0 0-8.924-1.644l-97.148 43.46a7.996 7.996 0 0 1-8.924-1.648l-128.78-128.864a8 8 0 0 1 0-11.312zM200 64a8 8 0 0 0-8 8V696a8 8 0 0 0 8 8h624a8 8 0 0 0 8-8v-624a8 8 0 0 0-8-8H200z m56 64h512V638.908L256 640v-512zM64 272v224a8 8 0 0 0 8 8h64a8 8 0 0 0 8-8v-224a8 8 0 0 0-8-8H72a8 8 0 0 0-8 8z" horiz-adv-x="1024" />
<glyph glyph-name="a-weizhidingbujuzhong" unicode="&#59560;" d="M624 752h-224a8 8 0 0 0-8 8V824a8 8 0 0 0 8 8h224a8 8 0 0 0 8-8v-64a8 8 0 0 0-8-8zM321.856 309.212l40.192-40.2a8 8 0 0 1 11.316-0.004l91.984 91.952a8 8 0 0 0 8.924 1.644l97.144-43.46a8 8 0 0 1 8.928 1.648l125.948 126.036a8 8 0 0 1 0 11.312l-40.192 40.2a8 8 0 0 1-11.312 0.004l-89.156-89.124a8.008 8.008 0 0 0-8.924-1.644l-97.148 43.46a7.996 7.996 0 0 1-8.924-1.648l-128.78-128.864a8 8 0 0 1 0-11.312zM200 64a8 8 0 0 0-8 8V696a8 8 0 0 0 8 8h624a8 8 0 0 0 8-8v-624a8 8 0 0 0-8-8H200z m56 64h512V638.908L256 640v-512z" horiz-adv-x="1024" /> <glyph glyph-name="a-weizhidingbujuzhong" unicode="&#59560;" d="M624 752h-224a8 8 0 0 0-8 8V824a8 8 0 0 0 8 8h224a8 8 0 0 0 8-8v-64a8 8 0 0 0-8-8zM321.856 309.212l40.192-40.2a8 8 0 0 1 11.316-0.004l91.984 91.952a8 8 0 0 0 8.924 1.644l97.144-43.46a8 8 0 0 1 8.928 1.648l125.948 126.036a8 8 0 0 1 0 11.312l-40.192 40.2a8 8 0 0 1-11.312 0.004l-89.156-89.124a8.008 8.008 0 0 0-8.924-1.644l-97.148 43.46a7.996 7.996 0 0 1-8.924-1.648l-128.78-128.864a8 8 0 0 1 0-11.312zM200 64a8 8 0 0 0-8 8V696a8 8 0 0 0 8 8h624a8 8 0 0 0 8-8v-624a8 8 0 0 0-8-8H200z m56 64h512V638.908L256 640v-512z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 624 KiB

After

Width:  |  Height:  |  Size: 632 KiB

BIN
dist/font/iconfont.ttf vendored

Binary file not shown.

BIN
dist/font/iconfont.woff vendored

Binary file not shown.

BIN
dist/font/iconfont.woff2 vendored

Binary file not shown.

2
package.json

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

8
src/base/combination/group.button.js

@ -33,11 +33,9 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
self.populate(newValue); self.populate(newValue);
}) : o.items; }) : o.items;
this.populate(items); this.populate(items);
if (BI.isFunction(o.value)) { o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) {
this.__watch(o.value, function (context, newValue) { self.setValue(newValue);
self.setValue(newValue); }) : o.value;
})
}
if (BI.isKey(o.value) || BI.isNotEmptyArray(o.value)) { if (BI.isKey(o.value) || BI.isNotEmptyArray(o.value)) {
this.setValue(o.value); this.setValue(o.value);
} }

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

@ -17,11 +17,9 @@ BI.VirtualGroup = BI.inherit(BI.Widget, {
self.populate(newValue); self.populate(newValue);
}) : o.items; }) : o.items;
this.populate(items); this.populate(items);
if (BI.isFunction(o.value)) { o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) {
this.__watch(o.value, function (context, newValue) { self.setValue(newValue);
self.setValue(newValue); }) : o.value;
})
}
if (BI.isKey(o.value)) { if (BI.isKey(o.value)) {
this.setValue(o.value); this.setValue(o.value);
} }

1
src/base/foundation/message.js

@ -22,6 +22,7 @@ BI.Msg = function () {
// BI.Msg.prompt(title, message, value, callback, min_width); // BI.Msg.prompt(title, message, value, callback, min_width);
}, },
toast: function (message, options, context) { toast: function (message, options, context) {
BI.isString(options) && (options = { level: options })
options = options || {}; options = options || {};
context = context || BI.Widget._renderEngine.createElement("body"); context = context || BI.Widget._renderEngine.createElement("body");
var level = options.level || "common"; var level = options.level || "common";

2
src/base/layer/layer.popup.js

@ -185,7 +185,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
setDirection: function (direction, position) { setDirection: function (direction, position) {
var o = this.options; var o = this.options;
if (o.showArrow) { if (o.showArrow) {
var style, wrapperStyle, placeholderStyle; var style = {}, wrapperStyle = {}, placeholderStyle = {};
var adjustXOffset = position.adjustXOffset || 0; var adjustXOffset = position.adjustXOffset || 0;
var adjustYOffset = position.adjustYOffset || 0; var adjustYOffset = position.adjustYOffset || 0;
var bodyBounds = BI.Widget._renderEngine.createElement("body").bounds(); var bodyBounds = BI.Widget._renderEngine.createElement("body").bounds();

49
src/base/pager/pager.js

@ -26,7 +26,6 @@ BI.Pager = BI.inherit(BI.Widget, {
}, // 初始化当前页 }, // 初始化当前页
groups: 0, // 连续显示分页数 groups: 0, // 连续显示分页数
jump: BI.emptyFn, // 分页的回调函数 jump: BI.emptyFn, // 分页的回调函数
first: false, // 是否显示首页 first: false, // 是否显示首页
last: false, // 是否显示尾页 last: false, // 是否显示尾页
prev: "上一页", prev: "上一页",
@ -37,7 +36,7 @@ BI.Pager = BI.inherit(BI.Widget, {
return 1; return 1;
}, },
hasPrev: BI.emptyFn, // pages不可用时有效 hasPrev: BI.emptyFn, // pages不可用时有效
hasNext: BI.emptyFn // pages不可用时有效 hasNext: BI.emptyFn // pages不可用时有效
}); });
}, },
@ -83,9 +82,11 @@ BI.Pager = BI.inherit(BI.Widget, {
disabled: pages === false ? o.hasPrev(curr) === false : !(curr > 1 && prev !== false) disabled: pages === false ? o.hasPrev(curr) === false : !(curr > 1 && prev !== false)
}); });
} else { } else {
view.push(BI.extend({ view.push({
disabled: pages === false ? o.hasPrev(curr) === false : !(curr > 1 && prev !== false) el: BI.extend({
}, prev)); disabled: pages === false ? o.hasPrev(curr) === false : !(curr > 1 && prev !== false)
}, prev)
});
} }
} }
@ -96,7 +97,7 @@ BI.Pager = BI.inherit(BI.Widget, {
value: "first", value: "first",
disabled: !(dict.index > 1 && groups !== 0) disabled: !(dict.index > 1 && groups !== 0)
}); });
if (dict.index > 1 && groups !== 0) { if (dict.index > 1 && groups !== 0 && groups !== pages - 1) {
view.push({ view.push({
type: "bi.label", type: "bi.label",
cls: "page-ellipsis", cls: "page-ellipsis",
@ -110,6 +111,7 @@ BI.Pager = BI.inherit(BI.Widget, {
dict.start = dict.index > 1 ? curr - dict.poor : 1; dict.start = dict.index > 1 ? curr - dict.poor : 1;
dict.end = dict.index > 1 ? (function () { dict.end = dict.index > 1 ? (function () {
var max = curr + (groups - dict.poor - 1); var max = curr + (groups - dict.poor - 1);
return max > pages ? pages : max; return max > pages ? pages : max;
}()) : groups; }()) : groups;
if (dict.end - dict.start < groups - 1) { // 最后一组状态 if (dict.end - dict.start < groups - 1) { // 最后一组状态
@ -137,7 +139,7 @@ BI.Pager = BI.inherit(BI.Widget, {
// 总页数大于连续分页数,且当前组最大页小于总页,输出尾页 // 总页数大于连续分页数,且当前组最大页小于总页,输出尾页
if (((!o.dynamicShow && !o.dynamicShowFirstLast) || (pages > groups && dict.end < pages && groups !== 0)) && last) { if (((!o.dynamicShow && !o.dynamicShowFirstLast) || (pages > groups && dict.end < pages && groups !== 0)) && last) {
if (pages > groups && dict.end < pages && groups !== 0) { if (pages > groups && dict.end < pages && groups !== 0 && groups !== pages - 1) {
view.push({ view.push({
type: "bi.label", type: "bi.label",
cls: "page-ellipsis", cls: "page-ellipsis",
@ -157,29 +159,36 @@ BI.Pager = BI.inherit(BI.Widget, {
view.push((function () { view.push((function () {
if (BI.isKey(next)) { if (BI.isKey(next)) {
if (pages === false) { if (pages === false) {
return {text: next, value: "next", disabled: o.hasNext(curr) === false}; return { text: next, value: "next", disabled: o.hasNext(curr) === false };
} }
return (dict.flow && curr === pages) return (dict.flow && curr === pages)
? ?
{text: next, value: "next", disabled: true} { text: next, value: "next", disabled: true }
: :
{text: next, value: "next", disabled: !(curr !== pages && next || dict.flow)}; { text: next, value: "next", disabled: !(curr !== pages && next || dict.flow) };
} }
return BI.extend({
disabled: pages === false ? o.hasNext(curr) === false : !(curr !== pages && next || dict.flow)
}, next);
return {
el: BI.extend({
disabled: pages === false ? o.hasNext(curr) === false : !(curr !== pages && next || dict.flow)
}, next)
};
}())); }()));
} }
this.button_group = BI.createWidget({ this.button_group = BI.createWidget({
type: "bi.button_group", type: "bi.button_group",
element: this, element: this,
items: BI.createItems(view, { items: BI.map(view, function (idx, v) {
cls: "bi-list-item-select bi-border-radius", v = BI.extend({
height: 23, cls: "bi-list-item-select bi-border-radius",
hgap: 10, height: 23,
stopPropagation: true hgap: v.el ? 0 : 10,
stopPropagation: true
}, BI.stripEL(v));
return BI.formatEL(v);
}), }),
behaviors: o.behaviors, behaviors: o.behaviors,
layouts: o.layouts layouts: o.layouts
@ -233,6 +242,7 @@ BI.Pager = BI.inherit(BI.Widget, {
v || (v = 1); v || (v = 1);
var o = this.options; var o = this.options;
var pages = this.options.pages; var pages = this.options.pages;
return pages === false ? o.hasPrev(v) : v > 1; return pages === false ? o.hasPrev(v) : v > 1;
}, },
@ -240,6 +250,7 @@ BI.Pager = BI.inherit(BI.Widget, {
v || (v = 1); v || (v = 1);
var o = this.options; var o = this.options;
var pages = this.options.pages; var pages = this.options.pages;
return pages === false ? o.hasNext(v) : v < pages; return pages === false ? o.hasNext(v) : v < pages;
}, },
@ -268,7 +279,7 @@ BI.Pager = BI.inherit(BI.Widget, {
return BI.MIN; return BI.MIN;
case "last": case "last":
return BI.MAX; return BI.MAX;
default : default:
return val; return val;
} }
}, },

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

@ -22,12 +22,6 @@ BI.ArrowNode = BI.inherit(BI.NodeButton, {
this.checkbox = BI.createWidget({ this.checkbox = BI.createWidget({
type: "bi.arrow_group_node_checkbox" type: "bi.arrow_group_node_checkbox"
}); });
this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
self.setSelected(self.isSelected());
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
return { return {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
columnSize: [o.iconWrapperWidth || o.height, "fill"], columnSize: [o.iconWrapperWidth || o.height, "fill"],

6
src/case/button/switch.js

@ -36,14 +36,14 @@ BI.Switch = BI.inherit(BI.BasicButton, {
width: 12, width: 12,
height: 12, height: 12,
top: tgap, top: tgap,
left: this.options.selected ? 28 : 4 left: o.selected ? 28 : 4
}, { }, {
type: "bi.label", type: "bi.label",
text: BI.i18nText("BI-Basic_Simple_Open"), text: BI.i18nText("BI-Basic_Simple_Open"),
cls: "content-tip", cls: "content-tip",
left: 8, left: 8,
top: tgap - 2, top: tgap - 2,
invisible: !o.showTip, invisible: !(o.showTip && o.selected),
ref: function (ref) { ref: function (ref) {
self.openTip = ref; self.openTip = ref;
} }
@ -53,7 +53,7 @@ BI.Switch = BI.inherit(BI.BasicButton, {
cls: "content-tip", cls: "content-tip",
right: 8, right: 8,
top: tgap - 2, top: tgap - 2,
invisible: !o.showTip, invisible: !(o.showTip && !o.selected),
ref: function (ref) { ref: function (ref) {
self.closeTip = ref; self.closeTip = ref;
} }

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

@ -99,6 +99,14 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
isViewVisible: function () { isViewVisible: function () {
return this.combo.isViewVisible(); return this.combo.isViewVisible();
},
adjustWidth: function () {
this.combo.adjustWidth();
},
adjustHeight: function () {
this.combo.adjustHeight();
} }
}); });

19
src/case/list/list.select.js

@ -93,10 +93,23 @@ BI.SelectList = BI.inherit(BI.Widget, {
var notSelectLength = this.getAllLeaves().length - selectLength; var notSelectLength = this.getAllLeaves().length - selectLength;
var hasNext = this.list.hasNext(); var hasNext = this.list.hasNext();
var isAlreadyAllSelected = this.toolbar.isSelected(); var isAlreadyAllSelected = this.toolbar.isSelected();
var isHalf = selectLength > 0 && (notSelectLength > 0 || (!isAlreadyAllSelected && hasNext)); var isHalf = selectLength > 0 && notSelectLength > 0;
isHalf = isHalf || (notSelectLength > 0 && hasNext && isAlreadyAllSelected); var allSelected = isAlreadyAllSelected;
if (this.isAllSelected() === false) {
hasNext && (isHalf = selectLength > 0);
if (!isAlreadyAllSelected && notSelectLength === 0 && !hasNext) {
allSelected = true;
}
} else {
hasNext && (isHalf = notSelectLength > 0);
if (!isAlreadyAllSelected && notSelectLength === 0) {
allSelected = true;
}
}
this.toolbar.setHalfSelected(isHalf); this.toolbar.setHalfSelected(isHalf);
!isHalf && this.toolbar.setSelected(selectLength > 0 && notSelectLength <= 0 && (!hasNext || isAlreadyAllSelected)); !isHalf && this.toolbar.setSelected(allSelected);
}, },
setAllSelected: function (v) { setAllSelected: function (v) {

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

@ -347,33 +347,33 @@ BI.TreeView = BI.inherit(BI.Pane, {
_dealWidthNodes: function (nodes) { _dealWidthNodes: function (nodes) {
var self = this, o = this.options; var self = this, o = this.options;
var ns = BI.Tree.arrayFormat(nodes); var ns = BI.Tree.arrayFormat(nodes);
BI.each(ns, function (i, n) { return BI.map(ns, function (i, n) {
n.isParent = n.isParent || n.parent; var newNode = BI.extend({}, n);
newNode.isParent = newNode.isParent || newNode.parent;
// n.value = BI.isUndefined(n.value) ? n.text : n.value; // n.value = BI.isUndefined(n.value) ? n.text : n.value;
// n.text = BI.isUndefined(n.text) ? n.value : n.text; // n.text = BI.isUndefined(n.text) ? n.value : n.text;
// if (n.text === null) { // if (n.text === null) {
// n.text = ""; // n.text = "";
// } // }
if (BI.isNull(n.title)) { if (BI.isNull(newNode.title)) {
n.title = n.text; newNode.title = newNode.text;
} }
if (n.disabled) { if (newNode.disabled) {
n.title = n.warningTitle || n.title; newNode.title = newNode.warningTitle || newNode.title;
} }
var text = BI.createWidget(BI.extend({ var text = BI.createWidget(BI.extend({
cls: "tree-node-text", cls: "tree-node-text",
css: { tagName: "span",
display: "inline"
},
whiteSpace: "nowrap", whiteSpace: "nowrap",
root: true, root: true,
keyword: o.paras.keyword keyword: o.paras.keyword
}, n, { }, newNode, {
type: "bi.text" type: "bi.text",
text: BI.replaceAll(newNode.text, "\n", " ")
})); }));
var fragment = BI.Widget._renderEngine.createElement("<div>"); var fragment = BI.Widget._renderEngine.createElement("<div>");
fragment.append(text.element[0]); fragment.append(text.element[0]);
n.text = fragment.html(); newNode.text = fragment.html();
// // 处理标红 // // 处理标红
// if (BI.isNotNull(n.text)) { // if (BI.isNotNull(n.text)) {
// if (BI.isKey(o.paras.keyword)) { // if (BI.isKey(o.paras.keyword)) {
@ -382,8 +382,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
// n.text = BI.htmlEncode(BI.Text.formatText(n.text + "")); // n.text = BI.htmlEncode(BI.Text.formatText(n.text + ""));
// } // }
// } // }
return newNode;
}); });
return nodes;
}, },
_loadMore: function () { _loadMore: function () {

18
src/core/2.base.js

@ -281,13 +281,13 @@
var i; var i;
if (BI.isArray(obj)) { if (BI.isArray(obj)) {
for (i = 0; i < obj.length; i++) { for (i = 0; i < obj.length; i++) {
if ((isFunction && target.apply(context, [i, obj[i]]) === true) || (!isFunction && BI.contains(target, obj[i]))) { if ((isFunction && (target === obj[i] || target.apply(context, [i, obj[i]]) === true)) || (!isFunction && BI.contains(target, obj[i]))) {
obj.splice(i--, 1); obj.splice(i--, 1);
} }
} }
} else { } else {
BI.each(obj, function (i, v) { BI.each(obj, function (i, v) {
if ((isFunction && target.apply(context, [i, obj[i]]) === true) || (!isFunction && BI.contains(target, obj[i]))) { if ((isFunction && (target === obj[i] || target.apply(context, [i, obj[i]]) === true)) || (!isFunction && BI.contains(target, obj[i]))) {
delete obj[i]; delete obj[i];
} }
}); });
@ -735,20 +735,6 @@
BI[name] = _apply(name); BI[name] = _apply(name);
}); });
_.extend(BI, { _.extend(BI, {
getTime: function () {
if (_global.performance && _global.performance.now) {
return _global.performance.now();
}
if (_global.performance && _global.performance.webkitNow) {
return _global.performance.webkitNow();
}
if (Date.now) {
return Date.now();
}
return BI.getDate().getTime();
},
parseInt: function (number) { parseInt: function (number) {
var radix = 10; var radix = 10;

5
src/core/controller/controller.broadcast.js

@ -30,10 +30,9 @@ BI.BroadcastController = BI.inherit(BI.Controller, {
remove: function (name, fn) { remove: function (name, fn) {
var self = this; var self = this;
if (fn) { if (fn) {
BI.remove(this._broadcasts[name], function (idx) { BI.remove(this._broadcasts[name], function (index, cb) {
return self._broadcasts[name].indexOf(fn) === idx; return fn === cb;
}); });
this._broadcasts[name].remove(fn);
if (this._broadcasts[name].length === 0) { if (this._broadcasts[name].length === 0) {
delete this._broadcasts[name]; delete this._broadcasts[name];
} }

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

@ -628,20 +628,20 @@
return pos; return pos;
default : default :
if (BI.DOM.isBottomSpaceLarger(combo)) { if (BI.DOM.isBottomSpaceLarger(combo)) {
pos = BI.DOM.getBottomAdaptPosition(combo, popup, extraHeight, needAdaptHeight); top = BI.DOM.getBottomAdaptPosition(combo, popup, extraHeight, needAdaptHeight).top;
firstDir = "bottom"; firstDir = "bottom";
} else { } else {
pos = BI.DOM.getTopAdaptPosition(combo, popup, extraHeight, needAdaptHeight); top = BI.DOM.getTopAdaptPosition(combo, popup, extraHeight, needAdaptHeight).top;
firstDir = "top"; firstDir = "top";
} }
if (leftRight[0] === "right") { if (leftRight[0] === "right") {
left = BI.DOM.getLeftAlignPosition(combo, popup, extraWidth, needAdaptHeight).left; pos = BI.DOM.getLeftAlignPosition(combo, popup, extraWidth, needAdaptHeight);
pos.left = left; pos.top = top;
pos.dir = firstDir + "," + pos.dir; pos.dir = firstDir + "," + pos.dir;
return pos; return pos;
} }
left = BI.DOM.getRightAlignPosition(combo, popup, extraWidth).left; pos = BI.DOM.getRightAlignPosition(combo, popup, extraWidth);
pos.left = left; pos.top = top;
pos.dir = firstDir + "," + pos.dir; pos.dir = firstDir + "," + pos.dir;
return pos; return pos;
} }

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

@ -52,7 +52,7 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
_addElement: function (i, item) { _addElement: function (i, item) {
var o = this.options; var o = this.options;
var w = BI.FlexHorizontalLayout.superclass._addElement.apply(this, arguments); var w = BI.FlexHorizontalLayout.superclass._addElement.apply(this, arguments);
var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width >= 1 ? null : item.width; var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width;
if (o.columnSize.length > 0) { if (o.columnSize.length > 0) {
if (item.width >= 1 && o.columnSize[i] >= 1 && o.columnSize[i] !== item.width) { if (item.width >= 1 && o.columnSize[i] >= 1 && o.columnSize[i] !== item.width) {
columnSize = null; columnSize = null;
@ -81,6 +81,7 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
} }
if (columnSize === "fill") { if (columnSize === "fill") {
w.element.addClass("f-f"); w.element.addClass("f-f");
w.element.css({ minWidth: 0 });
} }
w.element.addClass("c-e"); w.element.addClass("c-e");
if (i === 0) { if (i === 0) {

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

@ -51,7 +51,7 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, {
_addElement: function (i, item) { _addElement: function (i, item) {
var o = this.options; var o = this.options;
var w = BI.FlexVerticalLayout.superclass._addElement.apply(this, arguments); var w = BI.FlexVerticalLayout.superclass._addElement.apply(this, arguments);
var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height >= 1 ? null : item.height; var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height;
if (o.rowSize.length > 0) { if (o.rowSize.length > 0) {
if (item.height >= 1 && o.rowSize[i] >= 1 && o.rowSize[i] !== item.height) { if (item.height >= 1 && o.rowSize[i] >= 1 && o.rowSize[i] !== item.height) {
rowSize = null; rowSize = null;
@ -80,6 +80,7 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, {
} }
if (rowSize === "fill") { if (rowSize === "fill") {
w.element.addClass("f-f"); w.element.addClass("f-f");
w.element.css({ minHeight: 0 });
} }
w.element.addClass("c-e"); w.element.addClass("c-e");
if (i === 0) { if (i === 0) {

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

@ -48,7 +48,7 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, {
_addElement: function (i, item) { _addElement: function (i, item) {
var o = this.options; var o = this.options;
var w = BI.FlexWrapperHorizontalLayout.superclass._addElement.apply(this, arguments); var w = BI.FlexWrapperHorizontalLayout.superclass._addElement.apply(this, arguments);
var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width >= 1 ? null : item.width; var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width;
if (o.columnSize.length > 0) { if (o.columnSize.length > 0) {
if (item.width >= 1 && o.columnSize[i] >= 1 && o.columnSize[i] !== item.width) { if (item.width >= 1 && o.columnSize[i] >= 1 && o.columnSize[i] !== item.width) {
columnSize = null; columnSize = null;

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

@ -48,7 +48,7 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, {
_addElement: function (i, item) { _addElement: function (i, item) {
var o = this.options; var o = this.options;
var w = BI.FlexWrapperVerticalLayout.superclass._addElement.apply(this, arguments); var w = BI.FlexWrapperVerticalLayout.superclass._addElement.apply(this, arguments);
var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height >= 1 ? null : item.height; var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height;
if (o.rowSize.length > 0) { if (o.rowSize.length > 0) {
if (item.height >= 1 && o.rowSize[i] >= 1 && o.rowSize[i] !== item.height) { if (item.height >= 1 && o.rowSize[i] >= 1 && o.rowSize[i] !== item.height) {
rowSize = null; rowSize = null;

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

@ -13,7 +13,7 @@ BI.HorizontalStickyLayout = BI.inherit(BI.FlexHorizontalLayout, {
_addElement: function (i, item) { _addElement: function (i, item) {
var o = this.options; var o = this.options;
var w = BI.HorizontalStickyLayout.superclass._addElement.apply(this, arguments); var w = BI.HorizontalStickyLayout.superclass._addElement.apply(this, arguments);
var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width >= 1 ? null : item.width; var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width;
if (o.columnSize.length > 0) { if (o.columnSize.length > 0) {
if (item.width >= 1 && o.columnSize[i] >= 1 && o.columnSize[i] !== item.width) { if (item.width >= 1 && o.columnSize[i] >= 1 && o.columnSize[i] !== item.width) {
columnSize = null; columnSize = null;

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

@ -13,7 +13,7 @@ BI.VerticalStickyLayout = BI.inherit(BI.FlexVerticalLayout, {
_addElement: function (i, item) { _addElement: function (i, item) {
var o = this.options; var o = this.options;
var w = BI.VerticalStickyLayout.superclass._addElement.apply(this, arguments); var w = BI.VerticalStickyLayout.superclass._addElement.apply(this, arguments);
var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height >= 1 ? null : item.height; var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height;
if (o.rowSize.length > 0) { if (o.rowSize.length > 0) {
if (item.height >= 1 && o.rowSize[i] >= 1 && o.rowSize[i] !== item.height) { if (item.height >= 1 && o.rowSize[i] >= 1 && o.rowSize[i] !== item.height) {
rowSize = null; rowSize = null;

7
src/less/base/single/button/button.half.less

@ -3,6 +3,7 @@
.bi-half-button { .bi-half-button {
.border-radius(2px); .border-radius(2px);
box-sizing: border-box; box-sizing: border-box;
&:after { &:after {
position: absolute; position: absolute;
left: 2px; left: 2px;
@ -12,4 +13,10 @@
background-color: @color-bi-background-half-button-content; background-color: @color-bi-background-half-button-content;
content: ''; content: '';
} }
&.disabled {
&:after {
background-color: @color-bi-background-disabled-half-button-content;
}
}
} }

4
src/less/base/tree/tree.expander.less

@ -12,7 +12,7 @@
.bi-tree-expander-popup.line.solid:before { .bi-tree-expander-popup.line.solid:before {
.imagePath(@icon-tree-solid-vertical-line-1, 0, 0, repeat-y); .imagePath(@icon-tree-solid-vertical-line-1, 0, 0, repeat-y);
width: 24px; width: 24px;
left:4px; left: 8px;
} }
.bi-theme-dark { .bi-theme-dark {
@ -23,6 +23,6 @@
.bi-tree-expander-popup.line.solid:before { .bi-tree-expander-popup.line.solid:before {
.imagePath(@icon-tree-solid-vertical-line-1-theme-dark, 0, 0, repeat-y); .imagePath(@icon-tree-solid-vertical-line-1-theme-dark, 0, 0, repeat-y);
width: 24px; width: 24px;
left:4px; left: 8px;
} }
} }

1
src/less/base/view/popupview.less

@ -107,6 +107,7 @@
transform: translateX(0px) rotate(-135deg); transform: translateX(0px) rotate(-135deg);
transform-origin: center center; transform-origin: center center;
.box-shadow(3px 3px 10px 0,rgba(0, 0, 0, 6%)); .box-shadow(3px 3px 10px 0,rgba(0, 0, 0, 6%));
.border-radius(2px);
} }
} }
} }

1
src/less/lib/theme.less

@ -195,6 +195,7 @@
@color-bi-split-disabled-segment: @color-bi-border-disabled; @color-bi-split-disabled-segment: @color-bi-border-disabled;
// 半选 // 半选
@color-bi-background-half-button-content: @color-bi-background-highlight; @color-bi-background-half-button-content: @color-bi-background-highlight;
@color-bi-background-disabled-half-button-content: @color-bi-background-light-disabled;
// items // items
@color-bi-text-active-single-select-icon-text-item: @color-bi-text-highlight; @color-bi-text-active-single-select-icon-text-item: @color-bi-text-highlight;
// editor // editor

3
src/router/router.js

@ -3126,8 +3126,8 @@
BI.RouterWidget = BI.inherit(BI.Widget, { BI.RouterWidget = BI.inherit(BI.Widget, {
init: function () { init: function () {
this.$router = this._router = BI.Router.$router = $router = new VueRouter({ this.$router = this._router = BI.Router.$router = $router = new VueRouter({
routes: this.options.routes,
mode: this.options.mode, mode: this.options.mode,
routes: this.options.routes,
base: this.options.base base: this.options.base
}); });
this.$router.beforeEach(function (to, from, next) { this.$router.beforeEach(function (to, from, next) {
@ -3203,4 +3203,3 @@
return VueRouter; return VueRouter;
}))); })));

1
src/widget/downlist/item.downlistgroup.js

@ -28,6 +28,7 @@ BI.DownListGroupItem = BI.inherit(BI.BasicButton, {
type: "bi.icon_button", type: "bi.icon_button",
cls: o.iconCls1, cls: o.iconCls1,
width: 36, width: 36,
height: o.height,
disableSelected: true, disableSelected: true,
selected: this._digest(o.value) selected: this._digest(o.value)
}); });

77
src/widget/downlist/popup.downlist.js

@ -26,8 +26,8 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
this.singleValues = []; this.singleValues = [];
this.childValueMap = {}; this.childValueMap = {};
this.fatherValueMap = {}; this.fatherValueMap = {};
this.items = BI.deepClone(this.options.items); this.items = [];
var self = this, o = this.options, children = this._createChildren(this.items); var self = this, o = this.options, children = this._createPopupItems(o.items);
this.popup = BI.createWidget({ this.popup = BI.createWidget({
type: "bi.button_tree", type: "bi.button_tree",
items: BI.createItems(children, items: BI.createItems(children,
@ -75,7 +75,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
}); });
}, },
_createChildren: function (items) { _createPopupItems: function (items) {
var self = this, result = []; var self = this, result = [];
// 不能修改populate进来的item的引用 // 不能修改populate进来的item的引用
BI.each(items, function (i, it) { BI.each(items, function (i, it) {
@ -84,8 +84,11 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
items: [] items: []
}; };
BI.each(it, function (i, item) { var storeItem = [];
if (BI.isNotEmptyArray(item.children) && !BI.isEmpty(item.el)) {
BI.each(it, function (i, sourceItem) {
var item = BI.extend({}, sourceItem);
if (BI.isNotEmptyArray(sourceItem.children) && !BI.isEmpty(sourceItem.el)) {
item.type = "bi.combo_group"; item.type = "bi.combo_group";
// popup未初始化返回的是options中的value, 在经过buttontree的getValue concat之后,无法区分值来自options // popup未初始化返回的是options中的value, 在经过buttontree的getValue concat之后,无法区分值来自options
// 还是item自身, 这边控制defaultInit为true来避免这个问题 // 还是item自身, 这边控制defaultInit为true来避免这个问题
@ -93,12 +96,13 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
item.cls = "down-list-group"; item.cls = "down-list-group";
item.trigger = "hover"; item.trigger = "hover";
item.isNeedAdjustWidth = false; item.isNeedAdjustWidth = false;
item.el.title = item.el.title || item.el.text; item.el = sourceItem.el;
item.el.title = sourceItem.el.title || sourceItem.el.text;
item.el.type = "bi.down_list_group_item"; item.el.type = "bi.down_list_group_item";
item.el.logic = { item.el.logic = {
dynamic: true dynamic: true
}; };
item.el.height = item.el.height || BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT; item.el.height = sourceItem.el.height || BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT;
item.el.iconCls2 = self.constants.nextIcon; item.el.iconCls2 = self.constants.nextIcon;
item.popup = { item.popup = {
lgap: 1, lgap: 1,
@ -113,30 +117,10 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
innerVgap: 5, innerVgap: 5,
maxHeight: 378 maxHeight: 378
}; };
item.el.childValues = []; self._createChildren(item, sourceItem);
item.items = item.children;
BI.each(item.children, function (i, child) {
var fatherValue = BI.deepClone(item.el.value);
var childValue = BI.deepClone(child.value);
self.singleValues.push(child.value);
child.type = child.type || "bi.down_list_item";
child.extraCls = " child-down-list-item";
child.title = child.title || child.text;
child.textRgap = 10;
child.isNeedAdjustWidth = false;
child.logic = {
dynamic: true
};
child.father = fatherValue;
child.childValue = child.value;
self.fatherValueMap[self._createChildValue(fatherValue, childValue)] = fatherValue;
self.childValueMap[self._createChildValue(fatherValue, childValue)] = childValue;
child.value = self._createChildValue(fatherValue, childValue);
item.el.childValues.push(child.value);
});
} else { } else {
item.type = item.type || "bi.down_list_item"; item.type = sourceItem.type || "bi.down_list_item";
item.title = item.title || item.text; item.title = sourceItem.title || sourceItem.text;
item.textRgap = 10; item.textRgap = 10;
item.isNeedAdjustWidth = false; item.isNeedAdjustWidth = false;
item.logic = { item.logic = {
@ -146,6 +130,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
var el_done = {}; var el_done = {};
el_done.el = item; el_done.el = item;
item_done.items.push(el_done); item_done.items.push(el_done);
storeItem.push(item);
}); });
if (self._isGroup(item_done.items)) { if (self._isGroup(item_done.items)) {
BI.each(item_done.items, function (i, item) { BI.each(item_done.items, function (i, item) {
@ -154,6 +139,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
} }
result.push(item_done); result.push(item_done);
self.items.push(storeItem);
if (self._needSpliter(i, items.length)) { if (self._needSpliter(i, items.length)) {
var spliter_container = BI.createWidget({ var spliter_container = BI.createWidget({
type: "bi.vertical", type: "bi.vertical",
@ -176,6 +162,33 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
return result; return result;
}, },
_createChildren: function (targetItem, sourceItem) {
var self = this;
targetItem.el.childValues = [];
targetItem.items = targetItem.children = [];
BI.each(sourceItem.children, function (i, child) {
var item = BI.extend({}, child);
var fatherValue = BI.deepClone(targetItem.el.value);
var childValue = BI.deepClone(item.value);
self.singleValues.push(item.value);
item.type = item.type || "bi.down_list_item";
item.extraCls = " child-down-list-item";
item.title = item.title || item.text;
item.textRgap = 10;
item.isNeedAdjustWidth = false;
item.logic = {
dynamic: true
};
item.father = fatherValue;
item.childValue = item.value;
self.fatherValueMap[self._createChildValue(fatherValue, childValue)] = fatherValue;
self.childValueMap[self._createChildValue(fatherValue, childValue)] = childValue;
item.value = self._createChildValue(fatherValue, childValue);
targetItem.el.childValues.push(item.value);
targetItem.items.push(item);
});
},
_isGroup: function (i) { _isGroup: function (i) {
return i.length > 1; return i.length > 1;
}, },
@ -239,11 +252,11 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
populate: function (items) { populate: function (items) {
BI.DownListPopup.superclass.populate.apply(this, arguments); BI.DownListPopup.superclass.populate.apply(this, arguments);
this.items = BI.deepClone(items); this.items = [];
this.childValueMap = {}; this.childValueMap = {};
this.fatherValueMap = {}; this.fatherValueMap = {};
this.singleValues = []; this.singleValues = [];
var children = this._createChildren(this.items); var children = this._createPopupItems(items);
var popupItem = BI.createItems(children, var popupItem = BI.createItems(children,
{}, { {}, {
adjustLength: -2 adjustLength: -2

8
src/widget/editor/editor.search.js

@ -10,7 +10,8 @@ BI.SearchEditor = BI.inherit(BI.Widget, {
errorText: "", errorText: "",
watermark: BI.i18nText("BI-Basic_Search"), watermark: BI.i18nText("BI-Basic_Search"),
validationChecker: BI.emptyFn, validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn quitChecker: BI.emptyFn,
value: ""
}); });
}, },
_init: function () { _init: function () {
@ -32,7 +33,8 @@ BI.SearchEditor = BI.inherit(BI.Widget, {
this.clear = BI.createWidget({ this.clear = BI.createWidget({
type: "bi.icon_button", type: "bi.icon_button",
stopEvent: true, stopEvent: true,
cls: "close-font" cls: "close-font",
invisible: BI.isKey(o.value)
}); });
this.clear.on(BI.IconButton.EVENT_CHANGE, function () { this.clear.on(BI.IconButton.EVENT_CHANGE, function () {
self.setValue(""); self.setValue("");
@ -123,8 +125,6 @@ BI.SearchEditor = BI.inherit(BI.Widget, {
this.editor.on(BI.Editor.EVENT_STOP, function () { this.editor.on(BI.Editor.EVENT_STOP, function () {
self.fireEvent(BI.SearchEditor.EVENT_STOP); self.fireEvent(BI.SearchEditor.EVENT_STOP);
}); });
this.clear.invisible();
}, },
_checkClear: function () { _checkClear: function () {

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

@ -26,6 +26,7 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
this.singleValues = []; this.singleValues = [];
this.childValueMap = {}; this.childValueMap = {};
this.fatherValueMap = {}; this.fatherValueMap = {};
this.items = [];
var self = this, o = this.options, children = this._createPopupItems(o.items); var self = this, o = this.options, children = this._createPopupItems(o.items);
this.popup = BI.createWidget({ this.popup = BI.createWidget({
type: "bi.button_tree", type: "bi.button_tree",
@ -83,19 +84,22 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
type: "bi.down_list_group", type: "bi.down_list_group",
items: [] items: []
}; };
var storeItem = [];
BI.each(it, function (i, item) { BI.each(it, function (i, sourceItem) {
if (BI.isNotEmptyArray(item.children) && !BI.isEmpty(item.el)) { var item = BI.extend({}, sourceItem);
if (BI.isNotEmptyArray(sourceItem.children) && !BI.isEmpty(sourceItem.el)) {
item.type = "bi.combo_group"; item.type = "bi.combo_group";
item.cls = "down-list-group"; item.cls = "down-list-group";
item.trigger = "hover"; item.trigger = "hover";
item.isNeedAdjustWidth = false; item.isNeedAdjustWidth = false;
item.el.title = item.el.title || item.el.text; item.el = sourceItem.el;
item.el.title = sourceItem.el.title || sourceItem.el.text;
item.el.type = "bi.down_list_group_item"; item.el.type = "bi.down_list_group_item";
item.el.logic = { item.el.logic = {
dynamic: true dynamic: true
}; };
item.el.height = item.el.height || self.constants.height; item.el.height = sourceItem.el.height || self.constants.height;
item.el.iconCls2 = self.constants.nextIcon; item.el.iconCls2 = self.constants.nextIcon;
item.popup = { item.popup = {
lgap: 1, lgap: 1,
@ -110,10 +114,10 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
innerVgap: 5, innerVgap: 5,
maxHeight: 378, maxHeight: 378,
}; };
self._createChildren(item); self._createChildren(item, sourceItem);
} else { } else {
item.type = item.type || "bi.down_list_item"; item.type = sourceItem.type || "bi.down_list_item";
item.title = item.title || item.text; item.title = sourceItem.title || sourceItem.text;
item.textRgap = 10; item.textRgap = 10;
item.isNeedAdjustWidth = false; item.isNeedAdjustWidth = false;
item.logic = { item.logic = {
@ -123,6 +127,7 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
var el_done = {}; var el_done = {};
el_done.el = item; el_done.el = item;
item_done.items.push(el_done); item_done.items.push(el_done);
storeItem.push(item);
}); });
if (self._isGroup(item_done.items)) { if (self._isGroup(item_done.items)) {
BI.each(item_done.items, function (i, item) { BI.each(item_done.items, function (i, item) {
@ -131,6 +136,7 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
} }
result.push(item_done); result.push(item_done);
self.items.push(storeItem);
if (self._needSpliter(i, items.length)) { if (self._needSpliter(i, items.length)) {
var spliter_container = BI.createWidget({ var spliter_container = BI.createWidget({
type: "bi.vertical", type: "bi.vertical",
@ -152,34 +158,35 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
return result; return result;
}, },
_createChildren: function (item) { _createChildren: function (targetItem, sourceItem) {
var self = this; var self = this;
this._formatEL(item).el.childValues = []; this._formatEL(targetItem).el.childValues = [];
item.items = item.children; targetItem.items = targetItem.children = [];
BI.each(item.children, function (i, child) { BI.each(sourceItem.children, function (i, child) {
child = child.el ? BI.extend(child.el, {children: child.children}) : child; var item = child.el ? BI.extend({}, child.el, {children: child.children}) : BI.extend({}, child);
var fatherValue = BI.deepClone(self._formatEL(item).el.value); var fatherValue = BI.deepClone(self._formatEL(targetItem).el.value);
var childValue = BI.deepClone(child.value); var childValue = BI.deepClone(item.value);
self.singleValues.push(child.value); self.singleValues.push(item.value);
child.type = child.type || "bi.down_list_item"; item.type = item.type || "bi.down_list_item";
child.extraCls = " child-down-list-item"; item.extraCls = " child-down-list-item";
child.title = child.title || child.text; item.title = item.title || item.text;
child.textRgap = 10; item.textRgap = 10;
child.isNeedAdjustWidth = false; item.isNeedAdjustWidth = false;
child.logic = { item.logic = {
dynamic: true dynamic: true
}; };
child.father = fatherValue; item.father = fatherValue;
self.fatherValueMap[self._createChildValue(fatherValue, childValue)] = fatherValue; self.fatherValueMap[self._createChildValue(fatherValue, childValue)] = fatherValue;
self.childValueMap[self._createChildValue(fatherValue, childValue)] = childValue; self.childValueMap[self._createChildValue(fatherValue, childValue)] = childValue;
child.value = self._createChildValue(fatherValue, childValue); item.value = self._createChildValue(fatherValue, childValue);
self._formatEL(item).el.childValues.push(child.value); self._formatEL(targetItem).el.childValues.push(item.value);
if (BI.isNotEmptyArray(child.children)) { if (BI.isNotEmptyArray(child.children)) {
child.type = "bi.down_list_group_item"; item.type = "bi.down_list_group_item";
child.iconCls2 = self.constants.nextIcon; item.iconCls2 = self.constants.nextIcon;
child.height = child.height || self.constants.height; item.height = child.height || self.constants.height;
self._createChildren(child); self._createChildren(item, child);
} }
targetItem.items.push(item);
}); });
}, },
@ -228,7 +235,7 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
_checkValues: function (values) { _checkValues: function (values) {
var self = this, o = this.options; var self = this, o = this.options;
var value = []; var value = [];
BI.each(o.items, function (idx, itemGroup) { BI.each(this.items, function (idx, itemGroup) {
BI.each(itemGroup, function (id, item) { BI.each(itemGroup, function (id, item) {
if(BI.isNotNull(item.children)) { if(BI.isNotNull(item.children)) {
var childValues = getChildrenValue(item); var childValues = getChildrenValue(item);
@ -277,6 +284,7 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
self.childValueMap = {}; self.childValueMap = {};
self.fatherValueMap = {}; self.fatherValueMap = {};
self.singleValues = []; self.singleValues = [];
this.items = [];
var children = self._createPopupItems(items); var children = self._createPopupItems(items);
var popupItem = BI.createItems(children, var popupItem = BI.createItems(children,
{}, { {}, {

24
src/widget/multiselect/multiselect.combo.js

@ -17,14 +17,15 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
}, },
_init: function () { _init: function () {
var self = this; var o = this.options; var self = this;
var o = this.options;
BI.MultiSelectCombo.superclass._init.apply(this, arguments); BI.MultiSelectCombo.superclass._init.apply(this, arguments);
var assertShowValue = function () { var assertShowValue = function () {
if (BI.isKey(self._startValue)) { if (BI.isKey(self._startValue)) {
if (self.storeValue.type === BI.Selection.All) { if (self.storeValue.type === BI.Selection.All) {
BI.remove(self.storeValue.value, self._startValue); BI.remove(self.storeValue.value, self._startValue);
self.storeValue.assist = self.storeValue.assist || []; self.storeValue.assist = self.storeValue.assist || [];
self.storeValue.assist.pushDistinct(self._startValue); BI.pushDistinct(self.storeValue.assist, self._startValue);
} else { } else {
BI.pushDistinct(self.storeValue.value, self._startValue); BI.pushDistinct(self.storeValue.value, self._startValue);
BI.remove(self.storeValue.assist, self._startValue); BI.remove(self.storeValue.assist, self._startValue);
@ -280,7 +281,8 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
}, },
_itemsCreator4Trigger: function (op, callback) { _itemsCreator4Trigger: function (op, callback) {
var self = this; var o = this.options; var self = this;
var o = this.options;
o.itemsCreator(op, function (res) { o.itemsCreator(op, function (res) {
if (op.times === 1 && BI.isNotNull(op.keywords)) { if (op.times === 1 && BI.isNotNull(op.keywords)) {
// 预防trigger内部把当前的storeValue改掉 // 预防trigger内部把当前的storeValue改掉
@ -311,7 +313,8 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
}, },
_joinKeywords: function (keywords, callback) { _joinKeywords: function (keywords, callback) {
var self = this; var o = this.options; var self = this;
var o = this.options;
this._assertValue(this.storeValue); this._assertValue(this.storeValue);
this.requesting = true; this.requesting = true;
o.itemsCreator({ o.itemsCreator({
@ -322,7 +325,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
digest(values); digest(values);
}); });
function digest (items) { function digest(items) {
var selectedMap = self._makeMap(items); var selectedMap = self._makeMap(items);
BI.each(keywords, function (i, val) { BI.each(keywords, function (i, val) {
if (BI.isNotNull(selectedMap[val])) { if (BI.isNotNull(selectedMap[val])) {
@ -334,7 +337,8 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
}, },
_joinAll: function (res, callback) { _joinAll: function (res, callback) {
var self = this; var o = this.options; var self = this;
var o = this.options;
this._assertValue(res); this._assertValue(res);
this.requesting = true; this.requesting = true;
if (this.storeValue.type === res.type) { if (this.storeValue.type === res.type) {
@ -385,11 +389,12 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
}, },
_adjust: function (callback) { _adjust: function (callback) {
var self = this; var o = this.options; var self = this;
var o = this.options;
adjust(); adjust();
callback(); callback();
function adjust () { function adjust() {
if (self.wants2Quit === true) { if (self.wants2Quit === true) {
self._dataChange && self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM); self._dataChange && self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM);
self.wants2Quit = false; self.wants2Quit = false;
@ -399,7 +404,8 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
}, },
_join: function (res, callback) { _join: function (res, callback) {
var self = this; var o = this.options; var self = this;
var o = this.options;
this._assertValue(res); this._assertValue(res);
this._assertValue(this.storeValue); this._assertValue(this.storeValue);
if (this.storeValue.type === res.type) { if (this.storeValue.type === res.type) {

6
src/widget/multiselect/multiselect.combo.nobar.js

@ -23,7 +23,7 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
if (self.storeValue.type === BI.Selection.All) { if (self.storeValue.type === BI.Selection.All) {
BI.remove(self.storeValue.value, self._startValue); BI.remove(self.storeValue.value, self._startValue);
self.storeValue.assist = self.storeValue.assist || []; self.storeValue.assist = self.storeValue.assist || [];
self.storeValue.assist.pushDistinct(self._startValue); BI.pushDistinct(self.storeValue.assist, self._startValue);
} else { } else {
BI.pushDistinct(self.storeValue.value, self._startValue); BI.pushDistinct(self.storeValue.value, self._startValue);
BI.remove(self.storeValue.assist, self._startValue); BI.remove(self.storeValue.assist, self._startValue);
@ -461,11 +461,11 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
this.combo.populate.apply(this.combo, arguments); this.combo.populate.apply(this.combo, arguments);
}, },
showView:function (){ showView: function () {
this.combo.showView(); this.combo.showView();
}, },
hideView:function (){ hideView: function () {
this.combo.hideView(); this.combo.hideView();
}, },

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

@ -21,10 +21,10 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
BI.MultiSelectInsertCombo.superclass._init.apply(this, arguments); BI.MultiSelectInsertCombo.superclass._init.apply(this, arguments);
var assertShowValue = function () { var assertShowValue = function () {
if (BI.isKey(self._startValue)) { if (BI.isKey(self._startValue)) {
if(self.storeValue.type === BI.Selection.All) { if (self.storeValue.type === BI.Selection.All) {
BI.remove(self.storeValue.value, self._startValue); BI.remove(self.storeValue.value, self._startValue);
self.storeValue.assist = self.storeValue.assist || []; self.storeValue.assist = self.storeValue.assist || [];
self.storeValue.assist.pushDistinct(self._startValue); BI.pushDistinct(self.storeValue.assist, self._startValue);
} else { } else {
BI.pushDistinct(self.storeValue.value, self._startValue); BI.pushDistinct(self.storeValue.value, self._startValue);
BI.remove(self.storeValue.assist, self._startValue); BI.remove(self.storeValue.assist, self._startValue);
@ -282,7 +282,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
}); });
}, },
_itemsCreator4Trigger: function(op, callback) { _itemsCreator4Trigger: function (op, callback) {
var self = this, o = this.options; var self = this, o = this.options;
o.itemsCreator(op, function (res) { o.itemsCreator(op, function (res) {
if (op.times === 1 && BI.isNotNull(op.keywords)) { if (op.times === 1 && BI.isNotNull(op.keywords)) {
@ -313,7 +313,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
}); });
}, },
_stopEditing: function() { _stopEditing: function () {
this.trigger.stopEditing(); this.trigger.stopEditing();
this.numberCounter.hideView(); this.numberCounter.hideView();
}, },
@ -340,7 +340,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
digest(); digest();
function digest () { function digest() {
BI.each(keywords, function (i, val) { BI.each(keywords, function (i, val) {
self.storeValue.type === BI.Selection.Multi ? BI.pushDistinct(self.storeValue.value, val) : BI.remove(self.storeValue.value, val); self.storeValue.type === BI.Selection.Multi ? BI.pushDistinct(self.storeValue.value, val) : BI.remove(self.storeValue.value, val);
}); });
@ -403,7 +403,8 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
var self = this, o = this.options; var self = this, o = this.options;
adjust(); adjust();
callback(); callback();
function adjust () {
function adjust() {
if (self.wants2Quit === true) { if (self.wants2Quit === true) {
self._dataChange && self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CONFIRM); self._dataChange && self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CONFIRM);
self.wants2Quit = false; self.wants2Quit = false;
@ -450,11 +451,11 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
this.combo.populate.apply(this.combo, arguments); this.combo.populate.apply(this.combo, arguments);
}, },
showView:function (){ showView: function () {
this.combo.showView(); this.combo.showView();
}, },
hideView:function (){ hideView: function () {
this.combo.hideView(); this.combo.hideView();
}, },

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

@ -23,7 +23,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
if (self.storeValue.type === BI.Selection.All) { if (self.storeValue.type === BI.Selection.All) {
BI.remove(self.storeValue.value, self._startValue); BI.remove(self.storeValue.value, self._startValue);
self.storeValue.assist = self.storeValue.assist || []; self.storeValue.assist = self.storeValue.assist || [];
self.storeValue.assist.pushDistinct(self._startValue); BI.pushDistinct(self.storeValue.assist, self._startValue);
} else { } else {
BI.pushDistinct(self.storeValue.value, self._startValue); BI.pushDistinct(self.storeValue.value, self._startValue);
BI.remove(self.storeValue.assist, self._startValue); BI.remove(self.storeValue.assist, self._startValue);
@ -279,7 +279,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
}); });
}, },
_itemsCreator4Trigger: function(op, callback) { _itemsCreator4Trigger: function (op, callback) {
var self = this, o = this.options; var self = this, o = this.options;
o.itemsCreator(op, function (res) { o.itemsCreator(op, function (res) {
if (op.times === 1 && BI.isNotNull(op.keywords)) { if (op.times === 1 && BI.isNotNull(op.keywords)) {
@ -310,7 +310,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
}); });
}, },
_stopEditing: function() { _stopEditing: function () {
this.trigger.stopEditing(); this.trigger.stopEditing();
this.numberCounter.hideView(); this.numberCounter.hideView();
}, },
@ -337,7 +337,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
digest(); digest();
function digest () { function digest() {
BI.each(keywords, function (i, val) { BI.each(keywords, function (i, val) {
self.storeValue.type === BI.Selection.Multi ? BI.pushDistinct(self.storeValue.value, val) : BI.remove(self.storeValue.value, val); self.storeValue.type === BI.Selection.Multi ? BI.pushDistinct(self.storeValue.value, val) : BI.remove(self.storeValue.value, val);
}); });
@ -400,7 +400,8 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
var self = this, o = this.options; var self = this, o = this.options;
adjust(); adjust();
callback(); callback();
function adjust () {
function adjust() {
if (self.wants2Quit === true) { if (self.wants2Quit === true) {
self._dataChange && self.fireEvent(BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM); self._dataChange && self.fireEvent(BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM);
self.wants2Quit = false; self.wants2Quit = false;
@ -446,11 +447,11 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
this.combo.populate.apply(this.combo, arguments); this.combo.populate.apply(this.combo, arguments);
}, },
showView:function (){ showView: function () {
this.combo.showView(); this.combo.showView();
}, },
hideView:function (){ hideView: function () {
this.combo.hideView(); this.combo.hideView();
}, },

2
src/widget/singleselect/singleselect.combo.js

@ -10,6 +10,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
baseCls: "bi-single-select-combo", baseCls: "bi-single-select-combo",
allowNoSelect: false, allowNoSelect: false,
itemsCreator: BI.emptyFn, itemsCreator: BI.emptyFn,
itemWrapper: BI.emptyFn,
valueFormatter: BI.emptyFn, valueFormatter: BI.emptyFn,
height: 24, height: 24,
allowEdit: true allowEdit: true
@ -107,6 +108,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
} }
}], }],
itemsCreator: o.itemsCreator, itemsCreator: o.itemsCreator,
itemWrapper: o.itemWrapper,
valueFormatter: o.valueFormatter, valueFormatter: o.valueFormatter,
onLoaded: function () { onLoaded: function () {
BI.nextTick(function () { BI.nextTick(function () {

2
src/widget/singleselect/singleselect.insert.combo.js

@ -10,6 +10,7 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, {
baseCls: "bi-single-select-combo", baseCls: "bi-single-select-combo",
allowNoSelect: false, allowNoSelect: false,
itemsCreator: BI.emptyFn, itemsCreator: BI.emptyFn,
itemWrapper: BI.emptyFn,
valueFormatter: BI.emptyFn, valueFormatter: BI.emptyFn,
height: 24, height: 24,
allowEdit: true, allowEdit: true,
@ -118,6 +119,7 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, {
} }
}], }],
itemsCreator: o.itemsCreator, itemsCreator: o.itemsCreator,
itemWrapper: o.itemWrapper,
valueFormatter: o.valueFormatter, valueFormatter: o.valueFormatter,
onLoaded: function () { onLoaded: function () {
BI.nextTick(function () { BI.nextTick(function () {

10
src/widget/singleselect/singleselect.loader.js

@ -22,6 +22,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
allowNoSelect: false, allowNoSelect: false,
valueFormatter: BI.emptyFn, valueFormatter: BI.emptyFn,
itemsCreator: BI.emptyFn, itemsCreator: BI.emptyFn,
itemWrapper: BI.emptyFn,
onLoaded: BI.emptyFn onLoaded: BI.emptyFn
}); });
}, },
@ -69,7 +70,12 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
if (op.times === 1 && !BI.isUndefined(self.storeValue)) { if (op.times === 1 && !BI.isUndefined(self.storeValue)) {
var json = BI.map([self.storeValue], function (i, v) { var json = BI.map([self.storeValue], function (i, v) {
var txt = opts.valueFormatter(v) || v; var txt = opts.valueFormatter(v) || v;
return { return opts.itemWrapper({
text: txt,
value: v,
title: txt,
selected: true
}) || {
text: txt, text: txt,
value: v, value: v,
title: txt, title: txt,
@ -117,7 +123,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
selected: false, selected: false,
iconWrapperWidth: 26, iconWrapperWidth: 26,
hgap: o.allowNoSelect ? 10 : 0, textHgap: o.allowNoSelect ? 10 : 0,
title: item.title || item.text title: item.title || item.text
}, item); }, item);
}); });

2
src/widget/singleselect/singleselect.popup.view.js

@ -14,6 +14,7 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, {
maxHeight: 400, maxHeight: 400,
valueFormatter: BI.emptyFn, valueFormatter: BI.emptyFn,
itemsCreator: BI.emptyFn, itemsCreator: BI.emptyFn,
itemWrapper: BI.emptyFn,
onLoaded: BI.emptyFn onLoaded: BI.emptyFn
}); });
}, },
@ -26,6 +27,7 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, {
type: "bi.single_select_loader", type: "bi.single_select_loader",
allowNoSelect: opts.allowNoSelect, allowNoSelect: opts.allowNoSelect,
itemsCreator: opts.itemsCreator, itemsCreator: opts.itemsCreator,
itemWrapper: opts.itemWrapper,
valueFormatter: opts.valueFormatter, valueFormatter: opts.valueFormatter,
onLoaded: opts.onLoaded, onLoaded: opts.onLoaded,
value: opts.value value: opts.value

2
src/widget/singleselect/singleselectlist.insert.js

@ -9,6 +9,7 @@ BI.SingleSelectInsertList = BI.inherit(BI.Single, {
baseCls: "bi-multi-select-insert-list", baseCls: "bi-multi-select-insert-list",
allowNoSelect: false, allowNoSelect: false,
itemsCreator: BI.emptyFn, itemsCreator: BI.emptyFn,
itemWrapper: BI.emptyFn,
valueFormatter: BI.emptyFn, valueFormatter: BI.emptyFn,
searcherHeight: 24, searcherHeight: 24,
}); });
@ -30,6 +31,7 @@ BI.SingleSelectInsertList = BI.inherit(BI.Single, {
cls: "popup-single-select-list bi-border-left bi-border-right bi-border-bottom", cls: "popup-single-select-list bi-border-left bi-border-right bi-border-bottom",
itemsCreator: o.itemsCreator, itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter, valueFormatter: o.valueFormatter,
itemWrapper: o.itemWrapper,
logic: { logic: {
dynamic: true dynamic: true
}, },

2
typescript/base/combination/combo.ts

@ -59,6 +59,8 @@ export declare class Combo extends Widget {
getPopupPosition(): any; getPopupPosition(): any;
adjustWidth(e?:MouseEvent): void;
adjustHeight(e?: MouseEvent): void; adjustHeight(e?: MouseEvent): void;
toggle(): void; toggle(): void;

2
typescript/base/foundation/message.ts

@ -2,5 +2,5 @@ export type _msg = {
alert: (title: string, message?: string | {[key: string]: any}, callback?: (result?: boolean)=>void) => void alert: (title: string, message?: string | {[key: string]: any}, callback?: (result?: boolean)=>void) => void
confirm: (title: string, message?: string | {[key: string]: any}, callback?: (result: boolean)=>void) => void confirm: (title: string, message?: string | {[key: string]: any}, callback?: (result: boolean)=>void) => void
prompt: (title: string, message?: string, value?: any, callback?: (result: string) => void, minWidth?: number) => void prompt: (title: string, message?: string, value?: any, callback?: (result: string) => void, minWidth?: number) => void
toast: (message: string, options?: object, context?: HTMLElement) => void toast: (message: string, options?: object | string, context?: HTMLElement) => void
} }

4
typescript/case/combo/bubblecombo/combo.bubble.ts

@ -17,4 +17,8 @@ export declare class BubbleCombo extends Widget {
showView(): void; showView(): void;
isViewVisible(): boolean; isViewVisible(): boolean;
adjustWidth(e?:MouseEvent): void;
adjustHeight(e?: MouseEvent): void;
} }

6
webpack/webpack.dev.js

@ -36,11 +36,17 @@ module.exports = merge(common, {
output: { output: {
path: dirs.DEST, path: dirs.DEST,
filename: "[name].js", filename: "[name].js",
publicPath: '/',
}, },
devServer: { devServer: {
contentBase: path.join(__dirname, ".."), contentBase: path.join(__dirname, ".."),
port: 9001, port: 9001,
liveReload: true, liveReload: true,
historyApiFallback: {
rewrites: [
{ from: /.*/, to: '/index.html' },
],
},
}, },
plugins: [ plugins: [
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({

1
webpack/webpack.prod.js

@ -23,6 +23,7 @@ module.exports = merge.smart(common, {
utils: attachments.utils, utils: attachments.utils,
"utils.min": attachments.utils, "utils.min": attachments.utils,
"fineui_without_jquery_polyfill": attachments.fineuiWithoutJqueryAndPolyfillJs, "fineui_without_jquery_polyfill": attachments.fineuiWithoutJqueryAndPolyfillJs,
"fineui_without_jquery_polyfill.min": attachments.fineuiWithoutJqueryAndPolyfillJs,
"2.0/fineui": attachments.bundle, "2.0/fineui": attachments.bundle,
"2.0/fineui.min": attachments.bundle, "2.0/fineui.min": attachments.bundle,
"2.0/fineui_without_normalize": attachments.bundleWithoutNormalize, "2.0/fineui_without_normalize": attachments.bundleWithoutNormalize,

Loading…
Cancel
Save