Browse Source

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

es6
dailer 3 years ago
parent
commit
b2b49ff603
  1. 2
      .gitignore
  2. BIN
      dist/font/iconfont.eot
  3. 12
      dist/font/iconfont.svg
  4. BIN
      dist/font/iconfont.ttf
  5. BIN
      dist/font/iconfont.woff
  6. BIN
      dist/font/iconfont.woff2
  7. 6
      package.json
  8. 2
      src/base/combination/bubble.js
  9. 32
      src/base/combination/combo.js
  10. 68
      src/base/layer/layer.popup.js
  11. 2
      src/base/single/button/button.basic.js
  12. 75
      src/base/single/button/listitem/blankiconicontextitem.js
  13. 81
      src/base/single/button/listitem/blankicontexticonitem.js
  14. 62
      src/base/single/button/listitem/blankicontextitem.js
  15. 76
      src/base/single/button/listitem/icontexticonitem.js
  16. 55
      src/base/single/button/listitem/icontextitem.js
  17. 56
      src/base/single/button/listitem/texticonitem.js
  18. 76
      src/base/single/button/node/icontexticonnode.js
  19. 54
      src/base/single/button/node/icontextnode.js
  20. 54
      src/base/single/button/node/texticonnode.js
  21. 54
      src/case/ztree/0.treeview.js
  22. 20
      src/case/ztree/1.asynctree.js
  23. 2
      src/case/ztree/jquery.ztree.excheck-3.5.js
  24. 12
      src/component/treevaluechooser/abstract.treevaluechooser.js
  25. 9
      src/component/treevaluechooser/abstract.treevaluechooser.list.js
  26. 2
      src/less/base/colorchooser/colorchooser.trigger.less
  27. 61
      src/less/base/combo/combo.bubble.less
  28. 4
      src/less/base/single/input/checkbox.less
  29. 4
      src/less/base/single/input/radio.less
  30. 1
      src/less/base/single/label.less
  31. 1
      src/less/base/single/text.less
  32. 25
      src/less/base/tree/ztree.less
  33. 18
      src/less/base/view/popupview.less
  34. 4
      src/widget/multilayerselecttree/multilayerselecttree.combo.js
  35. 4
      src/widget/multilayersingletree/multilayersingletree.combo.js
  36. 13
      src/widget/multitree/trigger/searcher.list.multi.tree.js
  37. 3
      typescript/index.ts
  38. 9
      typescript/widget/downlist/popup.downlist.ts
  39. 2
      typescript/widget/multilayerselecttree/multilayerselecttree.combo.ts
  40. 2
      typescript/widget/multilayersingletree/multilayersingletree.combo.ts
  41. 11438
      yarn.lock

2
.gitignore vendored

@ -8,4 +8,4 @@ unit.test.statistic.json
package-lock.json
yarn.lock
*.tgz
dist/
dist/

BIN
dist/font/iconfont.eot vendored

Binary file not shown.

12
dist/font/iconfont.svg vendored

