Browse Source

Merge branch 'master' of ssh://code.fineres.com:7999/~zhenfei.li/fineui into es6

# Conflicts:
#	src/base/single/editor/editor.js
#	src/core/utils/chinesePY.js
es6
Zhenfei.Li 2 years ago
parent
commit
70accbff8f
  1. 3
      bi.lessconfig.json
  2. BIN
      dist/font/iconfont.eot
  3. 18
      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. 51
      src/base/single/editor/editor.js
  9. 2
      src/case/combo/textvaluecombo/combo.textvalue.js
  10. 6
      src/case/combo/textvaluecombo/popup.textvalue.js
  11. 4
      src/case/editor/editor.sign.js
  12. 4
      src/core/platform/web/dom.js
  13. 7
      src/core/utils/chinesePY.js
  14. 89
      src/widget/multiselect/multiselect.combo.nobar.js
  15. 90
      src/widget/multiselect/multiselect.insert.combo.js
  16. 87
      src/widget/multiselect/multiselect.insert.combo.nobar.js
  17. 30
      src/widget/multiselect/multiselect.insert.trigger.js
  18. 35
      src/widget/multiselect/multiselect.trigger.js
  19. 32
      src/widget/multiselect/search/multiselect.search.loader.js
  20. 23
      src/widget/multiselect/trigger/searcher.multiselect.insert.js
  21. 23
      src/widget/multiselect/trigger/searcher.multiselect.js
  22. 51
      src/widget/numbereditor/number.editor.js
  23. 120
      src/widget/yearmonth/combo.yearmonth.js
  24. 122
      src/widget/yearquarter/combo.yearquarter.js
  25. 11
      typescript/core/base.ts

3
bi.lessconfig.json

@ -29,7 +29,8 @@
"@color-bi-background-disabled-active-radio-content-theme-dark": "#606479",
"@color-bi-background-disabled-active-checkbox-content": "#FFFFFF",
"@color-bi-background-disabled-active-checkbox-content-theme-dark": "#606479",
"@color-bi-background-tooltip-success": "#2E3A4D",
"@color-bi-background-tooltip-success": "#3F506A",
"@color-bi-background-tooltip-failure": "#E65251",
"@color-bi-border-tooltip-success": "#2E3A4D",
"@color-bi-background-toast-success": "#FFFFFF",
"@color-bi-background-toast-warning": "#FFFFFF",

BIN
dist/font/iconfont.eot vendored

Binary file not shown.

18
dist/font/iconfont.svg vendored

