Browse Source

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

es6
Tangjinxia 4 years ago
parent
commit
4c22784e02
  1. 1
      changelog.md
  2. 2
      demo/js/widget/singleselct/demo.single_select_combo.js
  3. 2
      dist/2.0/fineui.css
  4. 4
      dist/2.0/fineui.ie.min.js
  5. 2
      dist/2.0/fineui.ie.min.js.map
  6. 2633
      dist/2.0/fineui.js
  7. 2
      dist/2.0/fineui.js.map
  8. 2
      dist/2.0/fineui.min.css
  9. 4
      dist/2.0/fineui.min.js
  10. 2
      dist/2.0/fineui.min.js.map
  11. 2
      dist/2.0/fineui_without_normalize.css
  12. 2
      dist/2.0/fineui_without_normalize.min.css
  13. 2
      dist/core.css
  14. 2600
      dist/core.js
  15. 2
      dist/core.js.map
  16. 2
      dist/demo.css
  17. 2967
      dist/demo.js
  18. 2
      dist/demo.js.map
  19. 2
      dist/fineui.css
  20. 4
      dist/fineui.ie.min.js
  21. 2
      dist/fineui.ie.min.js.map
  22. 2624
      dist/fineui.js
  23. 2
      dist/fineui.js.map
  24. 2
      dist/fineui.min.css
  25. 4
      dist/fineui.min.js
  26. 2
      dist/fineui.min.js.map
  27. 2
      dist/fineui.proxy.css
  28. 1910
      dist/fineui.proxy.js
  29. 2
      dist/fineui.proxy.js.map
  30. 2
      dist/fineui.proxy.min.css
  31. 4
      dist/fineui.proxy.min.js
  32. 2
      dist/fineui.proxy.min.js.map
  33. 1834
      dist/fineui_without_jquery_polyfill.js
  34. 2
      dist/fineui_without_jquery_polyfill.js.map
  35. 2
      dist/font.css
  36. BIN
      dist/font/iconfont.eot
  37. 21
      dist/font/iconfont.svg
  38. BIN
      dist/font/iconfont.ttf
  39. BIN
      dist/font/iconfont.woff
  40. BIN
      dist/font/iconfont.woff2
  41. 1
      dist/lib/base/combination/tab.d.ts
  42. 13
      dist/lib/base/single/button/buttons/button.d.ts
  43. 2
      dist/lib/base/single/button/buttons/button.text.d.ts
  44. 13
      dist/lib/case/button/item.singleselect.radio.d.ts
  45. 1
      dist/lib/core/var.d.ts
  46. 10
      dist/lib/shims-tsx.d.ts
  47. 6
      dist/lib/widget/multiselect/multiselect.combo.d.ts
  48. 2
      dist/resource.css
  49. 3
      dist/resource.js
  50. 20
      dist/utils.js
  51. 2
      dist/utils.js.map
  52. 4
      dist/utils.min.js
  53. 2
      dist/utils.min.js.map
  54. 3
      i18n/i18n.cn.js
  55. 2
      package.json
  56. 11
      src/base/combination/searcher.js
  57. 4
      src/base/combination/tab.js
  58. 56
      src/base/single/editor/editor.textarea.js
  59. 5
      src/case/editor/editor.state.js
  60. 3
      src/core/constant/var.js
  61. 4
      src/core/h.js
  62. 28
      src/core/wrapper/layout/layout.flow.js
  63. 2
      src/widget/editor/editor.search.js
  64. 18
      src/widget/multiselect/multiselect.combo.js
  65. 9
      src/widget/multiselect/multiselect.combo.nobar.js
  66. 35
      src/widget/multiselect/multiselect.insert.combo.js
  67. 35
      src/widget/multiselect/multiselect.insert.combo.nobar.js
  68. 4
      src/widget/multiselect/multiselect.insert.trigger.js
  69. 49
      src/widget/multiselect/search/multiselect.search.insert.pane.js
  70. 48
      src/widget/multiselect/search/multiselect.search.pane.js
  71. 34
      src/widget/multiselect/trigger/editor.multiselect.js
  72. 214
      src/widget/multiselect/trigger/editor/editor.patch.js
  73. 21
      src/widget/multiselect/trigger/searcher.multiselect.insert.js
  74. 6
      src/widget/multiselect/trigger/searcher.multiselect.js
  75. 91
      src/widget/multiselectlist/multiselectlist.insert.js
  76. 88
      src/widget/multiselectlist/multiselectlist.insert.nobar.js
  77. 43
      src/widget/multiselectlist/multiselectlist.js
  78. 2
      src/widget/numberinterval/singleeditor/single.editor.js
  79. 18
      src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js
  80. 2
      src/widget/searchmultitextvaluecombo/trigger/searcher.multitextvalue.js
  81. 20
      src/widget/singleselect/search/singleselect.search.pane.insert.js
  82. 14
      src/widget/singleselect/search/singleselect.search.pane.js
  83. 29
      src/widget/singleselect/singleselect.combo.js
  84. 66
      src/widget/singleselect/singleselect.insert.combo.js
  85. 1
      src/widget/singleselect/singleselect.trigger.js
  86. 93
      src/widget/singleselect/singleselectlist.insert.js
  87. 40
      src/widget/singleselect/trigger/editor.singleselect.js
  88. 6
      src/widget/singleselect/trigger/searcher.singleselect.js
  89. 2
      typescript/base/combination/tab.ts
  90. 3
      typescript/base/single/button/buttons/button.text.ts
  91. 18
      typescript/base/single/button/buttons/button.ts
  92. 14
      typescript/case/button/item.singleselect.radio.ts
  93. 1
      typescript/core/var.ts
  94. 12
      typescript/shims-tsx.ts
  95. 6
      typescript/widget/multiselect/multiselect.combo.ts

1
changelog.md

@ -1,5 +1,6 @@
# 更新日志
2.0(2021-05)
- 支持搜索的控件支持搜索包含空格的字符串
- 解决了树列表populate调用两次itemsCreator的问题
2.0(2021-03)

2
demo/js/widget/singleselct/demo.single_select_combo.js