@ -14,6 +14,18 @@
/>
<missing-glyph />
<glyph glyph-name="niantie" unicode="&#59540;" d="M128 608a32 32 0 0 0 32-32v-512a32 32 0 0 1 32-32h512a32 32 0 1 0 0-64H192A96 96 0 0 0 96 64V576a32 32 0 0 0 32 32z m704 192A96 96 0 0 0 928 704v-512a96 96 0 0 0-96-96H320A96 96 0 0 0 224 192V704A96 96 0 0 0 320 800z m0-64H320a32 32 0 0 1-32-32v-512a32 32 0 0 1 32-32h512a32 32 0 0 1 32 32V704a32 32 0 0 1-32 32z m-256-64c17.664 0 32-16.384 32-36.608L607.936 480h155.456c20.224 0 36.608-14.336 36.608-32s-16.384-32-36.608-32H607.936v-155.52c0-20.16-14.272-36.48-32-36.48-17.6 0-32 16.32-32 36.48V416H388.48c-20.16 0-36.48 14.336-36.48 32s16.32 32 36.48 32H544V635.392c0 20.224 14.4 36.608 32 36.608z" horiz-adv-x="1024" />
<glyph glyph-name="kaiqishoushi" unicode="&#59538;" d="M878.592-5.312l25.088 450.88a96.192 96.192 0 0 1-90.752 101.76L587.264 559.36V736a128 128 0 0 1-128 128l-9.536-0.32A128 128 0 0 1 331.328 736l-0.064-336.832-7.232 4.928a128 128 0 0 1-172.864-181.888l183.552-262.144 6.272-8.32 6.976-7.68 4.864-4.544-1.92 2.304c18.048-23.68 46.08-37.824 76.416-37.824h355.456a96 96 0 0 1 95.808 90.688z m-38.784 455.104l-25.088-451.584a32 32 0 0 0-32-30.208H427.392a31.808 31.808 0 0 0-21.504 8.32l-8.448 9.088a62.848 62.848 0 0 0-10.24 11.392L203.52 258.944a64 64 0 0 0 104.832 73.408l86.848-124.16V736a64 64 0 1 0 128 0v-176.64a64 64 0 0 1 60.608-63.936l225.664-11.968a32 32 0 0 0 30.272-33.664z" horiz-adv-x="1024" />
<glyph glyph-name="jinyongshoushi" unicode="&#59539;" d="M341.12-60.16l-4.48 4.224a120.96 120.96 0 0 0-3.52 3.84l-3.392 3.84-6.336 8.32-183.552 262.144a128 128 0 0 0 172.928 181.888l7.168-4.928L320 736A128 128 0 0 0 438.4 863.68L448 864a128 128 0 0 0 128-128L575.936 559.36l225.664-12.096a96 96 0 0 0 90.88-91.712l-0.064-9.28-3.328-60.672c-1.216-21.76-26.368-34.112-46.144-24.96a29.76 29.76 0 0 0-17.856 28.16l3.392 60.8a32 32 0 0 1-30.272 33.792l-225.664 12.032A64 64 0 0 0 512 559.36V736a64 64 0 1 1-128 0v-527.872l-86.848 124.16a64 64 0 1 1-104.896-73.344l183.552-262.144a62.72 62.72 0 0 1 10.24-11.392l8.448-9.152c5.824-5.248 13.44-8.256 21.504-8.256l109.184-0.064c6.976 0 13.504-3.2 18.112-8.448 15.616-17.856 3.648-55.552-20.096-55.552L416-96c-29.44 0-56.768 13.44-74.88 35.84zM928 128a192 192 0 1 1-384 0 192 192 0 0 1 384 0z m-226.24-123.392l123.968 214.72a128 128 0 0 0-123.968-214.656zM608 128a128 128 0 0 0 162.24 123.392l-123.968-214.72A127.616 127.616 0 0 0 608 128z" horiz-adv-x="1024" />
<glyph glyph-name="yunhangjiedian" unicode="&#59535;" d="M512 800a416 416 0 1 0 0-832 416 416 0 0 0 0 832z m0-64a352 352 0 1 1 0-704 352 352 0 0 1 0 704zM434.24 537.408c5.76 0 11.456-1.664 16.192-4.864l189.696-126.528a29.184 29.184 0 0 0 0-48.576l-189.696-126.528a29.184 29.184 0 0 0-45.376 24.32V508.16c0 16.128 13.12 29.184 29.184 29.184z" horiz-adv-x="1024" />
<glyph glyph-name="quanxuan" unicode="&#59537;" d="M672 672a128 128 0 0 0 128-128v-448a128 128 0 0 0-128-128h-448a128 128 0 0 0-128 128v448a128 128 0 0 0 128 128h448z m0-64h-448a64 64 0 0 1-63.552-56.512L160 544v-448a64 64 0 0 1 56.512-63.552l7.488-0.448h448a64 64 0 0 1 63.552 56.512l0.448 7.488v448a64 64 0 0 1-56.512 63.552L672 608z m96 192a160 160 0 0 0 159.68-149.504L928 640v-512a32 32 0 0 0-63.488-5.76L864 128V640a96 96 0 0 1-86.784 95.552L768 736H320a32 32 0 0 0-5.76 63.488L320 800h448z m-101.952-319.424a32 32 0 0 0 5.504-40.64l-3.52-4.544-225.088-245.824c-0.32-0.32-0.768-0.64-1.344-1.28a51.2 51.2 0 0 0-67.328-1.088l-4.992 4.864-119.04 132.032a32 32 0 0 0 43.264 46.784l4.224-3.84 109.632-121.664L620.8 478.592a32 32 0 0 0 45.248 1.984z" horiz-adv-x="1024" />
<glyph glyph-name="yunhangjiedianjixiayou" unicode="&#59536;" d="M800 224a128 128 0 1 0-123.968-160.064L448 64v117.12l64 37.44V128h164.032a128 128 0 0 0 123.968 96z m0-64a64 64 0 1 1 0-128 64 64 0 0 1 0 128zM391.808 554.368c3.968 0 7.872-1.088 11.328-3.072l241.984-141.76a22.528 22.528 0 0 0 0-38.848L403.2 228.928a22.528 22.528 0 0 0-33.92 19.392V531.84c0 12.416 10.048 22.528 22.528 22.528zM800 800a128 128 0 1 0-123.968-160.064L512 640v-78.336l-64 37.504V640l-100.032-0.064a128 128 0 1 0 0 64.064h328.064A128 128 0 0 0 800 800z m-576-64a64 64 0 1 1 0-128 64 64 0 0 1 0 128z m576 0a64 64 0 1 1 0-128 64 64 0 0 1 0 128z" horiz-adv-x="1024" />
<glyph glyph-name="biduishanchu" unicode="&#59534;" d="M625.7664 810.666667V725.333333c0-123.016533 97.621333-223.232 219.579733-227.4304l7.9872-0.136533 113.7664 0.034133v-512c0-31.4368-25.463467-56.900267-56.866133-56.900266H113.7664c-31.402667 0-56.866133 25.463467-56.866133 56.866133v768c0 31.402667 25.463467 56.900267 56.866133 56.900267h512zM341.333333 327.099733H227.566933a28.433067 28.433067 0 0 1-28.228266-24.849066l-0.238934-3.584v-227.566934c0-14.506667 10.8544-26.453333 24.917334-28.228266l3.549866-0.2048H341.333333a28.433067 28.433067 0 0 1 28.228267 24.8832l0.2048 3.549866V298.666667a28.433067 28.433067 0 0 1-28.433067 28.433066z m227.566934 170.666667h-113.800534a28.433067 28.433067 0 0 1-28.228266-24.849067l-0.2048-3.584v-398.2336c0-14.506667 10.8544-26.453333 24.8832-28.228266l3.549866-0.2048h113.800534a28.433067 28.433067 0 0 1 28.228266 24.8832l0.2048 3.549866V469.333333a28.433067 28.433067 0 0 1-28.433066 28.433067z m227.5328-170.666667H682.666667a28.433067 28.433067 0 0 1-28.228267-24.849066l-0.2048-3.584v-227.566934c0-14.506667 10.8544-26.453333 24.849067-28.228266L682.666667 42.666667h113.7664a28.433067 28.433067 0 0 1 28.228266 24.8832l0.238934 3.549866V298.666667a28.433067 28.433067 0 0 1-28.4672 28.433066zM984.6784 865.3824a28.433067 28.433067 0 0 0 0-40.2432l-91.136-91.101867 91.136-91.136a28.433067 28.433067 0 0 0-40.2432-40.209066L853.333333 693.828267l-91.136-91.136a28.433067 28.433067 0 1 0-40.209066 40.2432l91.136 91.101866-91.136 91.136A28.433067 28.433067 0 0 0 762.231467 865.348267L853.333333 774.2464l91.136 91.136a28.433067 28.433067 0 0 0 40.209067 0z" horiz-adv-x="1024" />
<glyph glyph-name="kaifapingtai" unicode="&#59533;" d="M736 0a32 32 0 1 0 0-64h-448a32 32 0 1 0 0 64h448zM832 832a128 128 0 0 0 128-128v-512a128 128 0 0 0-128-128H192a128 128 0 0 0-128 128V704a128 128 0 0 0 128 128h640z m0-64H192a64 64 0 0 1-63.552-56.512L128 704v-512a64 64 0 0 1 56.512-63.552L192 128h640a64 64 0 0 1 63.552 56.512L896 192V704a64 64 0 0 1-56.512 63.552L832 768zM382.4 611.456a32 32 0 0 0 3.712-40.832l-3.712-4.48L269.248 453.12 382.4 339.84a32 32 0 0 0 3.712-40.832l-3.712-4.48a32 32 0 0 0-40.832-3.648l-4.48 3.712-126.72 126.72a44.8 44.8 0 0 0-3.968 58.752l4.032 4.608 126.72 126.72a32 32 0 0 0 45.248 0z m274.752 0a32 32 0 0 0 45.248 0l126.72-126.72 3.968-4.608a44.8 44.8 0 0 0-3.968-58.752l-126.72-126.72-4.48-3.712a32 32 0 0 0-40.768 3.712l-3.712 4.48a32 32 0 0 0 3.712 40.768l113.152 113.152-113.152 113.088-3.712 4.48a32 32 0 0 0 3.712 40.832zM544 64v-64h-64v64h64z m33.664 578.368a32 32 0 0 0 19.84-40.64L493.312 299.136A32 32 0 1 0 432.832 320L536.96 622.528a32 32 0 0 0 40.64 19.84z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 462 KiB