@ -14,6 +14,24 @@
/>
<missing-glyph />
<glyph glyph-name="piliangjiejue" unicode="&#59867;" d="M800 800a128 128 0 0 0 128-128v-576a128 128 0 0 0-128-128h-576a128 128 0 0 0-128 128v576a128 128 0 0 0 128 128h576z m0-64h-576a64 64 0 0 1-63.552-56.512L160 672v-576a64 64 0 0 1 56.512-63.552l7.488-0.448h576a64 64 0 0 1 63.552 56.512l0.448 7.488v576a64 64 0 0 1-56.512 63.552L800 736z m-49.792-199.488l4.48-3.712a32 32 0 0 0 3.648-40.832l-3.712-4.416-275.84-275.84a32 32 0 0 0-40.832-3.712l-4.48 3.712-152.192 152.192a32 32 0 0 0 40.832 48.96l4.48-3.712L456.064 279.68l253.312 253.184a32 32 0 0 0 40.832 3.712z" horiz-adv-x="1024" />
<glyph glyph-name="shujujieshi1" unicode="&#59868;" d="M809.152 800c65.344 0 118.848-53.504 118.848-118.848v-475.456a119.232 119.232 0 0 0-118.848-118.848H448v-83.2c0-23.744-17.856-35.648-35.648-35.648-5.952 0-11.904 0-17.856 5.952l-124.8 112.896h-54.848A119.232 119.232 0 0 0 96 205.696V681.152c0 65.344 53.504 118.848 118.848 118.848z m0-59.456H214.848c-35.648 0-59.392-23.744-59.392-59.392v-475.456c0-35.648 23.744-59.392 59.392-59.392h54.848c11.904 0 29.76-5.952 41.6-17.856l77.248-71.296v29.696c0 17.856 5.952 29.696 17.856 41.6a53.952 53.952 0 0 0 41.6 17.856h361.152c35.648 0 59.392 23.744 59.392 59.392V681.152c0 35.648-23.744 59.392-59.392 59.392zM512 640a32 32 0 0 0 32-32v-320a32 32 0 0 0-64 0v320A32 32 0 0 0 512 640z m160-192a32 32 0 0 0 32-32v-128a32 32 0 1 0-64 0v128a32 32 0 0 0 32 32z m-320 64a32 32 0 0 0 32-32v-192a32 32 0 0 0-64 0v192a32 32 0 0 0 32 32z" horiz-adv-x="1024" />
<glyph glyph-name="yanqi" unicode="&#59869;" d="M602.816 10.752l15.104-62.144a444.928 444.928 0 0 0-68.032-11.072l-5.376 63.744c19.712 1.664 39.168 4.864 58.24 9.472z m112.448 47.424l33.92-54.272a448.64 448.64 0 0 0-61.12-31.936l-25.152 58.88a384.64 384.64 0 0 1 52.352 27.328z m88.832 76.48l48.64-41.6a449.984 449.984 0 0 0-48.64-48.768l-41.728 48.512c14.976 12.864 28.928 26.88 41.728 41.856z m63.04 103.04l59.2-24.384c-8.768-21.312-19.2-41.92-31.104-61.568l-54.72 33.28c10.24 16.768 19.136 34.368 26.624 52.608zM512 632.96a32 32 0 0 0 31.488-26.24l0.512-5.76-0.064-200.896L723.2 265.408a32 32 0 0 0 9.408-39.872l-3.008-4.928a32 32 0 0 0-39.936-9.408l-4.864 3.072-192 144.128a32 32 0 0 0-12.224 19.648L480 384V600.96a32 32 0 0 0 32 32z m382.72-280.32l63.808-5.312-0.96-9.984a452.544 452.544 0 0 0-9.984-58.176l-62.208 14.912c2.56 10.88 4.736 21.888 6.4 33.024l2.688 22.336 0.256 3.2z m55.04 127.04c4.928-22.4 8.064-45.248 9.472-68.352l-63.872-3.84a381.184 381.184 0 0 1-8.128 58.496l62.528 13.696z m-251.264 240.064l-2.56 1.408-2.368 1.28-3.712 1.984-0.96 0.512 0.384-0.256-2.944 1.536-1.792 0.896-4.16 2.048-16.768 7.68a383.296 383.296 0 0 1-87.104 25.728l2.048-0.384-3.84 0.64-10.24 1.6a391.616 391.616 0 0 1-12.032 1.472h0.064-0.64l-14.08 1.28a384 384 0 0 1-78.464-2.688l-19.008-3.136-14.592-3.072-5.184-1.28a382.08 382.08 0 0 1-59.904-19.968l-16.32-7.552-16.256-8.32a385.408 385.408 0 0 1-16.512-9.6l-1.216-0.768-1.344-0.832-0.448-0.256-0.64-0.448-0.448-0.256-14.848-9.856c-10.752-7.488-21.12-15.488-31.04-24.064l-13.312-11.968a385.472 385.472 0 0 1-72.512-93.44l-0.896-1.664-7.168-13.824-0.96-1.92-0.96-1.984-1.6-3.328-2.816-6.144 1.28 2.688-1.792-3.84-0.32-0.64 0.32 0.64-0.64-1.6V538.24l-3.904-9.28a382.208 382.208 0 0 1-19.392-62.464l-1.92-9.408-1.984-11.392a388.608 388.608 0 0 1-2.88-21.504l-0.512-5.504-0.768-8.832c-1.536-23.168-1.024-46.08 1.472-68.48l2.112-16.128 3.072-17.152 1.344-6.656 0.32-1.472 0.384-1.6 4.48-17.664c5.696-20.096 12.928-39.552 21.568-58.24l6.912-14.08 1.728-3.328 1.536-2.944 1.024-1.856 3.264-5.76 2.112-3.712 4.8-8c1.92-3.2 3.904-6.272 5.952-9.408l6.528-9.6c6.336-8.96 12.992-17.728 20.096-26.176l9.728-11.2 11.968-12.608c4.224-4.288 8.576-8.448 12.992-12.544l0.64-0.64 1.792-1.6 2.432-2.176-2.432 2.176 6.144-5.44c2.88-2.496 5.76-4.928 8.768-7.36l0.832-0.64c16.448-13.376 34.048-25.408 52.672-35.904l12.544-6.848 2.688-1.28 14.272-6.912 6.08-2.688c22.528-9.856 46.208-17.536 70.912-22.976l0.96-0.192 12.928-2.56c4.672-0.832 9.408-1.6 14.08-2.304l6.592-0.832a405.12 405.12 0 0 1 25.28-2.368l-3.84-63.872a455.296 455.296 0 0 0-20.032 1.664l-0.448 0.064h0.064l-13.056 1.6-3.008 0.32a455.232 455.232 0 0 0-8.128 1.28l-7.232 1.152-11.456 2.176a312.96 312.96 0 0 0-5.248 1.152 445.824 445.824 0 0 0-66.368 19.776h0.064l-2.304 0.896a444.48 444.48 0 0 0-17.6 7.296l2.56-1.088-5.824 2.56a441.664 441.664 0 0 0-35.904 18.176l-3.2 1.856a445.76 445.76 0 0 0-40.32 26.24l-19.008 14.656-2.048 1.664-8 6.72-7.744 6.912a449.92 449.92 0 0 0-72.128 83.648l-8.704 13.696 6.976-11.008-7.04 11.008-1.6 2.56 0.832-1.28-1.024 1.6-0.128 0.192-0.192 0.32-4.544 7.808a445.056 445.056 0 0 0-43.968 105.088l-0.64 2.368-2.944 11.84-1.216 5.12-0.768 3.392 0.512-2.24-1.28 5.696a431.552 431.552 0 0 0-6.592 40.96l-0.32 3.008a446.72 446.72 0 0 0-2.432 59.904l0.704 15.808 0.384 5.76a455.68 455.68 0 0 0 1.28 13.76v0.96l0.32 2.56 0.64 5.12 0.384 3.072 0.064 0.704 0.32 2.432 0.128 0.448 1.408 9.472a445.12 445.12 0 0 0 29.12 101.952l0.192 0.448c2.56 6.208 5.568 12.8 8.704 19.328l1.024 2.176c13.248 27.392 29.248 53.12 47.488 76.992l4.672 5.888 0.64 0.704 4.992 6.208 2.432 3.008 6.4 7.424a449.024 449.024 0 0 0 82.24 73.024l2.816 1.92A449.92 449.92 0 0 0 381.696 812.8l3.968 1.216 1.408 0.384c13.696 4.032 27.712 7.36 41.856 9.984l3.776 0.704c24.64 4.48 49.92 6.848 75.584 7.04l19.328-0.32a453.76 453.76 0 0 0 31.232-2.176h0.128l10.816-1.28 1.472-0.192 1.28-0.192 8.064-1.152-3.392 0.448 7.168-1.088a458.752 458.752 0 0 0 86.4-23.104l21.312-8.704 3.2-1.408 4.416-1.984 3.712-1.792 2.56-1.152a444.992 444.992 0 0 0 24.64-12.8l5.632-3.2a464.64 464.64 0 0 0 16.64-10.176c33.024-21.056 63.232-46.4 89.728-75.392l1.6-1.92c6.528-7.04 12.8-14.464 18.816-22.08l10.688 101.888a32 32 0 0 0 29.44 28.544l5.76-0.064a32 32 0 0 0 28.544-29.44l-0.064-5.76-20.096-190.912a32 32 0 0 0-29.44-28.608l-5.76 0.128-190.912 20.032a32 32 0 0 0 0.896 63.744l5.76-0.064 125.504-13.12a385.664 385.664 0 0 1-6.656 8.96l-7.68 9.664-12.736 14.72-13.44 14.08-2.56 2.56 0.64-0.512-1.216 1.024-1.024 0.96-2.176 2.176a385.6 385.6 0 0 1-6.528 6.08l6.848-6.528-11.072 10.304a383.04 383.04 0 0 1-67.2 47.488z" horiz-adv-x="1024" />
<glyph glyph-name="moxingshitu" unicode="&#59864;" d="M379.184 708C363.404 765.64 310.648 808 248 808c-75.112 0-136-60.888-136-136s60.888-136 136-136c62.648 0 115.4 42.36 131.184 100h354.524c58.904 0 106.652-47.988 106.652-107.188 0-59.196-47.748-107.188-106.652-107.188h-90.98C626.408 478.436 574.056 520 512 520c-62.056 0-114.408-41.564-130.728-98.376H297.9C197.44 421.624 116 339.776 116 238.812 116 137.848 197.44 56 297.9 56h345.888c14.388-59.668 68.124-104 132.212-104 75.112 0 136 60.888 136 136s-60.888 136-136 136c-61.188 0-112.94-40.412-130.024-96h-348.08c-60.892 0-110.256 49.612-110.256 110.812 0 61.2 49.364 110.812 110.26 110.812h82.48C395.608 291.156 448.764 248 512 248c63.236 0 116.392 43.156 131.62 101.624h90.088c98.468 0 178.292 80.224 178.292 179.188C912 627.772 832.176 708 733.708 708h-354.52zM248 736c35.348 0 64-28.652 64-64s-28.652-64-64-64-64 28.652-64 64 28.652 64 64 64z m528-584c35.348 0 64-28.652 64-64s-28.652-64-64-64-64 28.652-64 64 28.652 64 64 64z m-328 232c0 35.348 28.652 64 64 64s64-28.652 64-64-28.652-64-64-64-64 28.652-64 64z" horiz-adv-x="1024" />
<glyph glyph-name="fenxishitu" unicode="&#59865;" d="M896 532V752a16 16 0 0 1-16 16h-161.716c-13 35.036-46.728 60-86.284 60H392c-39.56 0-73.28-24.964-86.28-60H144a16 16 0 0 1-16-16v-752a16 16 0 0 1 16-16h256v64H200a8 8 0 0 0-8 8V696a8 8 0 0 0 8 8h105.72C318.72 668.964 352.44 644 392 644h240c39.556 0 73.284 24.964 86.284 60H824a8 8 0 0 0 8-8v-164h64zM392 708a28 28 0 1 0 0 56h240a28 28 0 1 0 0-56H392zM531.608 148.596a16 16 0 0 1-4.672-11.3v-135.776a16 16 0 0 1 16-16h135.752a16.016 16.016 0 0 1 11.332 4.7l295.248 296.092a16.004 16.004 0 0 1-0.016 22.612l-135.764 135.764a16 16 0 0 1-22.644-0.016l-295.236-296.076z m59.328-31.14l247.284 247.988 67.884-67.884-247.34-248.04h-67.828v67.936zM779.256 503.432a8 8 0 0 1 0 11.312l-39.6 39.6a8 8 0 0 1-11.312 0l-150.888-150.888-148.344 148.344a8 8 0 0 1-11.312 0l-172.144-172.144a8 8 0 0 1 0-11.312l39.6-39.6a8 8 0 0 1 11.312 0l126.888 126.888 148.344-148.344a8 8 0 0 1 11.312 0l196.144 196.144z" horiz-adv-x="1024" />
<glyph glyph-name="zhutixieyuan" unicode="&#59866;" d="M336 552h360.66c-1.348-33.18-6.908-56.656-14.484-73.496-8.528-18.964-20.592-31.728-36.12-40.676-33.324-19.212-79.596-19.828-134.056-19.828h-3.412c-50 0.016-107.364 0.028-151.952-25.672-23.936-13.8-48.76-35.16-63.256-67.388-13.104-29.132-20.16-65.196-21.236-108.94H96a16 16 0 0 1-16-16v-232a16 16 0 0 1 16-16h592a16 16 0 0 1 16 16v232a16 16 0 0 1-16 16H327.2c1.052 35.304 6.748 59.984 14.624 77.496 8.528 18.964 20.592 31.728 36.12 40.676 33.324 19.212 79.596 19.828 134.056 19.828h3.412c50-0.016 107.364-0.028 151.952 25.672 23.936 13.8 48.764 35.16 63.256 67.388 12.7 28.24 19.72 62.992 21.12 104.94H928a16 16 0 0 1 16 16V800a16 16 0 0 1-16 16H336a16 16 0 0 1-16-16v-232a16 16 0 0 1 16-16z m48 64V752h496v-136H384z m256-600H144v136h496v-136z" horiz-adv-x="1024" />
<glyph glyph-name="quanbuzhankai" unicode="&#59863;" d="M152 752a16 16 0 0 0 16 16h688a16 16 0 0 0 16-16v-264a16 16 0 0 0-16-16H168a16 16 0 0 0-16 16V752z m64-48v-168h592V704H216zM218.628 375.312a15.992 15.992 0 0 0 22.628 0l272.224-272.224 271.836 271.836a16 16 0 0 0 22.628 0l33.94-33.944a16 16 0 0 0 0-22.628l-316.784-316.78a15.992 15.992 0 0 0-17.636-3.388 15.916 15.916 0 0 0-5.992 3.776l-316.784 316.784a16 16 0 0 0 0 22.628l33.94 33.94z" horiz-adv-x="1024" />
<glyph glyph-name="quanbuzhedie" unicode="&#59862;" d="M168 672a16 16 0 0 1-16-16v-48a16 16 0 0 1 16-16h688a16 16 0 0 1 16 16V656a16 16 0 0 1-16 16H168zM806.276 101.444a15.996 15.996 0 0 0-22.628 0l-273.456 273.456-272.936-272.94a16 16 0 0 0-22.628 0l-33.94 33.944a15.996 15.996 0 0 0 0 22.624l316.784 316.784a15.984 15.984 0 0 0 15.44 4.148c3.824-0.188 7.6-1.744 10.52-4.664l316.784-316.784a16 16 0 0 0 0-22.628l-33.94-33.94z" horiz-adv-x="1024" />
<glyph glyph-name="shujubidui" unicode="&#59861;" d="M96-48a16 16 0 0 0-16 16V800a16 16 0 0 0 16 16h288a16 16 0 0 0 16-16v-832a16 16 0 0 0-16-16H96z m116 144h56a8 8 0 0 1 8 8v56a8 8 0 0 1-8 8H212a8 8 0 0 1-8-8v-56a8 8 0 0 1 8-8z m-8 152a8 8 0 0 1 8-8h56a8 8 0 0 1 8 8v56a8 8 0 0 1-8 8H212a8 8 0 0 1-8-8v-56z m492-224V744h176v-720h-176z m-72-56a16 16 0 0 1 16-16h288a16 16 0 0 1 16 16V800a16 16 0 0 1-16 16h-288a16 16 0 0 1-16-16v-832z m124 192a8 8 0 0 0 8 8h56a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8h-56a8 8 0 0 0-8 8v56z m8 152a8 8 0 0 1-8-8v-56a8 8 0 0 1 8-8h56a8 8 0 0 1 8 8v56a8 8 0 0 1-8 8h-56z m-280 392a8 8 0 0 1 8-8h56a8 8 0 0 1 8 8V808a8 8 0 0 1-8 8h-56a8 8 0 0 1-8-8v-104z m0-184a8 8 0 0 1 8-8h56a8 8 0 0 1 8 8V620a8 8 0 0 1-8 8h-56a8 8 0 0 1-8-8v-100z m8-196a8 8 0 0 0-8 8v104a8 8 0 0 0 8 8h56a8 8 0 0 0 8-8v-104a8 8 0 0 0-8-8h-56z m-8-176a8 8 0 0 1 8-8h56a8 8 0 0 1 8 8v100a8 8 0 0 1-8 8h-56a8 8 0 0 1-8-8v-100z m8-196a8 8 0 0 0-8 8v104a8 8 0 0 0 8 8h56a8 8 0 0 0 8-8v-104a8 8 0 0 0-8-8h-56z" horiz-adv-x="1024" />
<glyph glyph-name="qitaziduanleixing" unicode="&#59860;" d="M168 704a8 8 0 0 1-8-8v-64a8 8 0 0 1 8-8h688a8 8 0 0 1 8 8V696a8 8 0 0 1-8 8H168z m-8-288a8 8 0 0 0 8 8h688a8 8 0 0 0 8-8v-64a8 8 0 0 0-8-8H168a8 8 0 0 0-8 8v64z m0-280a8 8 0 0 0 8 8h688a8 8 0 0 0 8-8v-64a8 8 0 0 0-8-8H168a8 8 0 0 0-8 8v64z" horiz-adv-x="1024" />
<glyph glyph-name="ziyuankongzhi" unicode="&#59859;" d="M450.328 754.728A16.008 16.008 0 0 1 438.46 760H128a16 16 0 0 1-16-16v-720a16 16 0 0 1 16-16h766.952a16 16 0 0 1 16 16V615.88a16 16 0 0 1-16 16H800.48l-71.752 75.168A16 16 0 0 1 717.152 712h-228.196l-38.628 42.728z m-273.76-67.136h244.58l116.408-123.936h308.828V318h-105.62a8.008 8.008 0 0 0-6.544 3.396l-121.548 172.728a8 8 0 0 1-13.056 0.04l-159.992-224.36a8 8 0 0 0-13.172 0.208l-93.216 139.824a8 8 0 0 1-12.676 0.828l-78.688-89.932a8 8 0 0 0-6.024-2.732h-59.28V687.592z m0-433.592h88.32a8 8 0 0 1 6.024 2.732l42.768 48.88a8 8 0 0 0 12.676-0.832l98.324-147.484a8 8 0 0 1 13.168-0.208l161.42 226.36a8 8 0 0 0 13.056-0.04l88.676-126.012a8 8 0 0 1 6.544-3.396h138.84v-173.592H176.564V254z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 819 KiB