@ -9,7 +9,7 @@ Demo.SingleSelectCombo = BI.inherit(BI.Widget, {
_createSingleSelectCombo: function () {
var self = this;
var widget = BI.createWidget({
type: "bi.single_select_insert_combo",
type: "bi.single_select_combo",
itemsCreator: BI.bind(this._itemsCreator, this),
width: 200,
ref: function () {

2
dist/2.0/fineui.css vendored

File diff suppressed because one or more lines are too long

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

File diff suppressed because one or more lines are too long

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

File diff suppressed because one or more lines are too long

2633
dist/2.0/fineui.js vendored

File diff suppressed because it is too large Load Diff

2
dist/2.0/fineui.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui.min.js vendored

File diff suppressed because one or more lines are too long

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

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui_without_normalize.css vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui_without_normalize.min.css vendored

File diff suppressed because one or more lines are too long

2
dist/core.css vendored

File diff suppressed because one or more lines are too long

2600
dist/core.js vendored

File diff suppressed because it is too large Load Diff

2
dist/core.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/demo.css vendored

File diff suppressed because one or more lines are too long

2967
dist/demo.js vendored

File diff suppressed because it is too large Load Diff

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.css vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

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

File diff suppressed because one or more lines are too long

2624
dist/fineui.js vendored

File diff suppressed because it is too large Load Diff

2
dist/fineui.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.min.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.proxy.css vendored

File diff suppressed because one or more lines are too long

1910
dist/fineui.proxy.js vendored

File diff suppressed because it is too large Load Diff

2
dist/fineui.proxy.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.proxy.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.proxy.min.js vendored

File diff suppressed because one or more lines are too long

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

File diff suppressed because one or more lines are too long

1834
dist/fineui_without_jquery_polyfill.js vendored

File diff suppressed because it is too large Load Diff

2
dist/fineui_without_jquery_polyfill.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/font.css vendored

File diff suppressed because one or more lines are too long

BIN
dist/font/iconfont.eot vendored

Binary file not shown.

21
dist/font/iconfont.svg vendored

@ -20,6 +20,27 @@ Created by iconfont
/>
<missing-glyph />
<glyph glyph-name="jianceyichang" unicode="&#59479;" d="M512-42.666667c235.648 0 426.666667 191.018667 426.666667 426.666667S747.648 810.666667 512 810.666667 85.333333 619.648 85.333333 384s191.018667-426.666667 426.666667-426.666667zM298.666667 426.666667h426.666666a42.666667 42.666667 0 0 0 0-85.333334H298.666667a42.666667 42.666667 0 0 0 0 85.333334z" horiz-adv-x="1024" />
<glyph glyph-name="daochuweilog" unicode="&#59478;" d="M807.488 238.4l4.672-3.392 146.56-128a32 32 0 0 0 4.288-43.584l-4.288-4.608-146.56-128a32 32 0 0 0-46.08 44.032l4.032 4.16 82.304 71.936h-190.08a32 32 0 0 0-5.76 63.424l5.76 0.576h190.08l-82.304 71.872a32 32 0 0 0-6.464 40.512l3.392 4.672a32 32 0 0 0 40.448 6.4zM640.128 832L896 575.872V352a32 32 0 1 0-64 0V512h-192a64 64 0 0 0-64 64V768H192v-320h428.8a19.2 19.2 0 0 0 19.2-19.2v-281.6a19.2 19.2 0 0 0-19.2-19.2H192v-128h352a32 32 0 1 0 0-64h-384a32 32 0 0 0-32 32V128h-44.8a19.2 19.2 0 0 0-19.2 19.2V428.8a19.2 19.2 0 0 0 19.2 19.2H128V800a32 32 0 0 0 32 32h480.128zM325.504 385.28c-49.984 0-84.48-35.776-84.48-97.216 0-61.184 34.496-98.688 84.48-98.688 49.92 0 84.416 37.504 84.416 98.688 0 61.184-34.432 97.152-84.48 97.152z m197.376 0c-50.24 0-90.56-36.48-90.56-98.752 0-62.976 39.04-97.152 90.56-97.152 26.24 0 48.448 10.24 61.184 22.72v85.12H516.992v-30.848H550.4v-37.184a38.016 38.016 0 0 0-23.68-7.168c-36.992 0-55.872 24.768-55.872 65.792 0 40.576 21.952 65.024 53.312 65.024 17.088 0 27.776-6.848 36.992-15.808l20.096 24a79.36 79.36 0 0 1-58.368 24.192z m-366.976-3.648h-37.76v-188.672h114.24v31.616H155.904V381.632z m169.6-28.8c28.032 0 45.888-24.192 45.888-64.768 0-40.32-17.856-66.048-45.888-66.048-28.096 0-45.952 25.728-45.952 66.048 0 40.576 17.92 64.768 45.952 64.768zM640 741.568V576h165.376L640 741.568z" horiz-adv-x="1024" />
<glyph glyph-name="daochuweiexcel" unicode="&#59477;" d="M807.488 238.4l4.672-3.392 146.56-128a32 32 0 0 0 4.288-43.584l-4.288-4.608-146.56-128a32 32 0 0 0-46.08 44.032l4.032 4.16 82.304 71.936h-190.08a32 32 0 0 0-5.76 63.424l5.76 0.576h190.08l-82.304 71.872a32 32 0 0 0-6.464 40.512l3.392 4.672a32 32 0 0 0 40.448 6.4zM640.128 832L896 575.872V352a32 32 0 1 0-64 0V512h-192a64 64 0 0 0-64 64V768H192v-320h300.8a19.2 19.2 0 0 0 19.2-19.2v-281.6a19.2 19.2 0 0 0-19.2-19.2H192v-128h352a32 32 0 1 0 0-64h-384a32 32 0 0 0-32 32V128h-44.8a19.2 19.2 0 0 0-19.2 19.2V428.8a19.2 19.2 0 0 0 19.2 19.2H128V800a32 32 0 0 0 32 32h480.128zM240 384H192l71.936-96L192 192h48l47.936 64 48.064-64H384L311.936 288 384 384h-48l-48.064-64-47.936 64zM640 741.568V576h165.376L640 741.568z" horiz-adv-x="1024" />
<glyph glyph-name="bangzhu" unicode="&#59473;" 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="fuwu" unicode="&#59474;" d="M512 640m32 0l192 0q32 0 32-32l0 0q0-32-32-32l-192 0q-32 0-32 32l0 0q0 32 32 32ZM576 512m32 0l128 0q32 0 32-32l0 0q0-32-32-32l-128 0q-32 0-32 32l0 0q0 32 32 32ZM288 425.664c46.72 0 113.536-17.344 201.856-51.84l39.168-15.872 41.856-17.92a70.848 70.848 0 0 0 27.264-108.48l-5.824-6.592-8.384-8.256 28.8-8.768a32 32 0 0 1 12.544-1.216l6.208 1.28 213.504 66.88a77.504 77.504 0 0 0 69.76-135.936l-18.816-14.08-36.16-26.304-34.24-24.064c-110.912-76.352-190.144-114.368-242.112-114.368-50.496 0-86.976 9.28-140.672 32.32l-27.584 12.16c-49.408 22.272-75.264 31.36-105.6 35.968L97.28 32a32 32 0 1 0-2.56 64l217.856 8.32c38.784-5.376 67.264-14.4 111.488-33.6l44.16-19.584c46.08-19.712 75.136-27.008 115.2-27.008 20.032 0 50.688 10.752 91.2 32.192l23.104 12.736 25.088 14.848 26.944 17.024 28.864 19.136 30.72 21.184 32.576 23.36 34.368 25.472a13.504 13.504 0 0 1-8.576 24.32l-3.584-0.64-213.504-66.816a96 96 0 0 0-47.168-2.56l-9.344 2.304-171.52 52.032a33.984 33.984 0 0 0 12.352 66.432l6.016-1.024 61.568-16a32 32 0 0 1 26.304 4.672l4.288 3.584 14.08 13.952a6.848 6.848 0 0 1-2.112 11.072l-19.968 8.704-38.016 15.872c-6.08 2.496-12.096 4.864-17.984 7.168l-34.048 12.928c-65.344 23.744-114.688 35.584-147.008 35.584-51.328 0-107.648-31.168-168.768-96.192a32 32 0 0 0-46.592 43.776C144.768 386.048 216.32 425.664 288 425.664zM800 768a96 96 0 0 0 95.552-86.784L896 672v-320a32 32 0 0 0-63.488-5.76L832 352v320a32 32 0 0 1-26.24 31.488L800 704h-320a32 32 0 0 1-31.488-26.24L448 672v-192a32 32 0 0 0-63.488-5.76L384 480v192a96 96 0 0 0 86.784 95.552L480 768h320z m-64-256a32 32 0 1 0 0-64h-128a32 32 0 0 0 0 64h128z m0 128a32 32 0 1 0 0-64h-192a32 32 0 0 0 0 64h192z" horiz-adv-x="1024" />
<glyph glyph-name="peixun" unicode="&#59475;" d="M541.824 780.032l9.664-3.84L932.48 602.24A64 64 0 0 0 960 509.824V160a32 32 0 1 0-64 0V469.12l-60.672-27.648 1.728-0.128-9.216-279.552a96 96 0 0 0-49.216-80.704l-8.192-4.096-218.176-95.616a96 96 0 0 0-68.928-3.136l-9.472 3.776-227.008 103.68a96 96 0 0 0-56 81.6l-0.064 8.896 8.512 260.032-108.544 49.536a64 64 0 0 0-6.784 112.832l6.784 3.648L471.68 776.256a96 96 0 0 0 70.08 3.84z m230.208-367.488L551.488 311.68a96 96 0 0 0-70.08-3.84l-9.664 3.84L262.4 407.36l-7.68-233.28a32 32 0 0 1 13.888-27.52l4.736-2.624 227.008-103.68a32 32 0 0 1 20.992-1.984l5.12 1.728 218.24 95.616a32 32 0 0 1 18.496 23.04l0.64 5.248 8.128 248.64zM503.488 719.872l-5.12-1.856L117.248 544l380.992-174.08a32 32 0 0 1 21.44-1.792l5.12 1.856L896 539.52 896 544l0.32 4.416-371.392 169.6a32 32 0 0 1-21.44 1.92z" horiz-adv-x="1024" />
<glyph glyph-name="huodong" unicode="&#59476;" d="M160-64a32 32 0 1 0 0 64H192V736a32 32 0 0 0 64 0V0h224a32 32 0 1 0 0-64h-320zM516.48 767.68c55.04-7.872 88.768-22.72 117.696-48l7.744-7.168 19.2-19.072c14.464-13.568 25.088-18.56 47.36-21.76 51.584-7.36 107.328 11.2 168.064 57.728a32 32 0 0 0 51.008-19.904L928 704v-448a32 32 0 0 0-5.952-18.624c-47.232-65.92-123.2-91.264-222.592-77.056-55.04 7.872-88.704 22.72-117.632 48l-7.744 7.168-19.2 19.072c-14.464 13.568-25.088 18.56-47.36 21.76-54.656 7.808-112.64-1.856-174.464-29.504a32 32 0 0 0-44.672 24L288 256V704a32 32 0 0 0 11.136 24.32c47.872 41.024 120.704 53.12 217.408 39.36zM363.264 694.016l-8.576-4.48-2.624-1.664v-385.088l8.768 2.816a366.336 366.336 0 0 0 119.488 17.216l19.392-1.152 16.896-1.984c36.928-5.312 58.624-16.384 82.368-38.656l8-7.808 9.408-9.6 8.576-7.872c19.392-16.64 41.6-26.048 83.648-32.064 62.912-8.96 109.056 0.768 141.312 28.736l7.168 6.72 6.976 7.808v377.6l-7.04-4.032c-43.072-23.04-85.76-34.688-127.68-34.432l-15.744 0.64-14.08 1.6c-36.928 5.312-58.624 16.384-82.368 38.656l-8 7.808-9.408 9.6-8.576 7.872c-17.216 14.784-36.672 23.872-70.336 29.952l-13.312 2.112-16.96 2.176c-55.296 6.144-97.6 1.6-127.36-12.48z" horiz-adv-x="1024" />
<glyph glyph-name="lianjiexian-yizhankai" unicode="&#59471;" d="M512 896a512 512 0 1 0 0-1024A512 512 0 0 0 512 896z m0-64a448 448 0 1 1 0-896A448 448 0 0 1 512 832z m256-384v-128H256V448h512z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 384 KiB

After

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

1
dist/lib/base/combination/tab.d.ts vendored

@ -19,4 +19,5 @@ export declare class Tab extends Widget {
getSelectedTab<T>(): T;
getTab<T>(v: string | number): T;
populate(): void;
isCardExisted(cardName: string): boolean;
}

13
dist/lib/base/single/button/buttons/button.d.ts vendored

@ -3,6 +3,19 @@ import { BasicButton } from "../button.basic";
export declare class Button extends BasicButton {
static xtype: string;
static EVENT_CHANGE: string;
props: {
minWidth?: number;
readonly?: boolean;
iconCls?: string;
level?: 'common' | 'success' | 'warning' | 'ignore';
block?: boolean;
clear?: boolean;
ghost?: boolean;
textAlign?: 'center' | 'left' | 'right';
whiteSpace?: 'nowrap' | 'normal';
textWidth?: number | null;
textHeight?: number | null;
} & BasicButton['props'];
text: Label;
icon?: IconLabel;
doRedMark(...args: any[]): void;

2
dist/lib/base/single/button/buttons/button.text.d.ts vendored

@ -1,7 +1,9 @@
import { Label } from "typescript";
import { BasicButton } from "../button.basic";
export declare class TextButton extends BasicButton {
static xtype: string;
static EVENT_CHANGE: string;
props: Label['props'] & BasicButton['props'];
setStyle(style: any): void;
doRedMark(...args: any[]): void;
unRedMark(...args: any[]): void;

13
dist/lib/case/button/item.singleselect.radio.d.ts vendored

@ -2,6 +2,19 @@ import { BasicButton } from "../../base/single/button/button.basic";
export declare class SingleSelectRadioItem extends BasicButton {
static xtype: string;
static EVENT_CHANGE: string;
props: {
iconWrapperWidth: number;
logic: {
dynamic: boolean;
};
textHgap: number;
textLgap: number;
textRgap: number;
text: string;
keyword: string;
py: string;
value: any;
} & BasicButton['props'];
doRedMark(...args: any[]): void;
unRedMark(...args: any[]): void;
}

1
dist/lib/core/var.d.ts vendored

@ -129,4 +129,5 @@ export interface _var {
Stretch: string;
};
StartOfWeek: number;
BlankSplitChar: string;
}

10
dist/lib/shims-tsx.d.ts vendored

@ -10,6 +10,8 @@ interface UIProps {
lgap: number;
tgap: number;
bgap: number;
vgap: number;
hgap: number;
}
interface ElementClassProps<T> extends UIProps {
cls: string;
@ -31,6 +33,10 @@ interface ElementClassProps<T> extends UIProps {
};
tagName: string;
element: any;
$testId: string;
$point: any;
$value: any;
$scope: () => any;
beforeRender(callback: () => void): void;
beforeInit(callback: () => void): void;
render(): any;
@ -39,12 +45,12 @@ declare namespace JSX {
interface IntrinsicElements {
[elemName: string]: Partial<UIProps>;
}
type ElementAttributesProperty = {
interface ElementAttributesProperty {
/**
* specify the property name to use
*/
__props: any;
};
}
interface IntrinsicClassAttributes<T> extends Partial<ElementClassProps<T>> {
}
}

6
dist/lib/widget/multiselect/multiselect.combo.d.ts vendored

@ -16,7 +16,7 @@ export declare class MultiSelectCombo extends Single {
_makeMap(): Obj;
_joinKeywords(keywords: string[], callback: Function): void;
_joinAll(res: {
type: string;
type: number;
value: string[];
assist: string[];
}, callback: Function): void;
@ -27,12 +27,12 @@ export declare class MultiSelectCombo extends Single {
showView(): void;
hideView(): void;
setValue(value: {
type: string;
type: number;
value: string[];
assist: string[];
}): void;
getValue(): {
type: string;
type: number;
value: string[];
assist: string[];
};

2
dist/resource.css vendored

File diff suppressed because one or more lines are too long

3
dist/resource.js vendored

@ -167,7 +167,7 @@ BI.i18n = {
"BI-More_Than": "大于",
"BI-More_And_Equal": "大于等于",
"BI-Please_Enter_SQL": "请输入SQL",
"BI-Basic_Click_To_Add_Text": "+点击新增\"{R1}\"",
"BI-Basic_Click_To_Add_Text": "点按回车键添加\"{R1}\"",
"BI-Basic_Please_Select": "请选择",
"BI-Basic_Font_Color": "文字颜色",
"BI-Basic_Background_Color": "背景色",
@ -196,4 +196,5 @@ BI.i18n = {
"BI-Basic_Year_Range_Error": "请选择{R1}年-{R2}年的日期",
"BI-Basic_Year_Month_Range_Error": "请选择{R1}年{R2}月-{R3}年{R4}月的日期",
"BI-Basic_Year_Quarter_Range_Error": "请选择{R1}年{R2}季度-{R3}年{R4}季度的日期",
"BI-Basic_Search_And_Patch_Paste": "搜索,支持批量粘贴、粘贴值通过换行识别"
};

20
dist/utils.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-5-24 9:50:17 AM */
/*! time: 2021-6-1 6:50:23 PM */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -82,7 +82,7 @@
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 1259);
/******/ return __webpack_require__(__webpack_require__.s = 1260);
/******/ })
/************************************************************************/
/******/ ({
@ -671,7 +671,8 @@ _.extend(BI, {
Bottom: "bottom",
Stretch: "stretch"
},
StartOfWeek: 1
StartOfWeek: 1,
BlankSplitChar: "\u200b \u200b",
});
@ -2916,7 +2917,7 @@ _.extend(BI, {
/***/ }),
/***/ 1117:
/***/ 1118:
/***/ (function(module, exports) {
BI.i18n = {
@ -3087,7 +3088,7 @@ BI.i18n = {
"BI-More_Than": "大于",
"BI-More_And_Equal": "大于等于",
"BI-Please_Enter_SQL": "请输入SQL",
"BI-Basic_Click_To_Add_Text": "+点击新增\"{R1}\"",
"BI-Basic_Click_To_Add_Text": "点按回车键添加\"{R1}\"",
"BI-Basic_Please_Select": "请选择",
"BI-Basic_Font_Color": "文字颜色",
"BI-Basic_Background_Color": "背景色",
@ -3116,6 +3117,7 @@ BI.i18n = {
"BI-Basic_Year_Range_Error": "请选择{R1}年-{R2}年的日期",
"BI-Basic_Year_Month_Range_Error": "请选择{R1}年{R2}月-{R3}年{R4}月的日期",
"BI-Basic_Year_Quarter_Range_Error": "请选择{R1}年{R2}季度-{R3}年{R4}季度的日期",
"BI-Basic_Search_And_Patch_Paste": "搜索,支持批量粘贴、粘贴值通过换行识别"
};
/***/ }),
@ -3130,7 +3132,7 @@ BI.Req = {
/***/ }),
/***/ 1259:
/***/ 1260:
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(91);
@ -3149,8 +3151,8 @@ __webpack_require__(97);
__webpack_require__(98);
__webpack_require__(108);
__webpack_require__(109);
__webpack_require__(1117);
__webpack_require__(1260);
__webpack_require__(1118);
__webpack_require__(1261);
__webpack_require__(110);
__webpack_require__(111);
module.exports = __webpack_require__(112);
@ -3158,7 +3160,7 @@ module.exports = __webpack_require__(112);
/***/ }),
/***/ 1260:
/***/ 1261:
/***/ (function(module, exports) {
/**

2
dist/utils.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/utils.min.js.map vendored

File diff suppressed because one or more lines are too long

3
i18n/i18n.cn.js

@ -166,7 +166,7 @@ BI.i18n = {
"BI-More_Than": "大于",
"BI-More_And_Equal": "大于等于",
"BI-Please_Enter_SQL": "请输入SQL",
"BI-Basic_Click_To_Add_Text": "+点击新增\"{R1}\"",
"BI-Basic_Click_To_Add_Text": "点按回车键添加\"{R1}\"",
"BI-Basic_Please_Select": "请选择",
"BI-Basic_Font_Color": "文字颜色",
"BI-Basic_Background_Color": "背景色",
@ -195,4 +195,5 @@ BI.i18n = {
"BI-Basic_Year_Range_Error": "请选择{R1}年-{R2}年的日期",
"BI-Basic_Year_Month_Range_Error": "请选择{R1}年{R2}月-{R3}年{R4}月的日期",
"BI-Basic_Year_Quarter_Range_Error": "请选择{R1}年{R2}季度-{R3}年{R4}季度的日期",
"BI-Basic_Search_And_Patch_Paste": "搜索,支持批量粘贴、粘贴值通过换行识别"
};

2
package.json

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

11
src/base/combination/searcher.js

@ -21,7 +21,6 @@ BI.Searcher = BI.inherit(BI.Widget, {
isAutoSearch: true, // 是否自动搜索
isAutoSync: true, // 是否自动同步数据, 即是否保持搜索面板和adapter面板状态值的统一
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
allowSearchBlank: true, // 是否能够搜索包含空格的字符串
// isAutoSearch为false时启用
onSearch: function (op, callback) {
@ -80,8 +79,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
search();
break;
case BI.Events.PAUSE:
// 可以搜索空格的情况下输入空格不做处理, 展示上一次的结果
if (!o.allowSearchBlank) {
if (BI.endWith(this.getValue(), BI.BlankSplitChar)) {
self._pauseSearch();
}
break;
@ -167,7 +165,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
},
_search: function () {
var self = this, o = this.options, keyword = o.allowSearchBlank ? this.editor.getValue() : this._getLastSearchKeyword();
var self = this, o = this.options, keyword = this.editor.getValue();
if (keyword === "" || this._stop) {
return;
}
@ -202,7 +200,10 @@ BI.Searcher = BI.inherit(BI.Widget, {
_getLastSearchKeyword: function () {
if (this.isValid()) {
var res = this.editor.getValue().match(/[\S]+/g);
var res = this.editor.getValue().split(/\u200b\s\u200b/);
if (BI.isEmptyString(res[res.length - 1])) {
res = res.slice(0, res.length - 1);
}
return BI.isNull(res) ? "" : res[res.length - 1];
}
},

4
src/base/combination/tab.js

@ -104,6 +104,10 @@ BI.Tab = BI.inherit(BI.Widget, {
});
},
isCardExisted: function (cardName) {
return this.layout.isCardExisted(cardName);
},
getSelect: function () {
return this.curr;
},

56
src/base/single/editor/editor.textarea.js

@ -16,6 +16,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
validationChecker: function () {
return true;
},
scrolly: true,
});
},
@ -26,7 +27,10 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
tagName: "textarea",
width: "100%",
height: "100%",
cls: "bi-textarea textarea-editor-content display-block"
cls: "bi-textarea textarea-editor-content display-block",
css: o.scrolly ? null : {
overflowY: "hidden",
},
});
this.content.element.css({ resize: "none" });
BI.createWidget({
@ -47,7 +51,11 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
this.content.element.on("input propertychange", function (e) {
self._checkError();
self._checkWaterMark();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CHANGE, self.getValue(), self);
self.fireEvent(BI.TextAreaEditor.EVENT_CHANGE);
if (BI.isEmptyString(self.getValue())) {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EMPTY, self.getValue(), self);
}
});
this.content.element.focus(function () {
@ -64,9 +72,22 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
this.content.element.blur(function () {
self._setErrorVisible(false);
self._blur();
if (!self._isError()) {
self.fireEvent(BI.TextAreaEditor.EVENT_CONFIRM);
}
self.fireEvent(BI.TextAreaEditor.EVENT_BLUR);
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + self.getName());
});
this.content.element.keydown(function () {
// 水印快速消失
self.watermark && self.watermark.setVisible(false);
});
this.content.element.keyup(function (e) {
self.fireEvent(BI.TextAreaEditor.EVENT_KEY_DOWN, e.keyCode);
});
this.content.element.click(function (e) {
e.stopPropagation();
});
if (BI.isKey(o.value)) {
this.setValue(o.value);
}
@ -89,12 +110,14 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
type: "bi.label",
cls: "bi-water-mark textarea-watermark",
textAlign: "left",
whiteSpace: "normal",
whiteSpace: o.scrolly ? "normal" : "nowrap",
title: o.watermark,
text: o.watermark,
invalid: o.invalid,
disabled: o.disabled,
hgap: 4,
vgap: 4
hgap: 6,
vgap: o.height > 24 ? 4 : 2,
height: o.height > 24 ? "" : o.height,
});
this.watermark.element.bind({
mousedown: function (e) {
@ -104,7 +127,10 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
self.blur();
}
e.stopEvent();
}
},
click: function (e) {
e.stopPropagation();
},
});
BI.createWidget({
type: "bi.absolute",
@ -125,13 +151,20 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
}
},
_isError: function () {
return this.isEnabled() && !this.options.validationChecker(this.getValue());
},
_checkError: function () {
this._setErrorVisible(this.isEnabled() && !this.options.validationChecker(this.getValue()));
this._setErrorVisible(this._isError());
},
_focus: function () {
this.content.element.addClass("textarea-editor-focus");
this._checkWaterMark();
if (BI.isEmptyString(this.getValue())) {
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EMPTY, this.getValue(), this);
}
},
_blur: function () {
@ -155,6 +188,13 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
}
},
_defaultState: function () {
if (BI.isEmptyString(this.getValue())) {
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EMPTY, this.getValue(), this);
this.fireEvent(BI.TextAreaEditor.EVENT_EMPTY);
}
},
focus: function () {
this._focus();
this.content.element.focus();
@ -173,6 +213,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
this.content.element.val(value);
this._checkError();
this._checkWaterMark();
this._defaultState();
},
setStyle: function (style) {
@ -206,4 +247,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
BI.TextAreaEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.TextAreaEditor.EVENT_BLUR = "EVENT_BLUR";
BI.TextAreaEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.TextAreaEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TextAreaEditor.EVENT_EMPTY = "EVENT_EMPTY";
BI.TextAreaEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.shortcut("bi.textarea_editor", BI.TextAreaEditor);

5
src/case/editor/editor.state.js

@ -22,14 +22,15 @@ BI.StateEditor = BI.inherit(BI.Widget, {
errorText: "",
height: 24,
defaultText: "", // 默认显示值,默认显示值与显示值的区别是默认显示值标记灰色
text: BI.i18nText("BI-Basic_Unrestricted") // 显示值
text: BI.i18nText("BI-Basic_Unrestricted"), // 显示值
el: {}
});
},
_init: function () {
BI.StateEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
this.editor = BI.createWidget(o.el, {
type: "bi.editor",
height: o.height,
hgap: o.hgap,

3
src/core/constant/var.js

@ -135,5 +135,6 @@ _.extend(BI, {
Bottom: "bottom",
Stretch: "stretch"
},
StartOfWeek: 1
StartOfWeek: 1,
BlankSplitChar: "\u200b \u200b",
});

4
src/core/h.js

@ -22,7 +22,7 @@ BI.h = function (type, props, children) {
return children;
}
if (BI.isFunction(type)) {
type = type.xtype;
type = type.xtype || type;
}
if (type === "el") {
return BI.extend({
@ -32,4 +32,4 @@ BI.h = function (type, props, children) {
return BI.extend({
type: type,
}, children.length > 0 ? {items: children} : {}, props);
};
};

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

@ -10,7 +10,7 @@
BI.FloatLeftLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FloatLeftLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-left clearfix border-sizing",
baseCls: "bi-left clearfix",
hgap: 0,
vgap: 0,
lgap: 0,
@ -22,18 +22,6 @@ BI.FloatLeftLayout = BI.inherit(BI.Layout, {
render: function () {
BI.FloatLeftLayout.superclass.render.apply(this, arguments);
var o = this.options;
if (o.hgap > 0) {
this.element.css({
"padding-left": o.hgap / 2 / BI.pixRatio + BI.pixUnit,
"padding-right": o.hgap / 2 / BI.pixRatio + BI.pixUnit
});
}
if (o.vgap > 0) {
this.element.css({
"padding-top": o.vgap / 2 / BI.pixRatio + BI.pixUnit,
"padding-bottom": o.vgap / 2 / BI.pixRatio + BI.pixUnit
});
}
this.populate(this.options.items);
},
@ -99,7 +87,7 @@ BI.shortcut("bi.left", BI.FloatLeftLayout);
BI.FloatRightLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FloatRightLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-right clearfix border-sizing",
baseCls: "bi-right clearfix",
hgap: 0,
vgap: 0,
lgap: 0,
@ -111,18 +99,6 @@ BI.FloatRightLayout = BI.inherit(BI.Layout, {
render: function () {
BI.FloatRightLayout.superclass.render.apply(this, arguments);
var o = this.options;
if (o.hgap > 0) {
this.element.css({
"padding-left": o.hgap / 2 / BI.pixRatio + BI.pixUnit,
"padding-right": o.hgap / 2 / BI.pixRatio + BI.pixUnit
});
}
if (o.vgap > 0) {
this.element.css({
"padding-top": o.vgap / 2 / BI.pixRatio + BI.pixUnit,
"padding-bottom": o.vgap / 2 / BI.pixRatio + BI.pixUnit
});
}
this.populate(this.options.items);
},

2
src/widget/editor/editor.search.js

@ -17,7 +17,7 @@ BI.SearchEditor = BI.inherit(BI.Widget, {
this.options.height -= 2;
BI.SearchEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
this.editor = BI.createWidget(o.el, {
type: "bi.editor",
height: o.height,
watermark: o.watermark,

18
src/widget/multiselect/multiselect.combo.js

@ -76,28 +76,12 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self._setStartValue("");
self.fireEvent(BI.MultiSelectCombo.EVENT_STOP);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) {
var keyword = this.getSearcher().getMatchedItemValue();
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
self.combo.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.populate();
self._setStartValue("");
self._dataChange = true;
});
}
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
if (BI.endWith(last, BI.BlankSplitChar)) {
self.combo.setValue(self.storeValue);
assertShowValue();
self.combo.populate();

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

@ -76,18 +76,13 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
self._setStartValue("");
self.fireEvent(BI.MultiSelectNoBarCombo.EVENT_STOP);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) {
self._addItem(assertShowValue, true);
}
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
if (BI.endWith(last, BI.BlankSplitChar)) {
self.combo.setValue(self.storeValue);
assertShowValue();
self.combo.populate();
@ -292,7 +287,7 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
_addItem: function (assertShowValue, matched) {
var self = this;
var keyword = matched ? this.trigger.getSearcher().getMatchedItemValue() : this.trigger.getSearcher().getKeyword();
var keyword = this.trigger.getSearcher().getKeyword();
this._join({
type: BI.Selection.Multi,
value: [keyword]

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

@ -74,24 +74,14 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_STOP);
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) {
self._addItem(assertShowValue, true);
}
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM, function () {
if (!this.getSearcher().hasMatched()) {
self._addItem(assertShowValue);
var addedValue = this.getSearcher().getKeyword();
self._stopEditing();
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_ADD_ITEM, addedValue);
}
self._addItem(assertShowValue, true);
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
if (BI.endWith(last, BI.BlankSplitChar)) {
self.combo.setValue(self.storeValue);
assertShowValue();
self.combo.populate();
@ -300,9 +290,9 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
});
},
_addItem: function (assertShowValue, matched) {
_addItem: function (assertShowValue) {
var self = this;
var keyword = matched ? this.trigger.getSearcher().getMatchedItemValue() : this.trigger.getSearcher().getKeyword();
var keyword = this.trigger.getSearcher().getKeyword();
this._join({
type: BI.Selection.Multi,
value: [keyword]
@ -344,20 +334,12 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
var self = this, o = this.options;
this._assertValue(this.storeValue);
this.requesting = true;
o.itemsCreator({
type: BI.MultiSelectInsertCombo.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
digest();
function digest () {
BI.each(keywords, function (i, val) {
if (BI.isNotNull(selectedMap[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);
});
self._adjust(callback);
}
@ -491,6 +473,5 @@ BI.MultiSelectInsertCombo.EVENT_STOP = "EVENT_STOP";
BI.MultiSelectInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.MultiSelectInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.MultiSelectInsertCombo.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multi_select_insert_combo", BI.MultiSelectInsertCombo);

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

@ -69,24 +69,14 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
self._setStartValue("");
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) {
self._addItem(assertShowValue, true);
}
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM, function () {
if (!this.getSearcher().hasMatched()) {
self._addItem(assertShowValue);
var addedValue = this.getSearcher().getKeyword();
self._stopEditing();
self.fireEvent(BI.MultiSelectInsertNoBarCombo.EVENT_ADD_ITEM, addedValue);
}
self._addItem(assertShowValue, true);
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
if (BI.endWith(last, BI.BlankSplitChar)) {
self.combo.setValue(self.storeValue);
assertShowValue();
self.combo.populate();
@ -298,9 +288,9 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
});
},
_addItem: function (assertShowValue, matched) {
_addItem: function (assertShowValue) {
var self = this;
var keyword = matched ? this.trigger.getSearcher().getMatchedItemValue() : this.trigger.getSearcher().getKeyword();
var keyword = this.trigger.getSearcher().getKeyword();
this._join({
type: BI.Selection.Multi,
value: [keyword]
@ -342,20 +332,12 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
var self = this, o = this.options;
this._assertValue(this.storeValue);
this.requesting = true;
o.itemsCreator({
type: BI.MultiSelectInsertNoBarCombo.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
digest();
function digest () {
BI.each(keywords, function (i, val) {
if (BI.isNotNull(selectedMap[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);
});
self._adjust(callback);
}
@ -485,6 +467,5 @@ BI.extend(BI.MultiSelectInsertNoBarCombo, {
});
BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.MultiSelectInsertNoBarCombo.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multi_select_insert_no_bar_combo", BI.MultiSelectInsertNoBarCombo);

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

@ -49,9 +49,6 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_START, function () {
self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_START);
});
this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM, function () {
self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM);
});
this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_PAUSE, function () {
self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_PAUSE);
});
@ -150,7 +147,6 @@ BI.MultiSelectInsertTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiSelectInsertTrigger.EVENT_PAUSE = "EVENT_PAUSE";
BI.MultiSelectInsertTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW = "EVENT_BEFORE_COUNTER_POPUPVIEW";
BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiSelectInsertTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiSelectInsertTrigger.EVENT_BLUR = "EVENT_BLUR";

49
src/widget/multiselect/search/multiselect.search.insert.pane.js

@ -27,24 +27,12 @@ BI.MultiSelectSearchInsertPane = BI.inherit(BI.Widget, {
BI.MultiSelectSearchInsertPane.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.tooltipClick = BI.createWidget({
type: "bi.label",
invisible: true,
text: BI.i18nText("BI-Click_Blank_To_Select"),
cls: "multi-select-toolbar",
height: this.constants.height
});
this.addNotMatchTip = BI.createWidget({
type: "bi.text_button",
invisible: true,
type: "bi.label",
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: this.constants.height,
cls: "bi-high-light",
hgap: 5,
handler: function () {
self.fireEvent(BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM, o.keywordGetter());
}
});
this.loader = BI.createWidget({
@ -68,38 +56,16 @@ BI.MultiSelectSearchInsertPane = BI.inherit(BI.Widget, {
type: "bi.vtape",
element: this,
items: [{
type: "bi.vertical",
items: [this.tooltipClick, this.addNotMatchTip],
height: this.constants.height
el: this.addNotMatchTip,
height: this.constants.height,
}, {
el: this.loader
}]
el: this.loader,
}],
});
},
setKeyword: function (keyword) {
var o = this.options;
var hasSameValue = BI.some(this.loader.getAllButtons(), function (idx, btn) {
return keyword === (o.valueFormatter(btn.getValue()) || btn.getValue());
});
var isMatchTipVisible = this.loader.getAllButtons().length > 0 && hasSameValue;
this.tooltipClick.setVisible(isMatchTipVisible);
this.addNotMatchTip.setVisible(!isMatchTipVisible);
!isMatchTipVisible && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getMatchedItemValue: function () {
var value;
var o = this.options;
BI.some(this.loader.getAllButtons(), function (idx, btn) {
var v = btn.getValue();
if (o.keywordGetter() === (o.valueFormatter(v) || v)) {
value = v;
return true;
}
});
return value;
this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
isAllSelected: function () {
@ -107,7 +73,7 @@ BI.MultiSelectSearchInsertPane = BI.inherit(BI.Widget, {
},
hasMatched: function () {
return this.tooltipClick.isVisible();
return false;
},
setValue: function (v) {
@ -128,6 +94,5 @@ BI.MultiSelectSearchInsertPane = BI.inherit(BI.Widget, {
});
BI.MultiSelectSearchInsertPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multi_select_search_insert_pane", BI.MultiSelectSearchInsertPane);

48
src/widget/multiselect/search/multiselect.search.pane.js

@ -27,14 +27,6 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, {
BI.MultiSelectSearchPane.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.tooltipClick = BI.createWidget({
type: "bi.label",
invisible: true,
text: BI.i18nText("BI-Click_Blank_To_Select"),
cls: "multi-select-toolbar",
height: this.constants.height
});
this.loader = BI.createWidget({
type: "bi.multi_select_search_loader",
keywordGetter: o.keywordGetter,
@ -42,7 +34,6 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, {
itemsCreator: function (op, callback) {
o.itemsCreator.apply(self, [op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
}]);
},
itemHeight: o.itemHeight,
@ -53,40 +44,16 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, {
});
this.resizer = BI.createWidget({
type: "bi.vtape",
type: "bi.absolute",
element: this,
items: [{
el: this.tooltipClick,
height: 0
}, {
el: this.loader
}]
});
this.tooltipClick.setVisible(false);
},
setKeyword: function (keyword) {
var btn, o = this.options;
var isVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === (o.valueFormatter(btn.getValue()) || btn.getValue()));
if (isVisible !== this.tooltipClick.isVisible()) {
this.tooltipClick.setVisible(isVisible);
this.resizer.attr("items")[0].height = (isVisible ? this.constants.height : 0);
this.resizer.resize();
}
},
getMatchedItemValue: function () {
var value;
var o = this.options;
BI.some(this.loader.getAllButtons(), function (idx, btn) {
var v = btn.getValue();
if (o.keywordGetter() === (o.valueFormatter(v) || v)) {
value = v;
return true;
}
el: this.loader,
left: 0,
right: 0,
bottom: 0,
top: 0,
}],
});
return value;
},
isAllSelected: function () {
@ -94,7 +61,6 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, {
},
hasMatched: function () {
return this.tooltipClick.isVisible();
},
setValue: function (v) {

34
src/widget/multiselect/trigger/editor.multiselect.js

@ -18,7 +18,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
BI.MultiSelectEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: "bi.state_editor",
type: "bi.select_patch_editor",
element: this,
height: o.height,
watermark: o.watermark,
@ -33,10 +33,6 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.StateEditor.EVENT_PAUSE, function () {
self.fireEvent(BI.MultiSelectEditor.EVENT_PAUSE);
});
this.editor.on(BI.StateEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.MultiSelectEditor.EVENT_FOCUS);
});
@ -66,12 +62,7 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
},
getValue: function () {
var v = this.editor.getState();
if (BI.isArray(v) && v.length > 0) {
return v[v.length - 1];
}
return "";
return this.editor.getValue();
},
getState: function () {
@ -79,14 +70,27 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
},
getKeywords: function () {
var val = this.editor.getLastChangedValue();
var keywords = val.match(/[\S]+/g);
if (BI.isEndWithBlank(val)) {
return keywords.concat([" "]);
var val = this.editor.getValue();
var keywords = val.split(/\u200b\s\u200b/);
if (BI.isEmptyString(keywords[keywords.length - 1])) {
keywords = keywords.slice(0, keywords.length - 1);
}
if (/\u200b\s\u200b$/.test(val)) {
return keywords.concat([BI.BlankSplitChar]);
}
return keywords;
},
getKeyword: function () {
var val = this.editor.getValue();
var keywords = val.split(/\u200b\s\u200b/);
if (BI.isEmptyString(keywords[keywords.length - 1])) {
keywords = keywords.slice(0, keywords.length - 1);
}
return BI.isEmptyArray(keywords) ? "" : keywords[keywords.length - 1];
},
populate: function (items) {
}

214
src/widget/multiselect/trigger/editor/editor.patch.js

@ -0,0 +1,214 @@
/**
* @author windy
* @version 2.0
* Created by windy on 2021/5/18
*/
BI.SelectPatchEditor = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-patch-select-editor",
height: 24,
},
render: function () {
var self = this, o = this.options;
var debounceInputChange = BI.debounce(BI.bind(this._dealChange, this), 300);
return BI.extend({
type: "bi.state_editor",
ref: function (_ref) {
self.editor = _ref;
},
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
height: o.height,
watermark: o.watermark,
allowBlank: true,
value: o.value,
defaultText: o.text,
text: o.text,
tipType: o.tipType,
warningTitle: o.warningTitle,
el: {
type: 'bi.textarea_editor',
scrolly: false,
validationChecker: function () {
return true;
},
throttle: true,
},
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function (type, v) {
if (BI.contains(v, "\n")) {
self._dealChange(type, v);
} else {
debounceInputChange(type, v);
}
},
}, {
eventName: BI.Editor.EVENT_KEY_DOWN,
action: function (keyCode) {
if (keyCode === BI.KeyCode.ENTER) {
self._clearSplitValue();
}
},
}, {
eventName: BI.Editor.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.SelectPatchEditor.EVENT_FOCUS, arguments);
},
}, {
eventName: BI.Editor.EVENT_BLUR,
action: function () {
self._start = false;
self.fireEvent(BI.SelectPatchEditor.EVENT_BLUR, arguments);
},
}],
}, o.el);
},
_clearSplitValue: function () {
this.editor.setValue("");
},
_dealChange: function (type, v) {
var value = "";
if (v !== this.editor.getValue()) {
return;
}
if (BI.isKey(v)) {
value = this._formatText(v);
}
if (type === BI.Events.CHANGE) {
this._setValue(value);
if (this._trimValue(value) !== "") {
if (!this._start || !BI.isKey(this._lastValue) || (this._pause === true && this._trimValue(this._lastValue) !== this._trimValue(value))) {
this._start = true;
this._pause = false;
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.STARTEDIT, this.getValue(), this);
}
}
if (this._trimValue(this._lastValue) !== this._trimValue(value)) {
this.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
if (BI.endWith(value, BI.BlankSplitChar)) {
this._pause = true;
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.PAUSE, "", this);
}
}
if (type === BI.Events.EMPTY || type === BI.Events.STOPEDIT) {
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EMPTY);
}
this._lastValue = value;
},
_trimValue: function (v) {
return BI.trim(BI.replaceAll(v || "", BI.BlankSplitChar, ""));
},
_formatText: function (v) {
return BI.replaceAll(v || "", "\n", BI.BlankSplitChar);
},
setWaterMark: function (v) {
this.editor.setWaterMark(v);
},
doRedMark: function () {
this.editor.doRedMark.apply(this.editor, arguments);
},
unRedMark: function () {
this.editor.unRedMark.apply(this.editor, arguments);
},
doHighLight: function () {
this.editor.doHighLight.apply(this.editor, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
focus: function () {
this.editor.focus();
},
blur: function () {
this.editor.blur();
},
_setValue: function (v) {
this.editor.setValue(this._formatText(v));
},
_showInput: function () {
this.editor.visible();
this.text.invisible();
},
_showHint: function () {
this.editor.invisible();
this.text.visible();
},
isValid: function () {
return this.editor.isValid();
},
setErrorText: function (text) {
this.editor.setErrorText(text);
},
getErrorText: function () {
return this.editor.getErrorText();
},
isEditing: function () {
return this.editor.isEditing();
},
getLastValidValue: function () {
return this.editor.getLastValidValue();
},
getLastChangedValue: function () {
return this.editor.getLastChangedValue();
},
setValue: function (v) {
this._setValue(v);
this._lastValue = this._trimValue(v);
},
getValue: function () {
return BI.trim(this.editor.getValue());
},
getState: function () {
return this.editor.getState();
},
setState: function (v) {
this.editor.setState(v);
},
setTipType: function (v) {
this.editor.setTipType(v);
},
getText: function () {
return this.editor.getText();
},
});
BI.SelectPatchEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.SelectPatchEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.SelectPatchEditor.EVENT_BLUR = "EVENT_BLUR";
BI.shortcut("bi.select_patch_editor", BI.SelectPatchEditor);

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

@ -16,7 +16,8 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
valueFormatter: BI.emptyFn,
adapter: null,
masker: {},
text: BI.i18nText("BI-Basic_Please_Select")
text: BI.i18nText("BI-Basic_Please_Select"),
watermark: BI.i18nText("BI-Basic_Search_And_Patch_Paste"),
});
},
@ -43,7 +44,6 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
this.searcher = BI.createWidget({
type: "bi.searcher",
allowSearchBlank: false,
element: this,
height: o.height,
isAutoSearch: false,
@ -57,22 +57,16 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
type: "bi.multi_select_search_insert_pane",
valueFormatter: o.valueFormatter,
keywordGetter: function () {
return self.editor.getValue();
return self.editor.getKeyword();
},
itemsCreator: function (op, callback) {
var keyword = self.editor.getValue();
var keyword = self.editor.getKeyword();
op.keywords = [keyword];
this.setKeyword(keyword);
o.itemsCreator(op, callback);
},
itemHeight: o.itemHeight,
value: o.value,
listeners: [{
eventName: BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,
action: function () {
self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM);
}
}]
}, o.popup),
adapter: o.adapter,
@ -115,7 +109,7 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
},
getKeyword: function () {
return this.editor.getValue();
return this.editor.getKeyword();
},
hasMatched: function () {
@ -169,10 +163,6 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
}
},
getMatchedItemValue: function() {
return this.searcher.getView().getMatchedItemValue();
},
getState: function() {
return this.editor.getState();
},
@ -201,7 +191,6 @@ BI.MultiSelectInsertSearcher.EVENT_START = "EVENT_START";
BI.MultiSelectInsertSearcher.EVENT_STOP = "EVENT_STOP";
BI.MultiSelectInsertSearcher.EVENT_PAUSE = "EVENT_PAUSE";
BI.MultiSelectInsertSearcher.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiSelectInsertSearcher.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiSelectInsertSearcher.EVENT_BLUR = "EVENT_BLUR";
BI.shortcut("bi.multi_select_insert_searcher", BI.MultiSelectInsertSearcher);

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