After

Width:  |  Height:  |  Size: 467 KiB

BIN
dist/font/iconfont.ttf vendored

Binary file not shown.

BIN
dist/font/iconfont.woff vendored

Binary file not shown.

BIN
dist/font/iconfont.woff2 vendored

Binary file not shown.

6
package.json

@ -1,13 +1,13 @@
{
"name": "fineui",
"version": "2.0.20220210173316",
"version": "2.0.20220217101535",
"description": "fineui",
"main": "dist/fineui.min.js",
"types": "dist/lib/index.d.ts",
"dependencies": {},
"devDependencies": {
"@babel/core": "^7.17.4",
"@babel/polyfill": "7.6.0",
"@fui/babel-preset-fineui": "^1.0.0",
"@fui/babel-preset-fineui": "^2.0.0",
"@fui/eslint-plugin": "1.0.11",
"@types/node": "15.6.1",
"autoprefixer": "9.6.1",

2
src/base/combination/bubble.js

@ -332,7 +332,7 @@
name: "offset",
options: {
offset: function () {
return [o.adjustXOffset, (o.showArrow ? 9 : 0) + (o.adjustYOffset || o.adjustLength)];
return [o.adjustXOffset, (o.showArrow ? 9 : 0) + (o.adjustYOffset + o.adjustLength)];
}
}
}];

32
src/base/combination/combo.js