After

Width:  |  Height:  |  Size: 830 KiB

BIN
dist/font/iconfont.ttf vendored

Binary file not shown.

BIN
dist/font/iconfont.woff vendored

Binary file not shown.

BIN
dist/font/iconfont.woff2 vendored

Binary file not shown.

2
package.json

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

51
src/base/single/editor/editor.js

@ -3,7 +3,7 @@
* @class BI.Editor
* @extends BI.Single
*/
import { shortcut, Controller, extend, createWidget, isKey, isEmptyString, isFunction, isNull, trim, } from "../../../core";
import { shortcut, Controller, extend, createWidget, isKey, isEmptyString, isFunction, isNull, trim } from "../../../core";
import { Single } from "../0.single";
import { Input } from "../input/input";
import { Bubbles } from "../../0.base";
@ -17,6 +17,7 @@ export class Editor extends Single {
static EVENT_BLUR = "EVENT_BLUR";
static EVENT_CLICK = "EVENT_CLICK";
static EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
static EVENT_QUICK_DOWN = "EVENT_QUICK_DOWN";
static EVENT_SPACE = "EVENT_SPACE";
static EVENT_BACKSPACE = "EVENT_BACKSPACE";
@ -58,10 +59,10 @@ export class Editor extends Single {
render() {
const { value, watermark, validationChecker, quitChecker, allowBlank, inputType, hgap, vgap, lgap, rgap, tgap, bgap } = this.options;
// 密码输入框设置autocomplete="new-password"的情况下Firefox和chrome不会自动填充密码
const autocomplete = this.options.autocomplete ? " autocomplete=" + this.options.autocomplete : "";
const autocomplete = this.options.autocomplete ? ` autocomplete=${this.options.autocomplete}` : "";
this.editor = this.addWidget(createWidget({
type: "bi.input",
element: "<input type='" + inputType + "'" + autocomplete + " />",
element: `<input type='${inputType}'${autocomplete} />`,
root: true,
value,
watermark,
@ -82,7 +83,7 @@ export class Editor extends Single {
{
el: {
type: "bi.absolute",
ref: (_ref) => {
ref: _ref => {
this.contentWrapper = _ref;
},
items: [
@ -124,30 +125,32 @@ export class Editor extends Single {
this.fireEvent(Editor.EVENT_BLUR, ...args);
});
this.editor.on(Input.EVENT_CLICK, (...args) => {
this.fireEvent(Editor.EVENT_CLICK, ...args);
this.fireEvent(Editor.EVENT_CLICK, ...args);
});
this.editor.on(Input.EVENT_CHANGE, (...args) => {
this.fireEvent(Editor.EVENT_CHANGE, ...args);
this.fireEvent(Editor.EVENT_CHANGE, ...args);
});
this.editor.on(Input.EVENT_KEY_DOWN, (v, ...args) => {
this.fireEvent(Editor.EVENT_KEY_DOWN, v, ...args);
this.fireEvent(Editor.EVENT_KEY_DOWN, v, ...args);
});
this.editor.on(Input.EVENT_QUICK_DOWN, (e) => {
this.editor.on(Input.EVENT_QUICK_DOWN, (...args) => {
const [e] = args;
// tab键就不要隐藏了
if (e.keyCode !== BI.KeyCode.TAB && this.watermark) {
this.watermark.invisible();
}
this.fireEvent(Editor.EVENT_QUICK_DOWN, ...args);
});
this.editor.on(Input.EVENT_VALID, (...args) => {
this._checkWaterMark();
this._setErrorVisible(false);
this.element.removeClass("error");
this.fireEvent(Editor.EVENT_VALID, ...args);
this.fireEvent(Editor.EVENT_VALID, ...args);
});
this.editor.on(Input.EVENT_ERROR, (...args) => {
this._checkWaterMark();
this.fireEvent(Editor.EVENT_ERROR, ...args);
this.fireEvent(Editor.EVENT_ERROR, ...args);
this._setErrorVisible(this.isEditing());
this.element.addClass("error");
});
@ -157,40 +160,40 @@ export class Editor extends Single {
tip && tip.element.fadeOut(100, () => {
tip.element.fadeIn(100);
});
this.fireEvent(Editor.EVENT_RESTRICT, ...args);
this.fireEvent(Editor.EVENT_RESTRICT, ...args);
});
this.editor.on(Input.EVENT_EMPTY, (...args) => {
this._checkWaterMark();
this.fireEvent(Editor.EVENT_EMPTY, ...args);
this.fireEvent(Editor.EVENT_EMPTY, ...args);
});
this.editor.on(Input.EVENT_ENTER, (...args) => {
this.fireEvent(Editor.EVENT_ENTER, ...args);
this.fireEvent(Editor.EVENT_ENTER, ...args);
});
this.editor.on(Input.EVENT_SPACE, (...args) => {
this.fireEvent(Editor.EVENT_SPACE, ...args);
this.fireEvent(Editor.EVENT_SPACE, ...args);
});
this.editor.on(Input.EVENT_BACKSPACE, (...args) => {
this.fireEvent(Editor.EVENT_BACKSPACE, ...args);
this.fireEvent(Editor.EVENT_BACKSPACE, ...args);
});
this.editor.on(Input.EVENT_REMOVE, (...args) => {
this.fireEvent(Editor.EVENT_REMOVE, ...args);
this.fireEvent(Editor.EVENT_REMOVE, ...args);
});
this.editor.on(Input.EVENT_START, (...args) => {
this.fireEvent(Editor.EVENT_START, ...args);
this.fireEvent(Editor.EVENT_START, ...args);
});
this.editor.on(Input.EVENT_PAUSE, (...args) => {
this.fireEvent(Editor.EVENT_PAUSE, ...args);
this.fireEvent(Editor.EVENT_PAUSE, ...args);
});
this.editor.on(Input.EVENT_STOP, (...args) => {
this.fireEvent(Editor.EVENT_STOP, ...args);
this.fireEvent(Editor.EVENT_STOP, ...args);
});
this.editor.on(Input.EVENT_CONFIRM, (...args) => {
this.fireEvent(Editor.EVENT_CONFIRM, ...args);
this.fireEvent(Editor.EVENT_CONFIRM, ...args);
});
this.editor.on(Input.EVENT_CHANGE_CONFIRM, (...args) => {
this.fireEvent(Editor.EVENT_CHANGE_CONFIRM, ...args);
this.fireEvent(Editor.EVENT_CHANGE_CONFIRM, ...args);
});
this.element.click((e) => {
this.element.click(e => {
e.stopPropagation();
return false;
@ -230,7 +233,7 @@ export class Editor extends Single {
textAlign: "left",
});
this.watermark.element.bind({
mousedown: (e) => {
mousedown: e => {
if (this.isEnabled()) {
this.editor.isEditing() || this.editor.focus();
} else {
@ -239,7 +242,7 @@ export class Editor extends Single {
e.stopEvent();
},
});
this.watermark.element.bind("click", (e) => {
this.watermark.element.bind("click", e => {
if (this.isEnabled()) {
this.editor.isEditing() || this.editor.focus();
} else {

2
src/case/combo/textvaluecombo/combo.textvalue.js

@ -144,7 +144,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
el: popup,
value: o.value,
maxHeight: 240,
minHeight: 25
minHeight: (o.chooseType === BI.ButtonGroup.CHOOSE_TYPE_MULTI && o.allowSelectAll) ? 55 : 25
}
};
},

6
src/case/combo/textvaluecombo/popup.textvalue.js

@ -131,8 +131,10 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, {
};
},
mounted: function () {
this.check();
beforeMount: function () {
if (this.options.chooseType !== BI.ButtonGroup.CHOOSE_TYPE_MULTI) {
this.check();
}
},
_formatItems: function (items) {

4
src/case/editor/editor.sign.js

@ -87,6 +87,9 @@ BI.SignEditor = BI.inherit(BI.Widget, {
this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) {
self.fireEvent(BI.SignEditor.EVENT_KEY_DOWN, arguments);
});
this.editor.on(BI.Editor.EVENT_QUICK_DOWN, function () {
self.fireEvent(BI.SignEditor.EVENT_QUICK_DOWN, arguments);
});
this.editor.on(BI.Editor.EVENT_VALID, function () {
self.fireEvent(BI.SignEditor.EVENT_VALID, arguments);
@ -265,6 +268,7 @@ BI.SignEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.SignEditor.EVENT_BLUR = "EVENT_BLUR";
BI.SignEditor.EVENT_CLICK = "EVENT_CLICK";
BI.SignEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.SignEditor.EVENT_QUICK_DOWN = "EVENT_QUICK_DOWN";
BI.SignEditor.EVENT_CLICK_LABEL = "EVENT_CLICK_LABEL";
BI.SignEditor.EVENT_START = "EVENT_START";

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

@ -448,7 +448,7 @@
viewportBounds = document.documentElement.getBoundingClientRect();
var left;
if (comboRect.left + comboRect.width / 2 + popupRect.width / 2 > viewportBounds.width) {
left = viewportBounds.width - comboRect.width - positionRelativeElementRect.left;
left = viewportBounds.width - popupRect.width - positionRelativeElementRect.left;
} else {
left = comboRect.left + (comboRect.width - popupRect.width) / 2 - positionRelativeElementRect.left;
}
@ -710,7 +710,7 @@
break;
}
if (needAdaptHeight === true) {
popup.resetHeight && popup.resetHeight(Math.min(viewportBounds.height - position.top + (positionRelativeElement ? positionRelativeElement.getBoundingClientRect().top : 0), maxHeight));
popup.resetHeight && popup.resetHeight(Math.min(viewportBounds.height - position.top - (positionRelativeElement ? positionRelativeElement.getBoundingClientRect().top : 0), maxHeight));
}
return position;
},

7
src/core/utils/chinesePY.js

File diff suppressed because one or more lines are too long

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

@ -54,6 +54,7 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
},
valueFormatter: o.valueFormatter,
itemsCreator: BI.bind(this._itemsCreator4Trigger, this),
itemFormatter: o.itemFormatter,
itemHeight: o.itemHeight,
value: {
type: BI.Selection.Multi,
@ -134,29 +135,31 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
},
listeners: [{
eventName: BI.MultiSelectPopupView.EVENT_CHANGE,
action: function () {
self._dataChange = true;
self.storeValue = this.getValue();
self._adjust(function () {
assertShowValue();
});
self.fireEvent(BI.MultiSelectNoBarCombo.EVENT_CLICK_ITEM);
listeners: [
{
eventName: BI.MultiSelectPopupView.EVENT_CHANGE,
action: function () {
self._dataChange = true;
self.storeValue = this.getValue();
self._adjust(function () {
assertShowValue();
});
self.fireEvent(BI.MultiSelectNoBarCombo.EVENT_CLICK_ITEM);
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,
action: function () {
self._defaultState();
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,
action: function () {
self._dataChange = true;
self.setValue();
self._defaultState();
}
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,
action: function () {
self._defaultState();
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,
action: function () {
self._dataChange = true;
self.setValue();
self._defaultState();
}
}],
],
itemsCreator: o.itemsCreator,
itemHeight: o.itemHeight,
valueFormatter: o.valueFormatter,
@ -262,26 +265,28 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.combo,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.vertical_adapt",
items: [this.numberCounter]
},
right: o.height,
top: 0,
height: o.height
}]
items: [
{
el: this.combo,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.vertical_adapt",
items: [this.numberCounter]
},
right: o.height,
top: 0,
height: o.height
}
]
});
},

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

@ -55,6 +55,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
},
valueFormatter: o.valueFormatter,
itemsCreator: BI.bind(this._itemsCreator4Trigger, this),
itemFormatter: o.itemFormatter,
itemHeight: o.itemHeight,
value: this.storeValue,
});
@ -138,31 +139,34 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
},
listeners: [{
eventName: BI.MultiSelectPopupView.EVENT_CHANGE,
action: function () {
self._dataChange = true;
self.storeValue = this.getValue();
self._adjust(function () {
assertShowValue();
});
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM);
listeners: [
{
eventName: BI.MultiSelectPopupView.EVENT_CHANGE,
action: function () {
self._dataChange = true;
self.storeValue = this.getValue();
self._adjust(function () {
assertShowValue();
});
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM);
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,
action: function () {
self._defaultState();
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,
action: function () {
self._dataChange = true;
self.setValue();
self._defaultState();
}
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,
action: function () {
self._defaultState();
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,
action: function () {
self._dataChange = true;
self.setValue();
self._defaultState();
}
}],
],
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
itemFormatter: o.itemFormatter,
itemHeight: o.itemHeight,
onLoaded: function () {
BI.nextTick(function () {
@ -260,26 +264,28 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.combo,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.vertical_adapt",
items: [this.numberCounter]
},
right: o.height,
top: 0,
height: o.height,
}]
items: [
{
el: this.combo,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.vertical_adapt",
items: [this.numberCounter]
},
right: o.height,
top: 0,
height: o.height,
}
]
});
},

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

@ -54,6 +54,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
},
valueFormatter: o.valueFormatter,
itemsCreator: BI.bind(this._itemsCreator4Trigger, this),
itemFormatter: o.itemFormatter,
itemHeight: o.itemHeight,
value: {
type: BI.Selection.Multi,
@ -129,28 +130,30 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
},
listeners: [{
eventName: BI.MultiSelectPopupView.EVENT_CHANGE,
action: function () {
self._dataChange = true;
self.storeValue = this.getValue();
self._adjust(function () {
assertShowValue();
});
listeners: [
{
eventName: BI.MultiSelectPopupView.EVENT_CHANGE,
action: function () {
self._dataChange = true;
self.storeValue = this.getValue();
self._adjust(function () {
assertShowValue();
});
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,
action: function () {
self._defaultState();
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,
action: function () {
self._dataChange = true;
self.setValue();
self._defaultState();
}
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,
action: function () {
self._defaultState();
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,
action: function () {
self._dataChange = true;
self.setValue();
self._defaultState();
}
}],
],
itemsCreator: o.itemsCreator,
itemHeight: o.itemHeight,
valueFormatter: o.valueFormatter,
@ -256,26 +259,28 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.combo,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.vertical_adapt",
items: [this.numberCounter]
},
right: o.height,
top: 0,
height: o.height
}]
items: [
{
el: this.combo,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.vertical_adapt",
items: [this.numberCounter]
},
right: o.height,
top: 0,
height: o.height
}
]
});
},

30
src/widget/multiselect/multiselect.insert.trigger.js

@ -40,6 +40,7 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
defaultText: o.defaultText,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
itemFormatter: o.itemFormatter,
itemHeight: o.itemHeight,
watermark: o.watermark,
popup: {},
@ -86,24 +87,27 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
}, {
el: BI.createWidget(),
width: 24
}]
}
]
});
!o.allowEdit && BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.text",
title: function () {
return self.searcher.getState();
}
},
left: 0,
right: 24,
top: 0,
bottom: 0
}]
items: [
{
el: {
type: "bi.text",
title: function () {
return self.searcher.getState();
}
},
left: 0,
right: 24,
top: 0,
bottom: 0
}
]
});
},