@ -43,7 +43,6 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
this.searcher = BI.createWidget({
type: "bi.searcher",
allowSearchBlank: false,
element: this,
height: o.height,
isAutoSearch: false,
@ -62,7 +61,6 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
itemsCreator: function (op, callback) {
var keyword = self.editor.getValue();
op.keywords = [keyword];
this.setKeyword(keyword);
o.itemsCreator(op, callback);
},
itemHeight: o.itemHeight,
@ -96,10 +94,6 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
}
},
getMatchedItemValue: function() {
return this.searcher.getView().getMatchedItemValue();
},
adjustView: function () {
this.searcher.adjustView();
},

91
src/widget/multiselectlist/multiselectlist.insert.js

@ -57,32 +57,22 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
}
},
itemHeight: o.itemHeight,
listeners: [{
eventName: BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,
action: function () {
var keyword = self.trigger.getKeyword();
if (!self.trigger.hasMatched()) {
if (self.storeValue.type === BI.Selection.Multi) {
BI.pushDistinct(self.storeValue.value, keyword);
}
self._showAdapter();
self.adapter.setValue(self.storeValue);
self.adapter.populate();
if (self.storeValue.type === BI.Selection.Multi) {
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
}
}
}
}]
});
this.searcherPane.setVisible(false);
this.trigger = BI.createWidget({
type: "bi.searcher",
el: {
type: "bi.select_patch_editor",
el: {
type: "bi.search_editor",
watermark: BI.i18nText("BI-Basic_Search_And_Patch_Paste"),
},
ref: function (ref) {
self.editor = ref;
},
height: o.searcherHeight,
},
allowSearchBlank: false,
isAutoSearch: false,
isAutoSync: false,
onSearch: function (op, callback) {
@ -112,34 +102,32 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
eventName: BI.Searcher.EVENT_PAUSE,
action: function () {
var keyword = this.getKeyword();
if (this.hasMatched()) {
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
if (self.storeValue.type === BI.Selection.Multi) {
BI.pushDistinct(self.storeValue.value, keyword);
}
self._showAdapter();
self.adapter.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.adapter.populate();
self._setStartValue("");
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
});
}
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
if (self.storeValue.type === BI.Selection.Multi) {
BI.pushDistinct(self.storeValue.value, keyword);
}
self._showAdapter();
self.adapter.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.adapter.populate();
self._setStartValue("");
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
});
self._showAdapter();
}
}, {
eventName: BI.Searcher.EVENT_SEARCHING,
action: function () {
var keywords = this.getKeywords();
var keywords = self._getKeywords();
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
if (BI.endWith(last, BI.BlankSplitChar)) {
self.adapter.setValue(self.storeValue);
assertShowValue();
self.adapter.populate();
@ -195,6 +183,19 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
});
},
_getKeywords: function () {
var val = this.editor.getValue();
var keywords = val.split(/\u200b\s\u200b/);
if (BI.isEmptyString(keywords[keywords.length - 1])) {
keywords = keywords.slice(0, keywords.length - 1);
}
if (/\u200b\s\u200b$/.test(val)) {
return keywords.concat([BI.BlankSplitChar]);
}
return keywords;
},
_showAdapter: function () {
this.adapter.setVisible(true);
this.searcherPane.setVisible(false);
@ -224,20 +225,12 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
var self = this, o = this.options;
this._assertValue(this.storeValue);
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
digest();
function digest () {
BI.each(keywords, function (i, val) {
if (BI.isNotNull(selectedMap[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);
});
callback();
}

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

@ -61,32 +61,22 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
o.itemsCreator(op, callback);
}
},
listeners: [{
eventName: BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,
action: function () {
var keyword = self.trigger.getKeyword();
if (!self.trigger.hasMatched()) {
if (self.storeValue.type === BI.Selection.Multi) {
BI.pushDistinct(self.storeValue.value, keyword);
}
self._showAdapter();
self.adapter.setValue(self.storeValue);
self.adapter.populate();
if (self.storeValue.type === BI.Selection.Multi) {
self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE);
}
}
}
}]
});
this.searcherPane.setVisible(false);
this.trigger = BI.createWidget({
type: "bi.searcher",
el: {
type: "bi.select_patch_editor",
el: {
type: "bi.search_editor",
watermark: BI.i18nText("BI-Basic_Search_And_Patch_Paste"),
},
ref: function (ref) {
self.editor = ref;
},
height: o.searcherHeight
},
allowSearchBlank: false,
isAutoSearch: false,
isAutoSync: false,
onSearch: function (op, callback) {
@ -116,33 +106,31 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
eventName: BI.Searcher.EVENT_PAUSE,
action: function () {
var keyword = this.getKeyword();
if (this.hasMatched()) {
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
if (self.storeValue.type === BI.Selection.Multi) {
BI.pushDistinct(self.storeValue.value, keyword);
}
self._showAdapter();
self.adapter.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.adapter.populate();
self._setStartValue("");
self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE);
});
}
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
if (self.storeValue.type === BI.Selection.Multi) {
BI.pushDistinct(self.storeValue.value, keyword);
}
self._showAdapter();
self.adapter.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.adapter.populate();
self._setStartValue("");
self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE);
});
}
}, {
eventName: BI.Searcher.EVENT_SEARCHING,
action: function () {
var keywords = this.getKeywords();
var keywords = self._getKeywords();
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
if (BI.endWith(last, BI.BlankSplitChar)) {
self.adapter.setValue(self.storeValue);
assertShowValue();
self.adapter.populate();
@ -201,6 +189,19 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
});
},
_getKeywords: function () {
var val = this.editor.getValue();
var keywords = val.split(/\u200b\s\u200b/);
if (BI.isEmptyString(keywords[keywords.length - 1])) {
keywords = keywords.slice(0, keywords.length - 1);
}
if (/\u200b\s\u200b$/.test(val)) {
return keywords.concat([BI.BlankSplitChar]);
}
return keywords;
},
_showAdapter: function () {
this.adapter.setVisible(true);
this.searcherPane.setVisible(false);
@ -229,20 +230,11 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
var self = this, o = this.options;
this._assertValue(this.storeValue);
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
digest();
function digest (items) {
var selectedMap = self._makeMap(items);
BI.each(keywords, function (i, val) {
if (BI.isNotNull(selectedMap[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);
});
callback();
}

43
src/widget/multiselectlist/multiselectlist.js

@ -53,7 +53,6 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
var keyword = self.trigger.getKeyword();
if (BI.isNotEmptyString(keyword)) {
op.keywords = [keyword];
this.setKeyword(op.keywords[0]);
o.itemsCreator(op, callback);
}
},
@ -64,9 +63,15 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
this.trigger = BI.createWidget({
type: "bi.searcher",
el: {
type: "bi.select_patch_editor",
el: {
type: "bi.search_editor",
},
ref: function (ref) {
self.editor = ref;
},
height: o.searcherHeight
},
allowSearchBlank: false,
isAutoSearch: false,
isAutoSync: false,
onSearch: function (op, callback) {
@ -95,22 +100,9 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
}, {
eventName: BI.Searcher.EVENT_PAUSE,
action: function () {
var keyword = this.getKeyword();
if (this.hasMatched()) {
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
self._showAdapter();
self.adapter.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.adapter.populate();
self._setStartValue("");
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
}
}
self._showAdapter();
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
},
}, {
eventName: BI.Searcher.EVENT_SEARCHING,
action: function () {
@ -119,7 +111,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
if (BI.endWith(last, BI.BlankSplitChar)) {
self.adapter.setValue(self.storeValue);
assertShowValue();
self.adapter.populate();
@ -174,6 +166,19 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
});
},
_getKeywords: function () {
var val = this.editor.getValue();
var keywords = val.split(/\u200b\s\u200b/);
if (BI.isEmptyString(keywords[keywords.length - 1])) {
keywords = keywords.slice(0, keywords.length - 1);
}
if (/\u200b\s\u200b$/.test(val)) {
return keywords.concat([BI.BlankSplitChar]);
}
return keywords;
},
_showAdapter: function () {
this.adapter.setVisible(true);
this.searcherPane.setVisible(false);

2
src/widget/numberinterval/singleeditor/single.editor.js

@ -15,7 +15,7 @@ BI.NumberIntervalSingleEidtor = BI.inherit(BI.Single, {
ref: function (_ref) {
self.editor = _ref;
},
height: o.height - 2,
height: o.height,
watermark: o.watermark,
allowBlank: o.allowBlank,
value: o.value,

18
src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js

@ -69,28 +69,12 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () {
self._setStartValue("");
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) {
var keyword = this.getSearcher().getKeyword();
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
self.combo.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self._populate();
self._setStartValue("");
self._dataChange = true;
});
}
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
if (BI.endWith(last, BI.BlankSplitChar)) {
self.combo.setValue(self.storeValue);
assertShowValue();
self.combo.populate();

2
src/widget/searchmultitextvaluecombo/trigger/searcher.multitextvalue.js

@ -25,7 +25,6 @@ BI.SearchMultiSelectSearcher = BI.inherit(BI.Widget, {
this.searcher = BI.createWidget({
type: "bi.searcher",
allowSearchBlank: false,
element: this,
height: o.height,
isAutoSearch: false,
@ -44,7 +43,6 @@ BI.SearchMultiSelectSearcher = BI.inherit(BI.Widget, {
itemsCreator: function (op, callback) {
var keyword = self.editor.getValue();
op.keywords = [keyword];
this.setKeyword(keyword);
o.itemsCreator(op, callback);
},
value: o.value

20
src/widget/singleselect/search/singleselect.search.pane.insert.js

@ -36,15 +36,12 @@ BI.SingleSelectSearchInsertPane = BI.inherit(BI.Widget, {
});
this.addNotMatchTip = BI.createWidget({
type: "bi.text_button",
type: "bi.label",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: this.constants.height,
cls: "bi-high-light",
hgap: 5,
handler: function () {
self.fireEvent(BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM, o.keywordGetter());
}
});
this.loader = BI.createWidget({
@ -88,20 +85,6 @@ BI.SingleSelectSearchInsertPane = BI.inherit(BI.Widget, {
!isMatchTipVisible && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getMatchedItemValue: function () {
var value;
var o = this.options;
BI.some(this.loader.getAllButtons(), function (idx, btn) {
var v = btn.getValue();
if (o.keywordGetter() === (o.valueFormatter(v) || v)) {
value = v;
return true;
}
});
return value;
},
hasMatched: function () {
return this.tooltipClick.isVisible();
},
@ -124,6 +107,5 @@ BI.SingleSelectSearchInsertPane = BI.inherit(BI.Widget, {
});
BI.SingleSelectSearchInsertPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.single_select_search_insert_pane", BI.SingleSelectSearchInsertPane);

14
src/widget/singleselect/search/singleselect.search.pane.js

@ -75,20 +75,6 @@ BI.SingleSelectSearchPane = BI.inherit(BI.Widget, {
}
},
getMatchedItemValue: function () {
var value;
var o = this.options;
BI.some(this.loader.getAllButtons(), function (idx, btn) {
var v = btn.getValue();
if (o.keywordGetter() === (o.valueFormatter(v) || v)) {
value = v;
return true;
}
});
return value;
},
hasMatched: function () {
return this.tooltipClick.isVisible();
},

29
src/widget/singleselect/singleselect.combo.js

@ -30,7 +30,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
this.trigger = BI.createWidget({
type: "bi.single_select_trigger",
height: o.height,
height: o.height - 2,
// adapter: this.popup,
allowNoSelect: o.allowNoSelect,
allowEdit: o.allowEdit,
@ -63,32 +63,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
self._setStartValue();
self.fireEvent(BI.SingleSelectCombo.EVENT_STOP);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) {
var keyword = this.getSearcher().getMatchedItemValue();
self.combo.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.populate();
self._setStartValue();
}
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
self.combo.setValue(self.storeValue);
assertShowValue();
self.combo.populate();
self._setStartValue();
} else {
self.combo.setValue(self.storeValue);
assertShowValue();
}
});
}
this.trigger.on(BI.SingleSelectTrigger.EVENT_SEARCHING, function () {
self.fireEvent(BI.SingleSelectCombo.EVENT_SEARCHING);
});

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

@ -12,7 +12,8 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, {
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
allowEdit: true
allowEdit: true,
watermark: BI.i18nText("BI-Basic_Search_And_Patch_Paste"),
});
},
@ -29,6 +30,7 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, {
this.trigger = BI.createWidget({
type: "bi.single_select_trigger",
watermark: o.watermark,
height: o.height - 2,
allowNoSelect: o.allowNoSelect,
allowEdit: o.allowEdit,
@ -48,16 +50,6 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, {
searcher: {
popup: {
type: "bi.single_select_search_insert_pane",
listeners: [{
eventName: BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM,
action: function () {
if (!self.trigger.getSearcher().hasMatched()) {
self.storeValue = self.trigger.getSearcher().getKeyword();
assertShowValue();
self._defaultState();
}
}
}]
}
}
});
@ -78,32 +70,11 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, {
self.fireEvent(BI.SingleSelectInsertCombo.EVENT_STOP);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) {
var keyword = this.getSearcher().getMatchedItemValue();
self.storeValue = keyword;
self.combo.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.populate();
self._setStartValue();
}
self.storeValue = self.trigger.getSearcher().getKeyword();
assertShowValue();
self._defaultState();
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
self.combo.setValue(self.storeValue);
assertShowValue();
self.combo.populate();
self._setStartValue();
} else {
self.combo.setValue(self.storeValue);
assertShowValue();
}
});
}
this.trigger.on(BI.SingleSelectTrigger.EVENT_SEARCHING, function () {
self.fireEvent(BI.SingleSelectInsertCombo.EVENT_SEARCHING);
});
@ -220,29 +191,6 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, {
return BI.makeObject(values || []);
},
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
this.requesting = true;
o.itemsCreator({
type: BI.SingleSelectInsertCombo.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
BI.each(keywords, function (i, val) {
if (BI.isNotNull(selectedMap[val])) {
BI.remove(self.storeValue.value, val);
}
});
self._adjust(callback);
}
},
_adjust: function (callback) {
var self = this, o = this.options;
adjust();

1
src/widget/singleselect/singleselect.trigger.js

@ -35,6 +35,7 @@ BI.SingleSelectTrigger = BI.inherit(BI.Trigger, {
this.searcher = BI.createWidget(o.searcher, {
type: "bi.single_select_searcher",
watermark: o.watermark,
allowNoSelect: o.allowNoSelect,
text: o.text,
height: o.height,

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

@ -9,7 +9,8 @@ BI.SingleSelectInsertList = BI.inherit(BI.Single, {
baseCls: "bi-multi-select-insert-list",
allowNoSelect: false,
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn
valueFormatter: BI.emptyFn,
searcherHeight: 24,
});
},
_init: function () {
@ -55,25 +56,22 @@ BI.SingleSelectInsertList = BI.inherit(BI.Single, {
this.setKeyword(op.keywords[0]);
o.itemsCreator(op, callback);
},
listeners: [{
eventName: BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM,
action: function () {
var keyword = self.trigger.getKeyword();
if (!self.trigger.hasMatched()) {
self.storeValue = keyword;
self._showAdapter();
self.adapter.setValue(self.storeValue);
self.adapter.populate();
self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE);
}
}
}]
});
this.searcherPane.setVisible(false);
this.trigger = BI.createWidget({
type: "bi.searcher",
allowSearchBlank: false,
el: {
type: "bi.select_patch_editor",
el: {
type: "bi.search_editor",
watermark: BI.i18nText("BI-Basic_Search_And_Patch_Paste"),
},
ref: function (ref) {
self.editor = ref;
},
height: o.searcherHeight,
},
isAutoSearch: false,
isAutoSync: false,
onSearch: function (op, callback) {
@ -104,40 +102,16 @@ BI.SingleSelectInsertList = BI.inherit(BI.Single, {
eventName: BI.Searcher.EVENT_PAUSE,
action: function () {
var keyword = this.getKeyword();
if (this.hasMatched()) {
self.storeValue = keyword;
self._showAdapter();
self.adapter.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.adapter.populate();
self._setStartValue();
self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE);
} else {
self._showAdapter();
}
self.storeValue = keyword;
self._showAdapter();
self.adapter.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.adapter.populate();
self._setStartValue();
self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE);
}
}, {
eventName: BI.Searcher.EVENT_SEARCHING,
action: function () {
var keywords = this.getKeyword();
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
self.adapter.setValue(self.storeValue);
assertShowValue();
self.adapter.populate();
self._setStartValue();
} else {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
});
}
}
}, {
eventName: BI.Searcher.EVENT_CHANGE,
action: function () {
@ -191,31 +165,6 @@ BI.SingleSelectInsertList = BI.inherit(BI.Single, {
return BI.makeObject(values || []);
},
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.SingleSelectInsertList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
function digest (items) {
var selectedMap = self._makeMap(items);
BI.each(keywords, function (i, val) {
if (BI.isNotNull(selectedMap[val])) {
BI.pushDistinct(self.storeValue.value, val)
}
});
callback();
}
},
_setStartValue: function (value) {
this._startValue = value;
this.adapter.setStartValue(value);

40
src/widget/singleselect/trigger/editor.singleselect.js

@ -10,7 +10,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-editor",
el: {},
text: BI.i18nText("BI-Basic_Please_Select")
text: BI.i18nText("BI-Basic_Please_Select"),
watermark: BI.i18nText("BI-Basic_Search"),
});
},
@ -18,10 +19,10 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
BI.SingleSelectEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: "bi.state_editor",
type: "bi.select_patch_editor",
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
watermark: o.watermark,
allowBlank: true,
value: o.value,
defaultText: o.text,
@ -31,10 +32,6 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.StateEditor.EVENT_PAUSE, function () {
self.fireEvent(BI.SingleSelectEditor.EVENT_PAUSE);
});
this.editor.on(BI.StateEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.SingleSelectEditor.EVENT_FOCUS);
});
@ -60,23 +57,31 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
},
getValue: function () {
var v = this.editor.getState();
if (BI.isArray(v) && v.length > 0) {
return v[v.length - 1];
}
return "";
return this.editor.getValue();
},
getKeywords: function () {
var val = this.editor.getLastChangedValue();
var keywords = val.match(/[\S]+/g);
if (BI.isEndWithBlank(val)) {
return keywords.concat([" "]);
var val = this.editor.getValue();
var keywords = val.split(/\u200b\s\u200b/);
if (BI.isEmptyString(keywords[keywords.length - 1])) {
keywords = keywords.slice(0, keywords.length - 1);
}
if (/\u200b\s\u200b$/.test(val)) {
return keywords.concat([BI.BlankSplitChar]);
}
return keywords;
},
getKeyword: function () {
var val = this.editor.getValue();
var keywords = val.split(/\u200b\s\u200b/);
if (BI.isEmptyString(keywords[keywords.length - 1])) {
keywords = keywords.slice(0, keywords.length - 1);
}
return BI.isEmptyArray(keywords) ? "" : keywords[keywords.length - 1];
},
populate: function (items) {
}
@ -84,5 +89,4 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
BI.SingleSelectEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.SingleSelectEditor.EVENT_BLUR = "EVENT_BLUR";
BI.SingleSelectEditor.EVENT_PAUSE = "EVENT_PAUSE";
BI.shortcut("bi.single_select_editor", BI.SingleSelectEditor);

6
src/widget/singleselect/trigger/searcher.singleselect.js

@ -25,6 +25,7 @@ BI.SingleSelectSearcher = BI.inherit(BI.Widget, {
this.editor = BI.createWidget(o.el, {
type: "bi.single_select_editor",
height: o.height,
watermark: o.watermark,
text: o.text,
listeners: [{
eventName: BI.SingleSelectEditor.EVENT_FOCUS,
@ -41,7 +42,6 @@ BI.SingleSelectSearcher = BI.inherit(BI.Widget, {
this.searcher = BI.createWidget({
type: "bi.searcher",
allowSearchBlank: false,
element: this,
height: o.height,
isAutoSearch: false,
@ -95,10 +95,6 @@ BI.SingleSelectSearcher = BI.inherit(BI.Widget, {
}
},
getMatchedItemValue: function() {
return this.searcher.getView().getMatchedItemValue();
},
adjustView: function () {
this.searcher.adjustView();
},

2
typescript/base/combination/tab.ts

@ -28,4 +28,6 @@ export declare class Tab extends Widget {
getTab<T>(v: string | number): T;
populate(): void;
isCardExisted(cardName: string): boolean;
}

3
typescript/base/single/button/buttons/button.text.ts

@ -1,9 +1,12 @@
import { Label } from "typescript";
import { BasicButton } from "../button.basic";
export declare class TextButton extends BasicButton {
static xtype: string;
static EVENT_CHANGE: string;
props: Label['props'] & BasicButton['props'];
setStyle(style: any): void;
doRedMark(...args: any[]): void;

18
typescript/base/single/button/buttons/button.ts

@ -3,12 +3,26 @@ import { BasicButton } from "../button.basic";
export declare class Button extends BasicButton {
static xtype: string;
static EVENT_CHANGE: string;
props: {
minWidth?: number;
readonly?: boolean;
iconCls?: string;
level?: 'common' | 'success' | 'warning' |'ignore',
block?: boolean; // 是否块状显示,即不显示边框,没有最小宽度的限制
clear?: boolean; // 是否去掉边框和背景
ghost?: boolean; // 是否幽灵显示, 即正常状态无背景
textAlign?: 'center' | 'left' | 'right';
whiteSpace?: 'nowrap' | 'normal',
textWidth?: number | null,
textHeight?: number | null,
} & BasicButton['props'];
text: Label;
icon?: IconLabel;
doRedMark(...args: any[]): void;
unRedMark(...args: any[]): void;

14
typescript/case/button/item.singleselect.radio.ts

@ -4,6 +4,20 @@ export declare class SingleSelectRadioItem extends BasicButton {
static xtype: string;
static EVENT_CHANGE: string;
props: {
iconWrapperWidth: number;
logic: {
dynamic: boolean;
};
textHgap: number;
textLgap: number;
textRgap: number;
text: string;
keyword: string;
py: string;
value: any;
} & BasicButton['props']
doRedMark(...args: any[]): void;
unRedMark(...args: any[]): void;

1
typescript/core/var.ts

@ -129,4 +129,5 @@ export interface _var {
Stretch: string;
},
StartOfWeek: number;
BlankSplitChar: string;
}

12
typescript/shims-tsx.ts

@ -11,6 +11,8 @@ interface UIProps {
lgap: number;
tgap: number;
bgap: number;
vgap: number;
hgap: number;
}
interface ElementClassProps<T> extends UIProps {
@ -33,6 +35,10 @@ interface ElementClassProps<T> extends UIProps {
};
tagName: string;
element: any;
$testId: string;
$point: any;
$value: any;
$scope: () => any;
beforeRender(callback: () => void): void;
beforeInit(callback: () => void): void;
@ -45,13 +51,13 @@ declare namespace JSX {
[elemName: string]: Partial<UIProps>;
}
type ElementAttributesProperty = {
interface ElementAttributesProperty {
/**
* specify the property name to use
*/
__props: any;
};
__props: any,
}
interface IntrinsicClassAttributes<T> extends Partial<ElementClassProps<T>> {}
}

6
typescript/widget/multiselect/multiselect.combo.ts

@ -24,7 +24,7 @@ export declare class MultiSelectCombo extends Single {
_joinKeywords(keywords: string[], callback: Function): void;
_joinAll(res: {
type: string;
type: number;
value: string[];
assist: string[];
}, callback: Function): void;
@ -42,13 +42,13 @@ export declare class MultiSelectCombo extends Single {
hideView(): void;
setValue(value: {
type: string;
type: number;
value: string[];
assist: string[];
}): void;
getValue(): {
type: string;
type: number;
value: string[];
assist: string[];
};

Loading…
Cancel
Save