@ -213,64 +213,64 @@
switch (o.direction) {
case "bottom":
case "bottom,right":
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, (o.adjustYOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight, ["bottom", "top", "right", "left"], o.offsetStyle);
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, (o.adjustYOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight, ["bottom", "top", "right", "left"], o.offsetStyle);
break;
case "top":
case "top,right":
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, (o.adjustYOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight, ["top", "bottom", "right", "left"], o.offsetStyle);
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, (o.adjustYOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight, ["top", "bottom", "right", "left"], o.offsetStyle);
break;
case "left":
case "left,bottom":
p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "bottom", "top"], o.offsetStyle);
p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "bottom", "top"], o.offsetStyle);
break;
case "right":
case "right,bottom":
p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "bottom", "top"], o.offsetStyle);
p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "bottom", "top"], o.offsetStyle);
break;
case "top,left":
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, (o.adjustYOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight, ["top", "bottom", "left", "right"], o.offsetStyle);
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, (o.adjustYOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight, ["top", "bottom", "left", "right"], o.offsetStyle);
break;
case "bottom,left":
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, (o.adjustYOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight, ["bottom", "top", "left", "right"], o.offsetStyle);
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, (o.adjustYOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight, ["bottom", "top", "left", "right"], o.offsetStyle);
break;
case "left,top":
p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "top", "bottom"], o.offsetStyle);
p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "top", "bottom"], o.offsetStyle);
break;
case "right,top":
p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "top", "bottom"], o.offsetStyle);
p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "top", "bottom"], o.offsetStyle);
break;
case "right,innerRight":
p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "innerRight", "innerLeft", "bottom", "top"], o.offsetStyle);
p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "innerRight", "innerLeft", "bottom", "top"], o.offsetStyle);
break;
case "right,innerLeft":
p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "innerLeft", "innerRight", "bottom", "top"], o.offsetStyle);
p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "innerLeft", "innerRight", "bottom", "top"], o.offsetStyle);
break;
case "innerRight":
p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["innerRight", "innerLeft", "right", "left", "bottom", "top"], o.offsetStyle);
p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["innerRight", "innerLeft", "right", "left", "bottom", "top"], o.offsetStyle);
break;
case "innerLeft":
p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["innerLeft", "innerRight", "left", "right", "bottom", "top"], o.offsetStyle);
p = BI.DOM.getComboPosition(combo, this.popupView, (o.adjustXOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.adjustYOffset, o.isNeedAdjustHeight, ["innerLeft", "innerRight", "left", "right", "bottom", "top"], o.offsetStyle);
break;
case "top,custom":
case "custom,top":
p = BI.DOM.getTopAdaptPosition(combo, this.popupView, (o.adjustYOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight);
p = BI.DOM.getTopAdaptPosition(combo, this.popupView, (o.adjustYOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight);
p.dir = "top";
break;
case "custom,bottom":
case "bottom,custom":
p = BI.DOM.getBottomAdaptPosition(combo, this.popupView, (o.adjustYOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight);
p = BI.DOM.getBottomAdaptPosition(combo, this.popupView, (o.adjustYOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0), o.isNeedAdjustHeight);
p.dir = "bottom";
break;
case "left,custom":
case "custom,left":
p = BI.DOM.getLeftAdaptPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0));
p = BI.DOM.getLeftAdaptPosition(combo, this.popupView, (o.adjustXOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0));
delete p.top;
delete p.adaptHeight;
p.dir = "left";
break;
case "custom,right":
case "right,custom":
p = BI.DOM.getRightAdaptPosition(combo, this.popupView, (o.adjustXOffset || o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0));
p = BI.DOM.getRightAdaptPosition(combo, this.popupView, (o.adjustXOffset + o.adjustLength) + (o.showArrow ? this._const.TRIANGLE_LENGTH : 0));
delete p.top;
delete p.adaptHeight;
p.dir = "right";

68
src/base/layer/layer.popup.js

@ -104,6 +104,12 @@ BI.PopupView = BI.inherit(BI.Widget, {
cls: "bubble-arrow"
}]
});
this.arrowWrapper = BI.createWidget({
type: "bi.absolute",
items: [{
el: this.arrow,
}]
})
// 因为三角符号的原因位置变大了,需要占位
this.placeholder = BI.createWidget({
type: "bi.layout"
@ -112,7 +118,9 @@ BI.PopupView = BI.inherit(BI.Widget, {
type: "bi.absolute",
element: this,
items: [{
el: this.arrow
el: this.arrowWrapper,
left: 0,
top: 0,
}, {
el: this.placeholder
}]
@ -174,8 +182,9 @@ BI.PopupView = BI.inherit(BI.Widget, {
},
setDirection: function (direction, position) {
if (this.options.showArrow) {
var style, placeholderStyle;
var o = this.options;
if (o.showArrow) {
var style, wrapperStyle, placeholderStyle;
var adjustXOffset = position.adjustXOffset || 0;
var adjustYOffset = position.adjustYOffset || 0;
var bodyBounds = BI.Widget._renderEngine.createElement("body").bounds();
@ -204,6 +213,12 @@ BI.PopupView = BI.inherit(BI.Widget, {
// 5表示留出一定的空间
left: BI.clamp(((middle ? popupWidth : position.width) - adjustXOffset) / 2 - 6, minLeft, maxLeft)
};
wrapperStyle = {
top: o.tgap + o.vgap,
left: 0,
right: "",
bottom: "",
};
placeholderStyle = {
left: 0,
right: 0,
@ -217,6 +232,12 @@ BI.PopupView = BI.inherit(BI.Widget, {
style = {
right: BI.clamp(((middle ? popupWidth : position.width) + adjustXOffset) / 2 - 6, minRight, maxRight)
};
wrapperStyle = {
bottom: o.bgap + o.vgap,
left: "",
right: 0,
top: "",
};
placeholderStyle = {
left: 0,
right: 0,
@ -231,12 +252,18 @@ BI.PopupView = BI.inherit(BI.Widget, {
style = {
left: BI.clamp(((middle ? popupWidth : position.width) - adjustXOffset) / 2 - 6, minLeft, maxLeft)
};
wrapperStyle = {
bottom: o.bgap + o.vgap,
left: 0,
right: "",
top: "",
};
placeholderStyle = {
left: 0,
right: 0,
height: this._const.TRIANGLE_LENGTH,
top: "",
bottom: -this._const.TRIANGLE_LENGTH
bottom: -this._const.TRIANGLE_LENGTH,
};
break;
case "top,left":
@ -244,12 +271,18 @@ BI.PopupView = BI.inherit(BI.Widget, {
style = {
right: BI.clamp(((middle ? popupWidth : position.width) + adjustXOffset) / 2 - 6, minRight, maxRight)
};
wrapperStyle = {
bottom: o.bgap + o.vgap,
right: 0,
left: "",
top: "",
};
placeholderStyle = {
left: 0,
right: 0,
height: this._const.TRIANGLE_LENGTH,
top: "",
bottom: -this._const.TRIANGLE_LENGTH
bottom: -this._const.TRIANGLE_LENGTH,
};
break;
case "left":
@ -258,6 +291,12 @@ BI.PopupView = BI.inherit(BI.Widget, {
style = {
top: BI.clamp(((middle ? popupHeight : position.height) - adjustYOffset) / 2 - 6, minTop, maxTop)
};
wrapperStyle = {
right: o.rgap + o.hgap,
top: 0,
bottom: "",
left: "",
};
placeholderStyle = {
top: 0,
bottom: 0,
@ -271,6 +310,12 @@ BI.PopupView = BI.inherit(BI.Widget, {
style = {
bottom: BI.clamp(((middle ? popupHeight : position.height) + adjustYOffset) / 2 - 6, minBottom, maxBottom)
};
wrapperStyle = {
right: o.rgap + o.hgap,
bottom: 0,
top: "",
left: "",
};
placeholderStyle = {
top: 0,
bottom: 0,
@ -285,6 +330,12 @@ BI.PopupView = BI.inherit(BI.Widget, {
style = {
top: BI.clamp(((middle ? popupHeight : position.height) - adjustYOffset) / 2 - 6, minTop, maxTop)
};
wrapperStyle = {
left: o.lgap + o.hgap,
top: 0,
bottom: "",
right: "",
};
placeholderStyle = {
top: 0,
bottom: 0,
@ -298,6 +349,12 @@ BI.PopupView = BI.inherit(BI.Widget, {
style = {
bottom: BI.clamp(((middle ? popupHeight : position.height) + adjustYOffset) / 2 - 6, minBottom, maxBottom)
};
wrapperStyle = {
left: o.lgap + o.hgap,
bottom: 0,
top: "",
right: "",
};
placeholderStyle = {
top: 0,
bottom: 0,
@ -317,6 +374,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
}
this.element.removeClass("left").removeClass("right").removeClass("top").removeClass("bottom").addClass(direction);
this.arrow.element.css(style);
this.arrowWrapper.element.css(wrapperStyle);
this.placeholder.element.css(placeholderStyle);
}
},

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

@ -205,7 +205,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
}
hand.click(clk);
// enter键等同于点击
hand.keyup(function (e) {
o.attributes && o.attributes.zIndex >= 0 && hand.keyup(function (e) {
if (e.keyCode === BI.KeyCode.ENTER) {
clk(e);
}

75
src/base/single/button/listitem/blankiconicontextitem.js

@ -27,45 +27,44 @@ BI.BlankIconIconTextItem = BI.inherit(BI.BasicButton, {
},
render: function () {
var o = this.options, c = this._const;
var blank = BI.createWidget({
type: "bi.layout",
width: o.blankWidth,
height: o.height
});
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
});
this.icon1 = BI.createWidget({
type: "bi.icon_button",
cls: o.iconCls1,
forceNotSelected: true,
width: o.height,
height: o.height
});
this.icon2 = BI.createWidget({
type: "bi.icon_button",
cls: o.iconCls2,
forceNotSelected: true,
width: o.height,
height: o.height
});
var self = this, o = this.options;
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", blank, this.icon1, this.icon2, this.text)
}))));
return {
type: "bi.vertical_adapt",
columnSize: [o.blankWidth, o.leftIconWrapperWidth || o.height, o.rightIconWrapperWidth || o.height, "fill"],
items: [{
type: "bi.layout",
width: o.blankWidth
}, {
type: "bi.icon_label",
cls: o.iconCls1,
width: o.leftIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}, {
type: "bi.icon_label",
cls: o.iconCls2,
width: o.rightIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}, {
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
}]
};
},
doClick: function () {

81
src/base/single/button/listitem/blankicontexticonitem.js

@ -28,57 +28,44 @@ BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
});
var self = this, o = this.options;
var icon1 = BI.createWidget({
type: "bi.icon_label",
cls: o.iconCls1,
width: o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
BI.createWidget({
type: "bi.absolute",
element: this,
return {
type: "bi.vertical_adapt",
columnSize: [o.blankWidth, o.leftIconWrapperWidth || o.height, "fill", o.rightIconWrapperWidth || o.height],
items: [{
el: {
type: "bi.icon_label",
cls: o.iconCls2,
width: o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
},
top: 0,
bottom: 0,
right: 0
}]
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", {
type: "bi.layout",
width: o.blankWidth
}, icon1, this.text, {
type: "bi.layout",
width: o.height
})
}))));
}, {
type: "bi.icon_label",
cls: o.iconCls1,
width: o.leftIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}, {
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
}, {
type: "bi.icon_label",
cls: o.iconCls2,
width: o.rightIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}]
};
},
doClick: function () {

62
src/base/single/button/listitem/blankicontextitem.js

@ -26,38 +26,38 @@ BI.BlankIconTextItem = BI.inherit(BI.BasicButton, {
},
render: function () {
var o = this.options, c = this._const;
var blank = BI.createWidget({
type: "bi.layout",
width: o.blankWidth
});
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
});
this.icon = BI.createWidget({
type: "bi.icon_label",
cls: o.iconCls,
width: o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
var self = this, o = this.options;
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", blank, this.icon, this.text)
}))));
return {
type: "bi.vertical_adapt",
columnSize: [o.blankWidth, "fill", o.iconWrapperWidth || o.height],
items: [{
type: "bi.layout",
width: o.blankWidth
}, {
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
}, {
type: "bi.icon_label",
cls: o.iconCls,
width: o.iconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}]
};
},
doClick: function () {

76
src/base/single/button/listitem/icontexticonitem.js

@ -27,55 +27,41 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
});
var self = this, o = this.options;
var icon1 = BI.createWidget({
type: "bi.icon_label",
cls: o.iconCls1,
width: o.leftIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
var blank = BI.createWidget({
type: "bi.layout",
width: o.height
});
BI.createWidget({
type: "bi.absolute",
element: this,
return {
type: "bi.vertical_adapt",
columnSize: [o.leftIconWrapperWidth || o.height, "fill", o.rightIconWrapperWidth || o.height],
items: [{
el: {
type: "bi.icon_label",
cls: o.iconCls2,
width: o.rightIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
type: "bi.icon_label",
cls: o.iconCls1,
width: o.leftIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}, {
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
top: 0,
bottom: 0,
right: 0
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
}, {
type: "bi.icon_label",
cls: o.iconCls2,
width: o.rightIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}]
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", icon1, this.text, blank)
}))));
};
},
doClick: function () {

55
src/base/single/button/listitem/icontextitem.js

@ -27,34 +27,35 @@ BI.IconTextItem = BI.inherit(BI.BasicButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
});
this.icon = BI.createWidget({
type: "bi.icon_label",
cls: o.iconCls,
width: o.iconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
var self = this, o = this.options;
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.icon, this.text)
}))));
return {
type: "bi.vertical_adapt",
columnSize: [o.iconWrapperWidth || o.height, "fill"],
items: [{
type: "bi.icon_label",
cls: o.iconCls,
width: o.iconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}, {
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
}]
};
},
doClick: function () {

56
src/base/single/button/listitem/texticonitem.js

@ -15,6 +15,7 @@ BI.TextIconItem = BI.inherit(BI.BasicButton, {
logic: {
dynamic: false
},
iconWrapperWidth: null,
iconHeight: null,
iconWidth: null,
iconCls: "",
@ -26,34 +27,35 @@ BI.TextIconItem = BI.inherit(BI.BasicButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
});
this.icon = BI.createWidget({
type: "bi.icon_label",
cls: o.iconCls,
width: o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
var self = this, o = this.options;
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", this.text, this.icon)
}))));
return {
type: "bi.vertical_adapt",
columnSize: ["fill", o.iconWrapperWidth || o.height],
items: [{
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
}, {
type: "bi.icon_label",
cls: o.iconCls,
width: o.iconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}]
};
},
doClick: function () {

76
src/base/single/button/node/icontexticonnode.js

@ -25,55 +25,41 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
});
var self = this, o = this.options;
var icon1 = BI.createWidget({
type: "bi.icon_label",
cls: o.iconCls1,
width: o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
var blank = BI.createWidget({
type: "bi.layout",
width: o.height,
height: o.height
});
BI.createWidget({
type: "bi.absolute",
element: this,
return {
type: "bi.vertical_adapt",
columnSize: [o.leftIconWrapperWidth || o.height, "fill", o.rightIconWrapperWidth || o.height],
items: [{
el: {
type: "bi.icon_label",
cls: o.iconCls2,
width: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
type: "bi.icon_label",
cls: o.iconCls1,
width: o.leftIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}, {
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
top: 0,
bottom: 0,
right: 0
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
}, {
type: "bi.icon_label",
cls: o.iconCls2,
width: o.rightIconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}]
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", icon1, this.text, blank)
}))));
};
},
doClick: function () {

54
src/base/single/button/node/icontextnode.js

@ -24,33 +24,35 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
});
this.icon = BI.createWidget({
type: "bi.icon_label",
width: o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
var self = this, o = this.options;
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", this.icon, this.text)
}))));
return {
type: "bi.vertical_adapt",
columnSize: [o.iconWrapperWidth || o.height, "fill"],
items: [{
type: "bi.icon_label",
cls: o.iconCls,
width: o.iconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}, {
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
}]
};
},
doClick: function () {

54
src/base/single/button/node/texticonnode.js

@ -23,33 +23,35 @@ BI.TextIconNode = BI.inherit(BI.NodeButton, {
},
render: function () {
var o = this.options, c = this._const;
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
});
this.icon = BI.createWidget({
type: "bi.icon_label",
width: o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
var self = this, o = this.options;
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", this.text, this.icon)
}))));
return {
type: "bi.vertical_adapt",
columnSize: ["fill", o.iconWrapperWidth || o.height],
items: [{
type: "bi.label",
ref: function (_ref) {
self.text = _ref;
},
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
}, {
type: "bi.icon_label",
cls: o.iconCls,
width: o.iconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
}]
};
},
doClick: function () {

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

@ -140,7 +140,9 @@ BI.TreeView = BI.inherit(BI.Pane, {
}
return true;
}
BI.Msg.toast("Please Wait。", "warning"); // 不展开节点,也不触发onExpand事件
BI.Msg.toast("Please Wait。", {
level: "warning"
}); // 不展开节点,也不触发onExpand事件
return false;
}
@ -184,6 +186,9 @@ BI.TreeView = BI.inherit(BI.Pane, {
}
function beforeCheck (treeId, treeNode) {
if (treeNode.disabled) {
return false;
}
// 下面主动修改了node的halfCheck属性, 节点属性的判断依赖halfCheck,改之前就获取一下
var status = treeNode.getCheckStatus();
treeNode.halfCheck = false;
@ -213,14 +218,23 @@ BI.TreeView = BI.inherit(BI.Pane, {
}
function onCheck (event, treeId, treeNode) {
if (treeNode.disabled) {
return false;
}
self._selectTreeNode(treeId, treeNode);
}
function onExpand (event, treeId, treeNode) {
if (treeNode.disabled) {
return false;
}
treeNode.halfCheck = false;
}
function onCollapse (event, treeId, treeNode) {
if (treeNode.disabled) {
return false;
}
}
return setting;
@ -335,22 +349,34 @@ BI.TreeView = BI.inherit(BI.Pane, {
var ns = BI.Tree.arrayFormat(nodes);
BI.each(ns, function (i, n) {
n.isParent = n.isParent || n.parent;
n.value = BI.isUndefined(n.value) ? n.text : n.value;
n.text = BI.isUndefined(n.text) ? n.value : n.text;
if (n.text === null) {
n.text = "";
}
// n.value = BI.isUndefined(n.value) ? n.text : n.value;
// n.text = BI.isUndefined(n.text) ? n.value : n.text;
// if (n.text === null) {
// n.text = "";
// }
if (BI.isNull(n.title)) {
n.title = n.text;
}
// 处理标红
if (BI.isNotNull(n.text)) {
if (BI.isKey(o.paras.keyword)) {
n.text = BI.$("<div>").__textKeywordMarked__(BI.Text.formatText(n.text + ""), o.paras.keyword, n.py).html();
} else {
n.text = BI.htmlEncode(BI.Text.formatText(n.text + ""));
}
}
var text = BI.createWidget(BI.extend({
type: "bi.text",
cls: "tree-node-text",
css: {
display: "inline"
},
whiteSpace: "nowrap",
root: true
}, n));
var fragment = BI.Widget._renderEngine.createElement("<div>");
fragment.append(text.element[0]);
n.text = fragment.html();
// // 处理标红
// if (BI.isNotNull(n.text)) {
// if (BI.isKey(o.paras.keyword)) {
// n.text = BI.$("<div>").__textKeywordMarked__(BI.Text.formatText(n.text + ""), o.paras.keyword, n.py).html();
// } else {
// n.text = BI.htmlEncode(BI.Text.formatText(n.text + ""));
// }
// }
});
return nodes;
},

20
src/case/ztree/1.asynctree.js

@ -59,6 +59,9 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
};
function onClick (event, treeId, treeNode) {
if (treeNode.disabled) {
return false;
}
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
// 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选
var checked = treeNode.checked;
@ -70,6 +73,9 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
}
function beforeCheck (treeId, treeNode) {
if (treeNode.disabled) {
return false;
}
// 下面主动修改了node的halfCheck属性, 节点属性的判断依赖halfCheck,改之前就获取一下
var status = treeNode.getCheckStatus();
treeNode.halfCheck = false;
@ -98,18 +104,30 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
}
function beforeExpand (treeId, treeNode) {
if (treeNode.disabled) {
return false;
}
self._beforeExpandNode(treeId, treeNode);
}
function onCheck (event, treeId, treeNode) {
if (treeNode.disabled) {
return false;
}
self._selectTreeNode(treeId, treeNode);
}
function onExpand (event, treeId, treeNode) {
if (treeNode.disabled) {
return false;
}
treeNode.halfCheck = false;
}
function onCollapse (event, treeId, treeNode) {
if (treeNode.disabled) {
return false;
}
treeNode.halfCheck = false;
}
@ -245,4 +263,4 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
}
});
BI.shortcut("bi.async_tree", BI.AsyncTree);
BI.shortcut("bi.async_tree", BI.AsyncTree);