35
src/widget/multiselect/multiselect.trigger.js

@ -41,6 +41,7 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
itemsCreator: o.itemsCreator,
itemHeight: o.itemHeight,
valueFormatter: o.valueFormatter,
itemFormatter: o.itemFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
@ -88,23 +89,25 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
!o.allowEdit && BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.text",
title: function () {
/** 修正REPORT-73699引入,需要考虑到传递过来的值是方法的情况 */
var state = self.searcher.getState();
if (BI.isFunction(state)) {
return state();
items: [
{
el: {
type: "bi.text",
title: function () {
/** 修正REPORT-73699引入,需要考虑到传递过来的值是方法的情况 */
var state = self.searcher.getState();
if (BI.isFunction(state)) {
return state();
}
return state;
}
return state;
}
},
left: 0,
right: 24,
top: 0,
bottom: 0
}]
},
left: 0,
right: 24,
top: 0,
bottom: 0
}
]
});
},

32
src/widget/multiselect/search/multiselect.search.loader.js

@ -51,9 +51,11 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
return true;
}
},
layouts: [{
type: "bi.vertical"
}]
layouts: [
{
type: "bi.vertical"
}
]
}
}
},
@ -92,15 +94,21 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
_createItems: function (items) {
var allSelected = this.isAllSelected();
return BI.createItems(items, {
type: "bi.multi_select_item",
logic: {
dynamic: false
},
height: this.options.itemHeight || BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
selected: allSelected,
cls: "bi-list-item-active",
iconWrapperWidth: 36
var itemFormatter = this.options.itemFormatter;
return BI.map(items, (index, item) => {
return {
type: "bi.multi_select_item",
logic: {
dynamic: false
},
height: this.options.itemHeight || BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
selected: allSelected,
cls: "bi-list-item-active",
iconWrapperWidth: 36,
...item,
...itemFormatter(item)
};
});
},

23
src/widget/multiselect/trigger/searcher.multiselect.insert.js

@ -29,17 +29,19 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
height: o.height,
text: o.text,
defaultText: o.defaultText,
listeners: [{
eventName: BI.MultiSelectEditor.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_FOCUS);
}
}, {
eventName: BI.MultiSelectEditor.EVENT_BLUR,
action: function () {
self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_BLUR);
listeners: [
{
eventName: BI.MultiSelectEditor.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_FOCUS);
}
}, {
eventName: BI.MultiSelectEditor.EVENT_BLUR,
action: function () {
self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_BLUR);
}
}
}]
]
});
this.searcher = BI.createWidget({
@ -56,6 +58,7 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
popup: BI.extend({
type: "bi.multi_select_search_insert_pane",
valueFormatter: o.valueFormatter,
itemFormatter: o.itemFormatter,
keywordGetter: function () {
return self.editor.getKeyword();
},

23
src/widget/multiselect/trigger/searcher.multiselect.js

@ -29,17 +29,19 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
text: o.text,
defaultText: o.defaultText,
watermark: o.watermark,
listeners: [{
eventName: BI.MultiSelectEditor.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS);
}
}, {
eventName: BI.MultiSelectEditor.EVENT_BLUR,
action: function () {
self.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR);
listeners: [
{
eventName: BI.MultiSelectEditor.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS);
}
}, {
eventName: BI.MultiSelectEditor.EVENT_BLUR,
action: function () {
self.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR);
}
}
}]
]
});
this.searcher = BI.createWidget({
@ -55,6 +57,7 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
popup: BI.extend({
type: "bi.multi_select_search_pane",
valueFormatter: o.valueFormatter,
itemFormatter: o.itemFormatter,
keywordGetter: function () {
return self.editor.getValue();
},

51
src/widget/numbereditor/number.editor.js

@ -39,9 +39,33 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
if (o.validationChecker === BI.emptyFn && !self._checkValueInRange(parsedValue)) {
return false;
}
return o.validationChecker(parsedValue);
},
errorText: o.errorText
errorText: o.errorText,
listeners: [
{
eventName: BI.SignEditor.EVENT_QUICK_DOWN,
action: e => {
if ([BI.KeyCode.UP, BI.KeyCode.DOWN].includes(e.keyCode)) {
e.preventDefault();
}
},
},
{
eventName: BI.SignEditor.EVENT_KEY_DOWN,
action: (keycode) => {
if (keycode === BI.KeyCode.UP) {
this._finetuning(o.step);
return;
}
if (keycode === BI.KeyCode.DOWN) {
this._finetuning(-o.step);
}
},
}
],
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
// 大多数时候valueFormatter往往需要配合valueParser一起使用
@ -68,7 +92,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
forceNotSelected: true,
trigger: "lclick,",
debounce: false,
cls: (o.simple ? "solid-triangle-top-font " : "add-up-font bi-border-left ") + "top-button bi-list-item-active2 icon-size-12"
cls: (o.simple ? "solid-triangle-top-font " : "add-up-font bi-border-left ") + "top-button bi-list-item-active2 icon-size-12",
});
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function () {
self._finetuning(o.step);
@ -80,7 +104,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
trigger: "lclick,",
forceNotSelected: true,
debounce: false,
cls: (o.simple ? "solid-triangle-bottom-font " : "minus-down-font bi-border-left ") + "bottom-button bi-list-item-active2 icon-size-12"
cls: (o.simple ? "solid-triangle-bottom-font " : "minus-down-font bi-border-left ") + "bottom-button bi-list-item-active2 icon-size-12",
});
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function () {
self._finetuning(-o.step);
@ -101,17 +125,17 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
{
column: 0,
row: 0,
el: this.topBtn
el: this.topBtn,
}, {
column: 0,
row: 1,
el: this.bottomBtn
el: this.bottomBtn,
}
]
],
},
width: 23
width: 23,
}
]
],
});
},
@ -125,6 +149,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
_checkValueInRange: function (v) {
var o = this.options;
return !!(BI.isNumeric(v) && BI.parseFloat(v) >= o.min && BI.parseFloat(v) <= o.max);
},
@ -137,8 +162,11 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
// 微调
_finetuning: function (add) {
var v = BI.parseFloat(this.getValue());
this.setValue(BI.add(v, add));
const { max, min } = this.options;
let v = BI.parseFloat(this.getValue());
v = BI.add(v, add);
v = BI.clamp(v, min, max);
this.setValue(v);
},
setUpEnable: function (v) {
@ -165,7 +193,8 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
var o = this.options;
o.value = v;
this.editor.setValue(o.valueFormatter(v));
}
this._checkAdjustDisabled(o.value);
},
});
BI.NumberEditor.EVENT_CONFIRM = "EVENT_CONFIRM";

120
src/widget/yearmonth/combo.yearmonth.js

@ -80,39 +80,45 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
ref: function () {
self.popup = this;
},
listeners: [{
eventName: BI.DynamicYearMonthPopup.EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE,
action: function () {
self.setValue();
self.combo.hideView();
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE,
action: function () {
var date = BI.getDate();
self.setValue({ type: BI.DynamicYearMonthCombo.Static, value: { year: date.getFullYear(), month: date.getMonth() + 1 } });
self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE,
action: function () {
var value = self.popup.getValue();
if (self._checkValue(value)) {
self.setValue(value);
listeners: [
{
eventName: BI.DynamicYearMonthPopup.EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE,
action: function () {
self.setValue();
self.comboWrapper.element.removeClass("error");
self.combo.hideView();
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE,
action: function () {
var date = BI.getDate();
self.setValue({
type: BI.DynamicYearMonthCombo.Static,
value: { year: date.getFullYear(), month: date.getMonth() + 1 }
});
self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE,
action: function () {
var value = self.popup.getValue();
if (self._checkValue(value)) {
self.setValue(value);
}
self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
}],
],
behaviors: o.behaviors,
min: o.minDate,
max: o.maxDate
@ -130,31 +136,35 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.horizontal_fill",
columnSize: ["", "fill"],
cls: (o.simple ? "bi-border-bottom" : "bi-border bi-border-radius") + " bi-focus-shadow",
ref: function () {
self.comboWrapper = this;
items: [
{
el: {
type: "bi.horizontal_fill",
columnSize: ["", "fill"],
cls: (o.simple ? "bi-border-bottom" : "bi-border bi-border-radius") + " bi-focus-shadow",
ref: function () {
self.comboWrapper = this;
},
items: [
{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: BI.toPix(o.height, border),
height: BI.toPix(o.height, border),
ref: function () {
self.changeIcon = this;
}
}
}, this.combo
]
},
items: [{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: BI.toPix(o.height, border),
height: BI.toPix(o.height, border),
ref: function () {
self.changeIcon = this;
}
}
}, this.combo]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}]
top: 0,
left: 0,
right: 0,
bottom: 0
}
]
});
this._checkDynamicValue(o.value);
},

122
src/widget/yearquarter/combo.yearquarter.js

@ -1,6 +1,6 @@
BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
_consts:{
_consts: {
iconWidth: 24
},
props: {
@ -83,39 +83,45 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
ref: function () {
self.popup = this;
},
listeners: [{
eventName: BI.DynamicYearQuarterPopup.EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE,
action: function () {
self.setValue();
self.combo.hideView();
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE,
action: function () {
var date = BI.getDate();
self.setValue({ type: BI.DynamicYearMonthCombo.Static, value: { year: date.getFullYear(), quarter: BI.getQuarter(date) } });
self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE,
action: function () {
var value = self.popup.getValue();
if (self._checkValue(value)) {
self.setValue(value);
listeners: [
{
eventName: BI.DynamicYearQuarterPopup.EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE,
action: function () {
self.setValue();
self.comboWrapper.element.removeClass("error");
self.combo.hideView();
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE,
action: function () {
var date = BI.getDate();
self.setValue({
type: BI.DynamicYearMonthCombo.Static,
value: { year: date.getFullYear(), quarter: BI.getQuarter(date) }
});
self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE,
action: function () {
var value = self.popup.getValue();
if (self._checkValue(value)) {
self.setValue(value);
}
self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
}],
],
behaviors: o.behaviors,
min: o.minDate,
max: o.maxDate
@ -133,31 +139,35 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.horizontal_fill",
columnSize: ["", "fill"],
cls: (o.simple ? "bi-border-bottom" : "bi-border bi-border-radius") + " bi-focus-shadow",
ref: function () {
self.comboWrapper = this;
items: [
{
el: {
type: "bi.horizontal_fill",
columnSize: ["", "fill"],
cls: (o.simple ? "bi-border-bottom" : "bi-border bi-border-radius") + " bi-focus-shadow",
ref: function () {
self.comboWrapper = this;
},
items: [
{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: this._consts.iconWidth,
height: BI.toPix(o.height, border),
ref: function () {
self.changeIcon = this;
}
}
}, this.combo
]
},
items: [{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: this._consts.iconWidth,
height: BI.toPix(o.height, border),
ref: function () {
self.changeIcon = this;
}
}
}, this.combo]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}]
top: 0,
left: 0,
right: 0,
bottom: 0
}
]
});
this._checkDynamicValue(o.value);
},

11
typescript/core/base.ts

@ -177,7 +177,8 @@ export interface _base {
functions: (object: object) => string[];
extend: (object: object, ...sources: any[]) => object;
extend<T extends object>(object: T): T;
extend<T extends object, U extends unknown[]>(object: T, ...sources: U): T & UnionToIntersection<NonNullable<U[number]>>;
defaults: (object: object, ...sources: any[]) => object;
@ -399,3 +400,11 @@ type merge = {
deepExtend(object: any, ...otherArgs: any[]): any;
}
type UnionToIntersection<Union> = (
Union extends unknown
? (x: Union) => void
: never
) extends ((x: infer Intersection) => void)
? Intersection
: never;

Loading…
Cancel
Save