2
src/case/ztree/jquery.ztree.excheck-3.5.js

@ -455,7 +455,7 @@
chClass += ' bi-checkbox checkbox-content';
break;
}
return chClass;
return chClass + (node.disabled ? " disabled" : "");
},
repairAllChk: function(setting, checked) {
if (setting.check.enable && setting.check.chkStyle === consts.checkbox.STYLE) {

12
src/component/treevaluechooser/abstract.treevaluechooser.js

@ -129,7 +129,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
pId: pId,
text: node.text + (llen > 0 ? ("(" + BI.i18nText("BI-Basic_Altogether") + llen + BI.i18nText("BI-Basic_Count") + ")") : ""),
value: node.value,
open: true
open: true,
disabled: node.disabled
});
}
},
@ -463,7 +464,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
open: isOpen,
checked: checked,
halfCheck: half,
flag: flag
flag: flag,
disabled: node.disabled
});
}
@ -546,7 +548,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
isParent: nodes[i].getChildrenLength() > 0,
checked: state[0],
halfCheck: state[1],
open: o.open
open: o.open,
disabled: nodes[i].disabled
});
}
// 如果指定节点全部打开
@ -584,7 +587,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
isParent: node.getChildrenLength() > 0,
checked: state[0],
halfCheck: state[1],
open: self.options.open
open: self.options.open,
disabled: node.disabled
});
});
}

9
src/component/treevaluechooser/abstract.treevaluechooser.list.js

@ -145,7 +145,8 @@ BI.AbstractListTreeValueChooser = BI.inherit(BI.AbstractTreeValueChooser, {
open: isOpen,
checked: checked,
halfCheck: false,
flag: flag
flag: flag,
disabled: node.disabled
});
}
@ -218,7 +219,8 @@ BI.AbstractListTreeValueChooser = BI.inherit(BI.AbstractTreeValueChooser, {
isParent: nodes[i].getChildrenLength() > 0,
checked: checked,
halfCheck: false,
open: o.open
open: o.open,
disabled: nodes[i].disabled
});
}
// 如果指定节点全部打开
@ -240,7 +242,8 @@ BI.AbstractListTreeValueChooser = BI.inherit(BI.AbstractTreeValueChooser, {
isParent: node.getChildrenLength() > 0,
checked: checked,
halfCheck: false,
open: o.open
open: o.open,
disabled: node.disabled
});
});
}

2
src/less/base/colorchooser/colorchooser.trigger.less

@ -5,7 +5,7 @@
}
.bi-combo-popup {
.bi-color-chooser-trigger {
&>.bi-color-chooser-trigger {
border-color: @color-bi-border-hover-combo;
}
}

61
src/less/base/combo/combo.bubble.less

@ -1,57 +1,12 @@
@import "../../index";
.bi-bubble-combo {
& .button-combo-triangle-wrapper {
position: fixed !important;
// 消除祖先节点设置的line-height:normal对空白节点的行高影响
line-height: 0;
.z-index-layer(@zIndex-popup);
// ie10一下无背景色会鼠标穿透
.background-color(@color-bi-background-default, 0);
}
& .bubble-combo-triangle-left {
z-index: 1;
.triangle-right();
}
& .bubble-combo-triangle-right {
z-index: 1;
.triangle-left();
}
& .bubble-combo-triangle-top {
z-index: 1;
.triangle-bottom();
}
& .bubble-combo-triangle-bottom {
z-index: 1;
.triangle-top();
}
& .bubble-combo-triangle-left, & .bubble-combo-triangle-right, & .bubble-combo-triangle-top, & .bubble-combo-triangle-bottom {
&:before {
background-color: @color-bi-background-bubble-combo-triangle;
}
&.bi-primary:before {
background-color: @background-color-card-primary;
}
}
}
// .bi-combo-popup .bi-bubble-popup-view {
// &.bi-zoom-big-leave{
// .zoom-big-motion-enter();
// }
// &.bi-zoom-big-leave-active{
// .zoom-big-motion-enter-active();
// .bi-bubble-combo {
// & .button-combo-triangle-wrapper {
// position: fixed !important;
// // 消除祖先节点设置的line-height:normal对空白节点的行高影响
// line-height: 0;
// .z-index-layer(@zIndex-popup);
// // ie10一下无背景色会鼠标穿透
// .background-color(@color-bi-background-default, 0);
// }
// }
.bi-theme-dark {
.bi-bubble-combo {
& .bubble-combo-triangle-left, & .bubble-combo-triangle-right, & .bubble-combo-triangle-top, & .bubble-combo-triangle-bottom {
&:before {
background-color: @color-bi-background-bubble-combo-triangle-theme-dark;
border-bottom: 1px solid @color-bi-border-bubble-combo-triangle-theme-dark;
border-right: 1px solid @color-bi-border-bubble-combo-triangle-theme-dark;
}
}
}
}

4
src/less/base/single/input/checkbox.less

@ -27,7 +27,7 @@
border-color: @color-bi-border-hover-active-checkbox;
}
}
&.active, &:active {
&.active {
& .checkbox-content, &.checkbox-content{
border-color: @color-bi-border-hover-active-checkbox;
background-color: @color-bi-background-active-checkbox;
@ -65,7 +65,7 @@
border-color: @color-bi-border-hover-active-checkbox-theme-dark;
}
}
&.active, &:active {
&.active {
& .checkbox-content, &.checkbox-content {
border-color: @color-bi-border-hover-active-checkbox-theme-dark;
background-color: @color-bi-background-active-checkbox-theme-dark;

4
src/less/base/single/input/radio.less

@ -13,7 +13,7 @@
border-color: @color-bi-border-hover-active-radio;
}
}
&:active, &.active {
&.active {
& .radio-content, &.radio-content {
border-color: @color-bi-border-hover-active-radio;
background-color: @color-bi-background-active-radio;
@ -59,7 +59,7 @@
border-color: @color-bi-border-hover-active-radio-theme-dark;
}
}
&.active, &:active {
&.active {
& .radio-content, &.radio-content {
border-color:@color-bi-border-hover-active-radio-theme-dark;
&:after {

1
src/less/base/single/label.less

@ -2,5 +2,6 @@
.bi-label {
.overflow-hidden();
word-wrap: break-word;
word-break: break-all;
}

1
src/less/base/single/text.less

@ -3,5 +3,6 @@
.bi-text {
.overflow-hidden();
.box-sizing(border-box);
word-wrap: break-word;
word-break: break-all;
}

25
src/less/base/tree/ztree.less

@ -76,12 +76,16 @@
text-decoration: none;
vertical-align: top;
display: inline-block;
&:hover {
.background-color(@color-bi-background-highlight, 10%);
}
&:active {
color: @color-bi-text-highlight;
.background-color(@color-bi-background-highlight, 15%);
.tree-node-text {
&:not(.disabled) {
&:hover {
.background-color(@color-bi-background-highlight, 10%);
}
&:active {
color: @color-bi-text-highlight;
.background-color(@color-bi-background-highlight, 15%);
}
}
}
}
@ -161,7 +165,14 @@
box-sizing: border-box;
&.active {
background-color: @color-bi-background-highlight;
border-color: @color-bi-border-highlight;;
border-color: @color-bi-border-highlight;
}
&.disabled {
border: 1px solid @color-bi-border-disabled;
background-color: @color-bi-background-disabled;
&.active {
border-color: @color-bi-border-disabled;
}
}
}
&.bi-half-button {

18
src/less/base/view/popupview.less

@ -28,34 +28,42 @@
}
.bi-popup-view[data-popper-placement^='top'], .bi-popup-view.top {
> .bi-bubble-arrow {
> div > .bi-bubble-arrow {
bottom: -12px;
width: 14px;
> .bubble-arrow {
bottom: 8px;
left: 1px;
}
}
}
.bi-popup-view[data-popper-placement^='bottom'], .bi-popup-view.bottom {
> .bi-bubble-arrow {
> div > .bi-bubble-arrow {
top: -12px;
width: 14px;
> .bubble-arrow {
top: 8px;
left: 1px;
}
}
}
.bi-popup-view[data-popper-placement^='left'], .bi-popup-view.left {
> .bi-bubble-arrow {
> div > .bi-bubble-arrow {
right: -12px;
height: 14px;
> .bubble-arrow {
right: 8px;
top: 1px;
}
}
}
.bi-popup-view[data-popper-placement^='right'], .bi-popup-view.right {
> .bi-bubble-arrow {
> div > .bi-bubble-arrow {
left: -12px;
height: 14px;
> .bubble-arrow {
left: 8px;
top: 1px;
}
}
}
@ -63,6 +71,8 @@
.bi-bubble-arrow {
width: 12px;
height: 12px;
// 消除祖先节点设置的line-height:normal对空白节点的行高影响
line-height: 0;
overflow: hidden;
.bubble-arrow {
width: 12px;

4
src/widget/multilayerselecttree/multilayerselecttree.combo.js

@ -246,6 +246,10 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
blur: function () {
this.trigger.blur();
},
showView: function () {
this.combo.showView();
}
});

4
src/widget/multilayersingletree/multilayersingletree.combo.js

@ -247,6 +247,10 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
blur: function () {
this.trigger.blur();
},
showView: function () {
this.combo.showView();
}
});

13
src/widget/multitree/trigger/searcher.list.multi.tree.js

@ -31,7 +31,18 @@ BI.MultiListTreeSearcher = BI.inherit(BI.Widget, {
el: {
type: "bi.simple_state_editor",
height: o.height
}
},
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({

3
typescript/index.ts

@ -49,6 +49,7 @@ import { VerticalFillLayout } from "./core/wrapper/layout/fill/fill.vertical";
import { VerticalLayout } from "./core/wrapper/layout/layout.vertical";
import { DefaultLayout } from "./core/wrapper/layout/layout.default";
import { DownListCombo } from "./widget/downlist/combo.downlist";
import { DownListPopup } from "./widget/downlist/popup.downlist";
import { Icon } from "./base/single/icon/icon";
import { LeftVerticalAdaptLayout } from "./core/wrapper/layout/adapt/adapt.leftvertical";
import { LeftRightVerticalAdaptLayout, RightVerticalAdaptLayout } from "./core/wrapper/layout/adapt/adapt.leftrightvertical";
@ -245,6 +246,7 @@ export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils {
MultiTreeInsertCombo: typeof MultiTreeInsertCombo;
Decorators: typeof decorator;
DownListCombo: typeof DownListCombo;
DownListPopup: typeof DownListPopup;
Iframe: typeof Iframe;
AbsoluteLayout: typeof AbsoluteLayout;
HorizontalFillLayout: typeof HorizontalFillLayout;
@ -423,6 +425,7 @@ export {
Label,
TextButton,
DownListCombo,
DownListPopup,
IconChangeButton,
Button,
TextEditor,

9
typescript/widget/downlist/popup.downlist.ts

@ -0,0 +1,9 @@
import { Widget } from "../../core/widget";
export declare class DownListPopup extends Widget {
static xtype: string;
static EVENT_CHANGE: string;
static EVENT_SON_VALUE_CHANGE: string;
populate: (items: any) => void;
}

2
typescript/widget/multilayerselecttree/multilayerselecttree.combo.ts

@ -19,4 +19,6 @@ export declare class MultiLayerSelectTreeCombo extends Widget {
focus(): void;
blur(): void;
showView(): void;
}

2
typescript/widget/multilayersingletree/multilayersingletree.combo.ts

@ -19,4 +19,6 @@ export declare class MultiLayerSingleTreeCombo extends Widget {
focus(): void;
blur(): void;
showView(): void;
}

11438
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save