Browse Source

Merge pull request #195 in FUI/fineui from ~GUY/fineui:master to master

* commit 'db44493e379a6af32b2c8b90ae3598871e41da7a': (28 commits)
  update
  还原
  update
  5.0配色
  update
  添加单选下拉框
  update
  update
  update
  update
  quick_grid_table
  update
  update
  text html中字符处理
  update
  update
  不合法值的处理
  update
  update
  update
  ...
es6
guy 7 years ago
parent
commit
fe24daebf4
  1. 30
      bi/base.css
  2. 55
      bi/base.js
  3. 2
      bi/case.js
  4. 148
      bi/core.css
  5. 34
      bi/core.js
  6. 20
      bi/widget.css
  7. 1614
      bi/widget.js
  8. 19
      demo/js/config/fix.js
  9. 8
      demo/js/config/widget.js
  10. 4
      demo/js/fix-2.0/computed.js
  11. 75
      demo/js/fix-2.0/context.js
  12. 2
      demo/js/fix-2.0/define.js
  13. 5
      demo/js/fix-2.0/demo.js
  14. 2
      demo/js/fix-2.0/globalwatcher.js
  15. 2
      demo/js/fix-2.0/scene.js
  16. 4
      demo/js/fix-2.0/state.js
  17. 4
      demo/js/fix-2.0/store.js
  18. 2
      demo/js/fix-2.0/watcher.js
  19. 83
      demo/js/widget/singleselct/demo.single_select_combo.js
  20. 1
      demo/js/widget/slider/demo.slider.js
  21. 30
      dist/base.css
  22. 55
      dist/base.js
  23. 198
      dist/bundle.css
  24. 1989
      dist/bundle.js
  25. 2
      dist/bundle.min.css
  26. 81
      dist/bundle.min.js
  27. 2
      dist/case.js
  28. 148
      dist/core.css
  29. 34
      dist/core.js
  30. 209
      dist/demo.js
  31. 51
      dist/fix/fix.compact.js
  32. 574
      dist/fix/fix.js
  33. 16
      dist/resource.css
  34. 20
      dist/widget.css
  35. 1614
      dist/widget.js
  36. 2
      package.json
  37. 48
      src/base/combination/combo.js
  38. 2
      src/base/single/text.js
  39. 5
      src/base/table/table.grid.quick.js
  40. 2
      src/case/floatbox/floatboxsection.bar.js
  41. 6
      src/core/func/dom.js
  42. 21
      src/core/func/function.js
  43. 7
      src/core/inject.js
  44. 4
      src/css/base/formula/codemirror.css
  45. 12
      src/css/base/single/button/button.css
  46. 2
      src/css/base/single/button/item.singleselect.icontext.css
  47. 2
      src/css/base/single/editor/editor.code.css
  48. 2
      src/css/base/single/input/input.css
  49. 2
      src/css/base/single/tip/tip.bubble.css
  50. 4
      src/css/base/single/tip/tip.toast.css
  51. 2
      src/css/base/single/tip/tip.tooltip.css
  52. 148
      src/css/core/utils/common.css
  53. 2
      src/css/resource/app.css
  54. 14
      src/css/resource/font.css
  55. 2
      src/css/widget/interactivearrangement/interactivearrangement.css
  56. 6
      src/css/widget/multidate/multidate.popup.css
  57. 2
      src/css/widget/multiselect/search/multiselect.search.pane.css
  58. 2
      src/css/widget/multitree/check/multi.tree.check.pane.css
  59. 2
      src/css/widget/multitree/trigger/multi.tree.button.checkselected.css
  60. 2
      src/css/widget/numberinterval/numberinterval.css
  61. 4
      src/css/widget/timeinterval/timeinterval.css
  62. 18
      src/less/lib/constant.less
  63. 7
      src/widget/multidate/multidate.popup.js
  64. 2
      src/widget/multiselecttree/multiselecttree.js
  65. 157
      src/widget/singleselect/search/singleselect.search.loader.js
  66. 98
      src/widget/singleselect/search/singleselect.search.pane.js
  67. 361
      src/widget/singleselect/singleselect.combo.js
  68. 137
      src/widget/singleselect/singleselect.list.js
  69. 163
      src/widget/singleselect/singleselect.loader.js
  70. 91
      src/widget/singleselect/singleselect.popup.view.js
  71. 110
      src/widget/singleselect/singleselect.trigger.js
  72. 82
      src/widget/singleselect/trigger/editor.singleselect.js
  73. 148
      src/widget/singleselect/trigger/searcher.singleselect.js
  74. 15
      src/widget/singleslider/singleslider.js

30
bi/base.css

@ -304,7 +304,7 @@
.cm-s-default span[class*="fieldName"] {
display: inline-block;
color: white;
background: #3f8ce8;
background: #3685f2;
padding: 0 5px;
margin: 1px 1px;
}
@ -326,7 +326,7 @@
border-radius: 3px;
}
.cm-s-default span[class*="#"] {
color: #3f8ce8;
color: #3685f2;
}
.cm-s-default .cm-error {
color: #f00;
@ -725,7 +725,7 @@ body .bi-button.button-common.clear,
#body .bi-button.button-common.clear,
body .bi-button.button-common.clear .b-font:before,
#body .bi-button.button-common.clear .b-font:before {
color: #3f8ce8;
color: #3685f2;
}
body .bi-button.button-ignore,
#body .bi-button.button-ignore {
@ -763,11 +763,11 @@ body .bi-button.button-success.clear,
#body .bi-button.button-success.clear,
body .bi-button.button-success.clear .b-font:before,
#body .bi-button.button-success.clear .b-font:before {
color: #0c6d23;
color: #5cb75d;
}
body .bi-button.button-warning,
#body .bi-button.button-warning {
background-color: #e85050;
background-color: #ff4949;
border-color: #e85050;
}
body .bi-button.button-warning,
@ -785,7 +785,7 @@ body .bi-button.button-warning.clear,
#body .bi-button.button-warning.clear,
body .bi-button.button-warning.clear .b-font:before,
#body .bi-button.button-warning.clear .b-font:before {
color: #e85050;
color: #faaa39;
}
body .bi-button.button-common.disabled,
#body .bi-button.button-common.disabled,
@ -837,7 +837,7 @@ body .bi-button.button-ignore.disabled,
#body .bi-button.button-ignore.disabled,
body .bi-button.button-ignore.disabled .b-font:before,
#body .bi-button.button-ignore.disabled .b-font:before {
color: #cccccc !important;
color: #9ea6b2 !important;
}
body .bi-button.button-common.disabled.clear,
#body .bi-button.button-common.disabled.clear,
@ -866,7 +866,7 @@ body .bi-button.button-warning.disabled.clear .b-font:before,
#body .bi-button.button-warning.disabled.clear .b-font:before,
body .bi-button.button-ignore.disabled.clear .b-font:before,
#body .bi-button.button-ignore.disabled.clear .b-font:before {
color: #cccccc !important;
color: #9ea6b2 !important;
}
body .bi-button.button-common.disabled.clear:hover,
#body .bi-button.button-common.disabled.clear:hover,
@ -901,7 +901,7 @@ body .bi-button.button-ignore.disabled.clear:active,
}
.bi-single-select-icon-text-item:active .b-font:before,
.bi-single-select-icon-text-item.active .b-font:before {
color: #3f8ce8;
color: #3685f2;
}
.bi-code-editor .param {
color: #ffffff;
@ -914,7 +914,7 @@ body .bi-button.button-ignore.disabled.clear:active,
display: inline-block;
}
.bi-code-editor .error-param {
color: #e85050;
color: #faaa39;
padding: 0 5px;
margin: 1px 1px;
display: inline-block;
@ -967,7 +967,7 @@ body .bi-button.button-ignore.disabled.clear:active,
.bi-input.bi-input-error,
.bi-textarea.bi-input-error {
border: none;
color: #e85050 !important;
color: #faaa39 !important;
}
.bi-label {
text-overflow: ellipsis;
@ -1000,7 +1000,7 @@ body .bi-button.button-ignore.disabled.clear:active,
-moz-border-radius: 2px;
border-radius: 2px;
background: #fddddd;
color: #e85050;
color: #faaa39;
}
.bi-tip {
position: fixed !important;
@ -1013,11 +1013,11 @@ body .bi-button.button-ignore.disabled.clear:active,
}
.bi-toast.toast-success {
background: #e1f4e7;
color: #0c6d23;
color: #5cb75d;
}
.bi-toast.toast-warning {
background: #fddddd;
color: #e85050;
color: #faaa39;
}
.bi-tooltip {
max-width: 250px;
@ -1033,7 +1033,7 @@ body .bi-button.button-ignore.disabled.clear:active,
}
.bi-tooltip.tooltip-warning {
background: #fddddd;
color: #e85050;
color: #faaa39;
border: 1px solid #f4cbcb;
}
.bi-collection-table-cell {

55
bi/base.js

@ -581,7 +581,7 @@ BI.Text = BI.inherit(BI.Single, {
setText: function (text) {
BI.Text.superclass.setText.apply(this, arguments);
this.options.text = text;
this.text.element.html((text + "").replaceAll(" ", " "));
this.text.element.html(BI.Func.formatSpecialCharInHtml(text));
}
});
@ -3035,18 +3035,20 @@ BI.Combo = BI.inherit(BI.Widget, {
}
});
self.element.on("mouseleave." + self.getName(), function (e) {
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
if (self.popupView) {
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
});
self.popupView.element.off("mouseenter." + self.getName());
});
self.popupView.element.off("mouseenter." + self.getName());
});
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
}
});
break;
case "click":
@ -3092,18 +3094,20 @@ BI.Combo = BI.inherit(BI.Widget, {
st(e);
});
self.element.on("mouseleave." + self.getName(), function (e) {
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
if (self.popupView) {
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
});
self.popupView.element.off("mouseenter." + self.getName());
});
self.popupView.element.off("mouseenter." + self.getName());
});
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
}
});
break;
}
@ -30511,6 +30515,11 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize);
this.topLeftGrid.setColumnCount(freezeColLength);
this.topRightGrid.setColumnCount(o.columnSize.length - freezeColLength);
this.bottomLeftGrid.setColumnCount(freezeColLength);
this.bottomRightGrid.setColumnCount(o.columnSize.length - freezeColLength);
var items = this.contextLayout.attr("items");
items[1].left = regionSize;
items[2].top = this._getFreezeHeaderHeight();

2
bi/case.js

@ -7555,7 +7555,7 @@ BI.BarPopoverSection = BI.inherit(BI.PopoverSection, {
BI.createWidget({
type: 'bi.right_vertical_adapt',
element: south,
hgap: 5,
lgap: 10,
items: [this.cancel, this.sure]
});
},

148
bi/core.css

@ -283,16 +283,16 @@ i {
}
.base-disabled {
cursor: default !important;
color: #cccccc !important;
color: #9ea6b2 !important;
}
.base-disabled .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.base-disabled .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.base-disabled .b-font:before {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .base-disabled {
color: #666666 !important;
@ -323,13 +323,13 @@ i {
}
.bi-background {
background-color: #eff1f4;
color: #666666;
color: #3d4d66;
}
.bi-background .bi-input {
color: #666666;
color: #3d4d66;
}
.bi-background .bi-textarea {
color: #666666;
color: #3d4d66;
}
.bi-theme-dark .bi-background {
background-color: #191b2b;
@ -343,13 +343,13 @@ i {
}
.bi-card {
background-color: #ffffff;
color: #666666;
color: #3d4d66;
}
.bi-card .bi-input {
color: #666666;
color: #3d4d66;
}
.bi-card .bi-textarea {
color: #666666;
color: #3d4d66;
}
.bi-theme-dark .bi-card {
background-color: #242640;
@ -362,13 +362,13 @@ i {
color: #cccccc;
}
.bi-disabled {
color: #cccccc;
color: #9ea6b2;
}
.bi-disabled .bi-input {
color: #cccccc;
color: #9ea6b2;
}
.bi-disabled .bi-textarea {
color: #cccccc;
color: #9ea6b2;
}
.bi-theme-dark .bi-disabled {
color: #666666;
@ -380,13 +380,13 @@ i {
color: #666666;
}
.bi-tips {
color: #999999;
color: #c4c9d1;
}
.bi-tips .bi-input {
color: #999999;
color: #c4c9d1;
}
.bi-tips .bi-textarea {
color: #999999;
color: #c4c9d1;
}
.bi-border {
border: 1px solid #d4dadd;
@ -419,22 +419,22 @@ i {
border-bottom: 1px solid #525466;
}
.bi-keyword-red-mark {
color: #f07d0a;
color: #ff4949;
}
.bi-keyword-red-mark .bi-input {
color: #f07d0a;
color: #ff4949;
}
.bi-keyword-red-mark .bi-textarea {
color: #f07d0a;
color: #ff4949;
}
.bi-high-light {
color: #3f8ce8;
color: #3685f2;
}
.bi-high-light .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-high-light .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-high-light-background {
background-color: #3f8ce8;
@ -528,22 +528,22 @@ i {
.bi-list-item.disabled:hover,
.bi-list-item.disabled:active {
background-color: transparent !important;
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item.disabled .bi-input,
.bi-list-item.disabled:hover .bi-input,
.bi-list-item.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item.disabled .bi-textarea,
.bi-list-item.disabled:hover .bi-textarea,
.bi-list-item.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item.disabled .bi-high-light,
.bi-list-item.disabled:hover .bi-high-light,
.bi-list-item.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item:hover,
.bi-theme-dark .bi-list-item.hover {
@ -585,45 +585,45 @@ i {
border: 1px solid #178cdf;
}
.bi-list-item-simple {
color: #999999;
color: #c4c9d1;
}
.bi-list-item-simple .bi-input {
color: #999999;
color: #c4c9d1;
}
.bi-list-item-simple .bi-textarea {
color: #999999;
color: #c4c9d1;
}
.bi-list-item-simple:hover,
.bi-list-item-simple.hover {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-simple:hover .bi-input,
.bi-list-item-simple.hover .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-simple:hover .bi-textarea,
.bi-list-item-simple.hover .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-simple.disabled,
.bi-list-item-simple.disabled:hover,
.bi-list-item-simple.disabled:active {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-simple.disabled .bi-input,
.bi-list-item-simple.disabled:hover .bi-input,
.bi-list-item-simple.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-simple.disabled .bi-textarea,
.bi-list-item-simple.disabled:hover .bi-textarea,
.bi-list-item-simple.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-simple.disabled .bi-high-light,
.bi-list-item-simple.disabled:hover .bi-high-light,
.bi-list-item-simple.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-effect:hover {
color: #1a1a1a;
@ -636,35 +636,35 @@ i {
}
.bi-list-item-effect.active,
.bi-list-item-effect:active {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-effect.active .bi-input,
.bi-list-item-effect:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-effect.active .bi-textarea,
.bi-list-item-effect:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-effect.disabled,
.bi-list-item-effect.disabled:hover,
.bi-list-item-effect.disabled:active {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-effect.disabled .bi-input,
.bi-list-item-effect.disabled:hover .bi-input,
.bi-list-item-effect.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-effect.disabled .bi-textarea,
.bi-list-item-effect.disabled:hover .bi-textarea,
.bi-list-item-effect.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-effect.disabled .bi-high-light,
.bi-list-item-effect.disabled:hover .bi-high-light,
.bi-list-item-effect.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item-effect:hover {
color: #ffffff;
@ -677,15 +677,15 @@ i {
}
.bi-theme-dark .bi-list-item-effect.active,
.bi-theme-dark .bi-list-item-effect:active {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-effect.active .bi-input,
.bi-theme-dark .bi-list-item-effect:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-effect.active .bi-textarea,
.bi-theme-dark .bi-list-item-effect:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-effect.disabled,
.bi-theme-dark .bi-list-item-effect.disabled:hover,
@ -724,38 +724,38 @@ i {
}
.bi-list-item-active.active,
.bi-list-item-active:active {
color: #3f8ce8;
color: #3685f2;
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item-active.active .bi-input,
.bi-list-item-active:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-active.active .bi-textarea,
.bi-list-item-active:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-active.disabled,
.bi-list-item-active.disabled:hover,
.bi-list-item-active.disabled:active {
background-color: transparent !important;
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active.disabled .bi-input,
.bi-list-item-active.disabled:hover .bi-input,
.bi-list-item-active.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active.disabled .bi-textarea,
.bi-list-item-active.disabled:hover .bi-textarea,
.bi-list-item-active.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active.disabled .bi-high-light,
.bi-list-item-active.disabled:hover .bi-high-light,
.bi-list-item-active.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item-active:hover,
.bi-theme-dark .bi-list-item-active.hover {
@ -773,17 +773,17 @@ i {
}
.bi-theme-dark .bi-list-item-active.active,
.bi-theme-dark .bi-list-item-active:active {
color: #3f8ce8;
color: #3685f2;
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item-active.active .bi-input,
.bi-theme-dark .bi-list-item-active:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-active.active .bi-textarea,
.bi-theme-dark .bi-list-item-active:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-active.disabled,
.bi-theme-dark .bi-list-item-active.disabled:hover,
@ -821,37 +821,37 @@ i {
}
.bi-list-item-active2.active,
.bi-list-item-active2:active {
color: #3f8ce8;
color: #3685f2;
background-color: #ffffff;
}
.bi-list-item-active2.active .bi-input,
.bi-list-item-active2:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-active2.active .bi-textarea,
.bi-list-item-active2:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-active2.disabled,
.bi-list-item-active2.disabled:hover,
.bi-list-item-active2.disabled:active {
background-color: transparent !important;
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active2.disabled .bi-input,
.bi-list-item-active2.disabled:hover .bi-input,
.bi-list-item-active2.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active2.disabled .bi-textarea,
.bi-list-item-active2.disabled:hover .bi-textarea,
.bi-list-item-active2.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active2.disabled .bi-high-light,
.bi-list-item-active2.disabled:hover .bi-high-light,
.bi-list-item-active2.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item-active2:hover,
.bi-theme-dark .bi-list-item-active2.hover {
@ -868,16 +868,16 @@ i {
}
.bi-theme-dark .bi-list-item-active2.active,
.bi-theme-dark .bi-list-item-active2:active {
color: #3f8ce8;
color: #3685f2;
background-color: #242640;
}
.bi-theme-dark .bi-list-item-active2.active .bi-input,
.bi-theme-dark .bi-list-item-active2:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-active2.active .bi-textarea,
.bi-theme-dark .bi-list-item-active2:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-active2.disabled,
.bi-theme-dark .bi-list-item-active2.disabled:hover,
@ -934,23 +934,23 @@ i {
.bi-list-item-select.disabled,
.bi-list-item-select.disabled:hover,
.bi-list-item-select.disabled:active {
color: #cccccc !important;
color: #9ea6b2 !important;
background-color: transparent !important;
}
.bi-list-item-select.disabled .bi-input,
.bi-list-item-select.disabled:hover .bi-input,
.bi-list-item-select.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-select.disabled .bi-textarea,
.bi-list-item-select.disabled:hover .bi-textarea,
.bi-list-item-select.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-select.disabled .bi-high-light,
.bi-list-item-select.disabled:hover .bi-high-light,
.bi-list-item-select.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item-select:hover,
.bi-theme-dark .bi-list-item-select.hover {
@ -1037,23 +1037,23 @@ i {
.bi-list-item-none.disabled,
.bi-list-item-none.disabled:hover,
.bi-list-item-none.disabled:active {
color: #cccccc !important;
color: #9ea6b2 !important;
background-color: transparent !important;
}
.bi-list-item-none.disabled .bi-input,
.bi-list-item-none.disabled:hover .bi-input,
.bi-list-item-none.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-none.disabled .bi-textarea,
.bi-list-item-none.disabled:hover .bi-textarea,
.bi-list-item-none.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-none.disabled .bi-high-light,
.bi-list-item-none.disabled:hover .bi-high-light,
.bi-list-item-none.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item-none:hover,
.bi-theme-dark .bi-list-item-none.hover {

34
bi/core.js

@ -19278,7 +19278,7 @@ BI.extend(jQuery.fn, {
*/
__textKeywordMarked__: function (text, keyword, py) {
if (!BI.isKey(keyword) || (text + "").length > 100) {
return this.html((text + "").replaceAll(" ", " "));
return this.html(BI.Func.formatSpecialCharInHtml(text));
}
keyword = keyword + "";
keyword = BI.toUpperCase(keyword);
@ -19301,7 +19301,7 @@ BI.extend(jQuery.fn, {
if (tidx >= 0) {
this.append(textLeft.substr(0, tidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.html(textLeft.substr(tidx, keyword.length).replaceAll(" ", "&nbsp;")));
.html(BI.Func.formatSpecialCharInHtml(textLeft.substr(tidx, keyword.length))));
textLeft = textLeft.substr(tidx + keyword.length);
if (py != null) {
@ -19310,7 +19310,7 @@ BI.extend(jQuery.fn, {
} else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) {
this.append(textLeft.substr(0, pidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.html(textLeft.substr(pidx, keyword.length).replaceAll(" ", "&nbsp;")));
.html(BI.Func.formatSpecialCharInHtml(textLeft.substr(pidx, keyword.length))));
if (py != null) {
py = py.substr(pidx + keyword.length);
}
@ -19915,6 +19915,27 @@ BI.extend(BI.Func, {
matched: matched,
finded: finded
}
},
/**
* 将字符串中的尖括号等字符encode成html能解析的形式
* @param str
*/
formatSpecialCharInHtml: function (str) {
return (str + "").replaceAll("\\s|<=?|>=?", function (str) {
switch (str) {
case "<":
return "&lt;";
case "<=":
return "&le;";
case ">":
return "&gt;";
case ">=":
return "&ge;";
default:
return "&nbsp;";
}
});
}
});
@ -20226,6 +20247,9 @@ BI.extend(BI.DOM, {
return stores[type];
}
return stores[type] = new storeInjection[type](config);
},
releaseStore: function (type) {
delete stores[type];
}
}
@ -20240,6 +20264,10 @@ BI.extend(BI.DOM, {
providerInstance[type] = new providers[type].$get()(config);
}
return providerInstance[type];
},
releaseProvider: function (type) {
delete providers[type];
delete providerInstance[type];
}
}

20
bi/widget.css

@ -73,7 +73,7 @@
}
.bi-interactive-arrangement .interactive-arrangement-dragtag-line {
z-index: 1000000000;
background-color: #f07d0a;
background-color: #ff4949;
}
.bi-interactive-arrangement .interactive-arrangement-dragtag-icon {
z-index: 1000000000;
@ -95,19 +95,19 @@
border-radius: 2px;
}
.bi-multidate-popup .multidate-popup-label {
color: #3f8ce8;
color: #3685f2;
font-size: 14px;
}
.bi-multidate-popup .multidate-popup-item:active,
.bi-multidate-popup .multidate-popup-item.active {
background-color: #3f8ce8;
background-color: #3685f2;
color: #ffffff;
-webkit-border-radius: 2px 2px 0 0;
-moz-border-radius: 2px 2px 0 0;
border-radius: 2px 2px 0 0;
}
.bi-multidate-popup .multidate-popup-button {
color: #3f8ce8;
color: #3685f2;
font-size: 14px;
}
.bi-multidate-segment .bi-multidate-editor {
@ -128,13 +128,13 @@
border-radius: 2px 2px 2px 2px;
}
.bi-multi-select-search-pane .multi-select-toolbar {
color: #e85050;
color: #faaa39;
}
.bi-multi-select-check-selected-button {
z-index: 1;
}
.bi-multi-tree-check-pane .multi-tree-check-selected {
color: #3f8ce8;
color: #3685f2;
}
.bi-multi-tree-combo .multi-select-trigger-icon-button {
font-size: 16px;
@ -143,7 +143,7 @@
min-height: 170px;
}
.bi-multi-tree-check-selected-button .trigger-check-selected {
color: #3f8ce8;
color: #3685f2;
z-index: 1;
}
.bi-number-editor {
@ -190,7 +190,7 @@
font-size: 14px;
}
.bi-number-interval.number-error .bi-input {
color: #e85050 !important;
color: #faaa39 !important;
}
.bi-page-table-cell {
-webkit-user-select: text;
@ -347,10 +347,10 @@
border-radius: 3px;
}
.bi-param-time-interval.time-error .bi-input {
color: #e85050;
color: #faaa39;
}
.bi-param-time-interval.time-error .sign-editor-text {
color: #e85050;
color: #faaa39;
}
.bi-year-popup .year-popup-navigation {
line-height: 30px;

1614
bi/widget.js

File diff suppressed because it is too large Load Diff

19
demo/js/config/fix.js

@ -87,39 +87,44 @@ Demo.FIX_CONFIG = [{
id: 71,
pId: 7,
text: "定义响应式数据",
value: "demo.fix1"
value: "demo.fix_define"
}, {
id: 72,
pId: 7,
text: "state属性",
value: "demo.fix6"
value: "demo.fix_state"
}, {
id: 78,
pId: 7,
text: "计算属性",
value: "demo.fix2"
value: "demo.fix_computed"
}, {
id: 73,
pId: 7,
text: "store",
value: "demo.fix3"
value: "demo.fix_store"
}, {
id: 74,
pId: 7,
text: "watcher且或表达式",
value: "demo.fix4"
value: "demo.fix_watcher"
}, {
id: 75,
pId: 7,
text: "watcher星号表达式",
value: "demo.fix5"
value: "demo.fix_global_watcher"
}, {
id: 76,
pId: 7,
text: "context",
value: "demo.fix_context"
}, {
id: 77,
pId: 7,
text: "一个混合的例子",
value: "demo.fix"
}, {
id: 77,
id: 78,
pId: 7,
text: "场景",
value: "demo.fix_scene"

8
demo/js/config/widget.js

@ -238,4 +238,12 @@ Demo.WIDGET_CONFIG = [{
id: 420,
text: "滚动sliders",
value: "demo.slider"
}, {
pId: 4,
id: 421,
text: "单选下拉框"
}, {
pId: 421,
text: "bi.single_select_combo",
value: "demo.single_select_combo"
}];

4
demo/js/fix-2.0/computed.js

@ -7,7 +7,7 @@
n: 'b'
}]
});
var Computed = BI.inherit(Fix.VM, {
var Computed = BI.inherit(Fix.Model, {
computed: {
b: function () {
return this.name + "-计算属性"
@ -48,5 +48,5 @@
}
});
BI.shortcut("demo.fix2", Demo.Fix);
BI.shortcut("demo.fix_computed", Demo.Fix);
}());

75
demo/js/fix-2.0/context.js

@ -0,0 +1,75 @@
;(function () {
var ParentStore = BI.inherit(Fix.Model, {
state: function () {
return {
context: "默认context"
}
},
childContext: ["context"]
})
var ChildStore = BI.inherit(Fix.Model, {
context: ["context"],
computed: {
currContext: function () {
return this.model.context
}
},
actions: {
changeContext: function () {
this.model.context = "改变后的context";
}
}
})
var Child = BI.inherit(BI.Widget, {
_store: function () {
return new ChildStore();
},
watch: {
currContext: function (val) {
this.button.setText(val);
}
},
render: function () {
var self = this;
return {
type: "bi.button",
ref: function () {
self.button = this;
},
text: this.model.context,
handler: function () {
self.store.changeContext();
}
}
},
mounted: function () {
}
})
BI.shortcut("demo.fix_context_child", Child)
var Parent = BI.inherit(BI.Widget, {
_store: function () {
return new ParentStore();
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "demo.fix_context_child",
}
}]
}
},
mounted: function () {
}
});
BI.shortcut("demo.fix_context", Parent);
}());

2
demo/js/fix-2.0/define.js

@ -41,5 +41,5 @@
}
});
BI.shortcut("demo.fix1", Demo.Fix);
BI.shortcut("demo.fix_define", Demo.Fix);
}());

5
demo/js/fix-2.0/demo.js

@ -7,7 +7,7 @@
n: 0
}]
});
var Computed = BI.inherit(Fix.VM, {
var Computed = BI.inherit(Fix.Model, {
computed: {
b: function () {
return this.name + 1
@ -18,7 +18,7 @@
}
})
var Store = BI.inherit(Fix.VM, {
var Store = BI.inherit(Fix.Model, {
_init: function () {
this.comp = new Computed(model);
},
@ -67,7 +67,6 @@
},
mounted: function () {
}
});

2
demo/js/fix-2.0/globalwatcher.js

@ -48,5 +48,5 @@
}
});
BI.shortcut("demo.fix5", Demo.Fix);
BI.shortcut("demo.fix_global_watcher", Demo.Fix);
}());

2
demo/js/fix-2.0/scene.js

@ -386,7 +386,7 @@
});
BI.shortcut("demo.fix_scene_field", Demo.FixSceneField);
Demo.FixSceneFineIndexUpdateStore = BI.inherit(Fix.VM, {
Demo.FixSceneFineIndexUpdateStore = BI.inherit(Fix.Model, {
_init: function () {
this.fineIndexUpdate = model.fineIndexUpdate;
},

4
demo/js/fix-2.0/state.js

@ -1,5 +1,5 @@
;(function () {
var State = BI.inherit(Fix.VM, {
var State = BI.inherit(Fix.Model, {
state: function () {
return {
name: "原始属性"
@ -45,5 +45,5 @@
}
});
BI.shortcut("demo.fix6", Demo.Fix);
BI.shortcut("demo.fix_state", Demo.Fix);
}());

4
demo/js/fix-2.0/store.js

@ -8,7 +8,7 @@
}]
});
var Store = BI.inherit(Fix.VM, {
var Store = BI.inherit(Fix.Model, {
_init: function () {
},
computed: {
@ -56,5 +56,5 @@
}
});
BI.shortcut("demo.fix3", Demo.Fix);
BI.shortcut("demo.fix_store", Demo.Fix);
}());

2
demo/js/fix-2.0/watcher.js

@ -47,5 +47,5 @@
}
});
BI.shortcut("demo.fix4", Demo.Fix);
BI.shortcut("demo.fix_watcher", Demo.Fix);
}());

83
demo/js/widget/singleselct/demo.single_select_combo.js

@ -0,0 +1,83 @@
/**
* Created by User on 2017/3/22.
*/
Demo.SingleSelectCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-single-select-combo"
},
_createSingleSelectCombo: function () {
var self = this;
var widget = BI.createWidget({
type: 'bi.single_select_combo',
itemsCreator: BI.bind(this._itemsCreator, this),
width: 200
});
widget.on(BI.SingleSelectCombo.EVENT_CONFIRM, function () {
BI.Msg.toast(JSON.stringify(this.getValue()));
});
return widget;
},
_getItemsByTimes: function (items, times) {
var res = [];
for (var i = (times - 1) * 10; items[i] && i < times * 10; i++) {
res.push(items[i]);
}
return res;
},
_hasNextByTimes: function (items, times) {
return times * 10 < items.length;
},
_itemsCreator: function (options, callback) {
var self = this;
var items = Demo.CONSTANTS.ITEMS;
var keywords = (options.keywords || []).slice();
if (options.keyword) {
keywords.push(options.keyword);
}
BI.each(keywords, function (i, kw) {
var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded);
});
if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) {
return !filter[ob.value];
});
}
if (options.type == BI.SingleSelectCombo.REQ_GET_ALL_DATA) {
callback({
items: items
});
return;
}
if (options.type == BI.SingleSelectCombo.REQ_GET_DATA_LENGTH) {
callback({count: items.length});
return;
}
BI.delay(function () {
callback({
items: self._getItemsByTimes(items, options.times),
hasNext: self._hasNextByTimes(items, options.times)
});
}, 1000);
},
render: function () {
return {
type: 'bi.absolute',
scrolly: false,
items: [{
el: this._createSingleSelectCombo(),
right: "50%",
top: 10
}]
}
}
});
BI.shortcut("demo.single_select_combo", Demo.SingleSelectCombo);

1
demo/js/widget/slider/demo.slider.js

@ -62,6 +62,7 @@ Demo.Slider = BI.inherit(BI.Widget, {
var intervalSlider = BI.createWidget({
type: "bi.interval_slider",
width: o.width,
digit: 0,
cls: "layout-bg-white"
});
intervalSlider.setMinAndMax({

30
dist/base.css vendored

@ -304,7 +304,7 @@
.cm-s-default span[class*="fieldName"] {
display: inline-block;
color: white;
background: #3f8ce8;
background: #3685f2;
padding: 0 5px;
margin: 1px 1px;
}
@ -326,7 +326,7 @@
border-radius: 3px;
}
.cm-s-default span[class*="#"] {
color: #3f8ce8;
color: #3685f2;
}
.cm-s-default .cm-error {
color: #f00;
@ -725,7 +725,7 @@ body .bi-button.button-common.clear,
#body .bi-button.button-common.clear,
body .bi-button.button-common.clear .b-font:before,
#body .bi-button.button-common.clear .b-font:before {
color: #3f8ce8;
color: #3685f2;
}
body .bi-button.button-ignore,
#body .bi-button.button-ignore {
@ -763,11 +763,11 @@ body .bi-button.button-success.clear,
#body .bi-button.button-success.clear,
body .bi-button.button-success.clear .b-font:before,
#body .bi-button.button-success.clear .b-font:before {
color: #0c6d23;
color: #5cb75d;
}
body .bi-button.button-warning,
#body .bi-button.button-warning {
background-color: #e85050;
background-color: #ff4949;
border-color: #e85050;
}
body .bi-button.button-warning,
@ -785,7 +785,7 @@ body .bi-button.button-warning.clear,
#body .bi-button.button-warning.clear,
body .bi-button.button-warning.clear .b-font:before,
#body .bi-button.button-warning.clear .b-font:before {
color: #e85050;
color: #faaa39;
}
body .bi-button.button-common.disabled,
#body .bi-button.button-common.disabled,
@ -837,7 +837,7 @@ body .bi-button.button-ignore.disabled,
#body .bi-button.button-ignore.disabled,
body .bi-button.button-ignore.disabled .b-font:before,
#body .bi-button.button-ignore.disabled .b-font:before {
color: #cccccc !important;
color: #9ea6b2 !important;
}
body .bi-button.button-common.disabled.clear,
#body .bi-button.button-common.disabled.clear,
@ -866,7 +866,7 @@ body .bi-button.button-warning.disabled.clear .b-font:before,
#body .bi-button.button-warning.disabled.clear .b-font:before,
body .bi-button.button-ignore.disabled.clear .b-font:before,
#body .bi-button.button-ignore.disabled.clear .b-font:before {
color: #cccccc !important;
color: #9ea6b2 !important;
}
body .bi-button.button-common.disabled.clear:hover,
#body .bi-button.button-common.disabled.clear:hover,
@ -901,7 +901,7 @@ body .bi-button.button-ignore.disabled.clear:active,
}
.bi-single-select-icon-text-item:active .b-font:before,
.bi-single-select-icon-text-item.active .b-font:before {
color: #3f8ce8;
color: #3685f2;
}
.bi-code-editor .param {
color: #ffffff;
@ -914,7 +914,7 @@ body .bi-button.button-ignore.disabled.clear:active,
display: inline-block;
}
.bi-code-editor .error-param {
color: #e85050;
color: #faaa39;
padding: 0 5px;
margin: 1px 1px;
display: inline-block;
@ -967,7 +967,7 @@ body .bi-button.button-ignore.disabled.clear:active,
.bi-input.bi-input-error,
.bi-textarea.bi-input-error {
border: none;
color: #e85050 !important;
color: #faaa39 !important;
}
.bi-label {
text-overflow: ellipsis;
@ -1000,7 +1000,7 @@ body .bi-button.button-ignore.disabled.clear:active,
-moz-border-radius: 2px;
border-radius: 2px;
background: #fddddd;
color: #e85050;
color: #faaa39;
}
.bi-tip {
position: fixed !important;
@ -1013,11 +1013,11 @@ body .bi-button.button-ignore.disabled.clear:active,
}
.bi-toast.toast-success {
background: #e1f4e7;
color: #0c6d23;
color: #5cb75d;
}
.bi-toast.toast-warning {
background: #fddddd;
color: #e85050;
color: #faaa39;
}
.bi-tooltip {
max-width: 250px;
@ -1033,7 +1033,7 @@ body .bi-button.button-ignore.disabled.clear:active,
}
.bi-tooltip.tooltip-warning {
background: #fddddd;
color: #e85050;
color: #faaa39;
border: 1px solid #f4cbcb;
}
.bi-collection-table-cell {

55
dist/base.js vendored

@ -581,7 +581,7 @@ BI.Text = BI.inherit(BI.Single, {
setText: function (text) {
BI.Text.superclass.setText.apply(this, arguments);
this.options.text = text;
this.text.element.html((text + "").replaceAll(" ", "&nbsp;"));
this.text.element.html(BI.Func.formatSpecialCharInHtml(text));
}
});
@ -3035,18 +3035,20 @@ BI.Combo = BI.inherit(BI.Widget, {
}
});
self.element.on("mouseleave." + self.getName(), function (e) {
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
if (self.popupView) {
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
});
self.popupView.element.off("mouseenter." + self.getName());
});
self.popupView.element.off("mouseenter." + self.getName());
});
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
}
});
break;
case "click":
@ -3092,18 +3094,20 @@ BI.Combo = BI.inherit(BI.Widget, {
st(e);
});
self.element.on("mouseleave." + self.getName(), function (e) {
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
if (self.popupView) {
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
});
self.popupView.element.off("mouseenter." + self.getName());
});
self.popupView.element.off("mouseenter." + self.getName());
});
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
}
});
break;
}
@ -30511,6 +30515,11 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize);
this.topLeftGrid.setColumnCount(freezeColLength);
this.topRightGrid.setColumnCount(o.columnSize.length - freezeColLength);
this.bottomLeftGrid.setColumnCount(freezeColLength);
this.bottomRightGrid.setColumnCount(o.columnSize.length - freezeColLength);
var items = this.contextLayout.attr("items");
items[1].left = regionSize;
items[2].top = this._getFreezeHeaderHeight();

198
dist/bundle.css vendored

@ -283,16 +283,16 @@ i {
}
.base-disabled {
cursor: default !important;
color: #cccccc !important;
color: #9ea6b2 !important;
}
.base-disabled .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.base-disabled .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.base-disabled .b-font:before {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .base-disabled {
color: #666666 !important;
@ -323,13 +323,13 @@ i {
}
.bi-background {
background-color: #eff1f4;
color: #666666;
color: #3d4d66;
}
.bi-background .bi-input {
color: #666666;
color: #3d4d66;
}
.bi-background .bi-textarea {
color: #666666;
color: #3d4d66;
}
.bi-theme-dark .bi-background {
background-color: #191b2b;
@ -343,13 +343,13 @@ i {
}
.bi-card {
background-color: #ffffff;
color: #666666;
color: #3d4d66;
}
.bi-card .bi-input {
color: #666666;
color: #3d4d66;
}
.bi-card .bi-textarea {
color: #666666;
color: #3d4d66;
}
.bi-theme-dark .bi-card {
background-color: #242640;
@ -362,13 +362,13 @@ i {
color: #cccccc;
}
.bi-disabled {
color: #cccccc;
color: #9ea6b2;
}
.bi-disabled .bi-input {
color: #cccccc;
color: #9ea6b2;
}
.bi-disabled .bi-textarea {
color: #cccccc;
color: #9ea6b2;
}
.bi-theme-dark .bi-disabled {
color: #666666;
@ -380,13 +380,13 @@ i {
color: #666666;
}
.bi-tips {
color: #999999;
color: #c4c9d1;
}
.bi-tips .bi-input {
color: #999999;
color: #c4c9d1;
}
.bi-tips .bi-textarea {
color: #999999;
color: #c4c9d1;
}
.bi-border {
border: 1px solid #d4dadd;
@ -419,22 +419,22 @@ i {
border-bottom: 1px solid #525466;
}
.bi-keyword-red-mark {
color: #f07d0a;
color: #ff4949;
}
.bi-keyword-red-mark .bi-input {
color: #f07d0a;
color: #ff4949;
}
.bi-keyword-red-mark .bi-textarea {
color: #f07d0a;
color: #ff4949;
}
.bi-high-light {
color: #3f8ce8;
color: #3685f2;
}
.bi-high-light .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-high-light .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-high-light-background {
background-color: #3f8ce8;
@ -528,22 +528,22 @@ i {
.bi-list-item.disabled:hover,
.bi-list-item.disabled:active {
background-color: transparent !important;
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item.disabled .bi-input,
.bi-list-item.disabled:hover .bi-input,
.bi-list-item.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item.disabled .bi-textarea,
.bi-list-item.disabled:hover .bi-textarea,
.bi-list-item.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item.disabled .bi-high-light,
.bi-list-item.disabled:hover .bi-high-light,
.bi-list-item.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item:hover,
.bi-theme-dark .bi-list-item.hover {
@ -585,45 +585,45 @@ i {
border: 1px solid #178cdf;
}
.bi-list-item-simple {
color: #999999;
color: #c4c9d1;
}
.bi-list-item-simple .bi-input {
color: #999999;
color: #c4c9d1;
}
.bi-list-item-simple .bi-textarea {
color: #999999;
color: #c4c9d1;
}
.bi-list-item-simple:hover,
.bi-list-item-simple.hover {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-simple:hover .bi-input,
.bi-list-item-simple.hover .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-simple:hover .bi-textarea,
.bi-list-item-simple.hover .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-simple.disabled,
.bi-list-item-simple.disabled:hover,
.bi-list-item-simple.disabled:active {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-simple.disabled .bi-input,
.bi-list-item-simple.disabled:hover .bi-input,
.bi-list-item-simple.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-simple.disabled .bi-textarea,
.bi-list-item-simple.disabled:hover .bi-textarea,
.bi-list-item-simple.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-simple.disabled .bi-high-light,
.bi-list-item-simple.disabled:hover .bi-high-light,
.bi-list-item-simple.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-effect:hover {
color: #1a1a1a;
@ -636,35 +636,35 @@ i {
}
.bi-list-item-effect.active,
.bi-list-item-effect:active {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-effect.active .bi-input,
.bi-list-item-effect:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-effect.active .bi-textarea,
.bi-list-item-effect:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-effect.disabled,
.bi-list-item-effect.disabled:hover,
.bi-list-item-effect.disabled:active {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-effect.disabled .bi-input,
.bi-list-item-effect.disabled:hover .bi-input,
.bi-list-item-effect.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-effect.disabled .bi-textarea,
.bi-list-item-effect.disabled:hover .bi-textarea,
.bi-list-item-effect.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-effect.disabled .bi-high-light,
.bi-list-item-effect.disabled:hover .bi-high-light,
.bi-list-item-effect.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item-effect:hover {
color: #ffffff;
@ -677,15 +677,15 @@ i {
}
.bi-theme-dark .bi-list-item-effect.active,
.bi-theme-dark .bi-list-item-effect:active {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-effect.active .bi-input,
.bi-theme-dark .bi-list-item-effect:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-effect.active .bi-textarea,
.bi-theme-dark .bi-list-item-effect:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-effect.disabled,
.bi-theme-dark .bi-list-item-effect.disabled:hover,
@ -724,38 +724,38 @@ i {
}
.bi-list-item-active.active,
.bi-list-item-active:active {
color: #3f8ce8;
color: #3685f2;
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item-active.active .bi-input,
.bi-list-item-active:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-active.active .bi-textarea,
.bi-list-item-active:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-active.disabled,
.bi-list-item-active.disabled:hover,
.bi-list-item-active.disabled:active {
background-color: transparent !important;
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active.disabled .bi-input,
.bi-list-item-active.disabled:hover .bi-input,
.bi-list-item-active.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active.disabled .bi-textarea,
.bi-list-item-active.disabled:hover .bi-textarea,
.bi-list-item-active.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active.disabled .bi-high-light,
.bi-list-item-active.disabled:hover .bi-high-light,
.bi-list-item-active.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item-active:hover,
.bi-theme-dark .bi-list-item-active.hover {
@ -773,17 +773,17 @@ i {
}
.bi-theme-dark .bi-list-item-active.active,
.bi-theme-dark .bi-list-item-active:active {
color: #3f8ce8;
color: #3685f2;
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item-active.active .bi-input,
.bi-theme-dark .bi-list-item-active:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-active.active .bi-textarea,
.bi-theme-dark .bi-list-item-active:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-active.disabled,
.bi-theme-dark .bi-list-item-active.disabled:hover,
@ -821,37 +821,37 @@ i {
}
.bi-list-item-active2.active,
.bi-list-item-active2:active {
color: #3f8ce8;
color: #3685f2;
background-color: #ffffff;
}
.bi-list-item-active2.active .bi-input,
.bi-list-item-active2:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-active2.active .bi-textarea,
.bi-list-item-active2:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-active2.disabled,
.bi-list-item-active2.disabled:hover,
.bi-list-item-active2.disabled:active {
background-color: transparent !important;
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active2.disabled .bi-input,
.bi-list-item-active2.disabled:hover .bi-input,
.bi-list-item-active2.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active2.disabled .bi-textarea,
.bi-list-item-active2.disabled:hover .bi-textarea,
.bi-list-item-active2.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active2.disabled .bi-high-light,
.bi-list-item-active2.disabled:hover .bi-high-light,
.bi-list-item-active2.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item-active2:hover,
.bi-theme-dark .bi-list-item-active2.hover {
@ -868,16 +868,16 @@ i {
}
.bi-theme-dark .bi-list-item-active2.active,
.bi-theme-dark .bi-list-item-active2:active {
color: #3f8ce8;
color: #3685f2;
background-color: #242640;
}
.bi-theme-dark .bi-list-item-active2.active .bi-input,
.bi-theme-dark .bi-list-item-active2:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-active2.active .bi-textarea,
.bi-theme-dark .bi-list-item-active2:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-active2.disabled,
.bi-theme-dark .bi-list-item-active2.disabled:hover,
@ -934,23 +934,23 @@ i {
.bi-list-item-select.disabled,
.bi-list-item-select.disabled:hover,
.bi-list-item-select.disabled:active {
color: #cccccc !important;
color: #9ea6b2 !important;
background-color: transparent !important;
}
.bi-list-item-select.disabled .bi-input,
.bi-list-item-select.disabled:hover .bi-input,
.bi-list-item-select.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-select.disabled .bi-textarea,
.bi-list-item-select.disabled:hover .bi-textarea,
.bi-list-item-select.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-select.disabled .bi-high-light,
.bi-list-item-select.disabled:hover .bi-high-light,
.bi-list-item-select.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item-select:hover,
.bi-theme-dark .bi-list-item-select.hover {
@ -1037,23 +1037,23 @@ i {
.bi-list-item-none.disabled,
.bi-list-item-none.disabled:hover,
.bi-list-item-none.disabled:active {
color: #cccccc !important;
color: #9ea6b2 !important;
background-color: transparent !important;
}
.bi-list-item-none.disabled .bi-input,
.bi-list-item-none.disabled:hover .bi-input,
.bi-list-item-none.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-none.disabled .bi-textarea,
.bi-list-item-none.disabled:hover .bi-textarea,
.bi-list-item-none.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-none.disabled .bi-high-light,
.bi-list-item-none.disabled:hover .bi-high-light,
.bi-list-item-none.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item-none:hover,
.bi-theme-dark .bi-list-item-none.hover {
@ -1899,7 +1899,7 @@ i {
.cm-s-default span[class*="fieldName"] {
display: inline-block;
color: white;
background: #3f8ce8;
background: #3685f2;
padding: 0 5px;
margin: 1px 1px;
}
@ -1921,7 +1921,7 @@ i {
border-radius: 3px;
}
.cm-s-default span[class*="#"] {
color: #3f8ce8;
color: #3685f2;
}
.cm-s-default .cm-error {
color: #f00;
@ -2320,7 +2320,7 @@ body .bi-button.button-common.clear,
#body .bi-button.button-common.clear,
body .bi-button.button-common.clear .b-font:before,
#body .bi-button.button-common.clear .b-font:before {
color: #3f8ce8;
color: #3685f2;
}
body .bi-button.button-ignore,
#body .bi-button.button-ignore {
@ -2358,11 +2358,11 @@ body .bi-button.button-success.clear,
#body .bi-button.button-success.clear,
body .bi-button.button-success.clear .b-font:before,
#body .bi-button.button-success.clear .b-font:before {
color: #0c6d23;
color: #5cb75d;
}
body .bi-button.button-warning,
#body .bi-button.button-warning {
background-color: #e85050;
background-color: #ff4949;
border-color: #e85050;
}
body .bi-button.button-warning,
@ -2380,7 +2380,7 @@ body .bi-button.button-warning.clear,
#body .bi-button.button-warning.clear,
body .bi-button.button-warning.clear .b-font:before,
#body .bi-button.button-warning.clear .b-font:before {
color: #e85050;
color: #faaa39;
}
body .bi-button.button-common.disabled,
#body .bi-button.button-common.disabled,
@ -2432,7 +2432,7 @@ body .bi-button.button-ignore.disabled,
#body .bi-button.button-ignore.disabled,
body .bi-button.button-ignore.disabled .b-font:before,
#body .bi-button.button-ignore.disabled .b-font:before {
color: #cccccc !important;
color: #9ea6b2 !important;
}
body .bi-button.button-common.disabled.clear,
#body .bi-button.button-common.disabled.clear,
@ -2461,7 +2461,7 @@ body .bi-button.button-warning.disabled.clear .b-font:before,
#body .bi-button.button-warning.disabled.clear .b-font:before,
body .bi-button.button-ignore.disabled.clear .b-font:before,
#body .bi-button.button-ignore.disabled.clear .b-font:before {
color: #cccccc !important;
color: #9ea6b2 !important;
}
body .bi-button.button-common.disabled.clear:hover,
#body .bi-button.button-common.disabled.clear:hover,
@ -2496,7 +2496,7 @@ body .bi-button.button-ignore.disabled.clear:active,
}
.bi-single-select-icon-text-item:active .b-font:before,
.bi-single-select-icon-text-item.active .b-font:before {
color: #3f8ce8;
color: #3685f2;
}
.bi-code-editor .param {
color: #ffffff;
@ -2509,7 +2509,7 @@ body .bi-button.button-ignore.disabled.clear:active,
display: inline-block;
}
.bi-code-editor .error-param {
color: #e85050;
color: #faaa39;
padding: 0 5px;
margin: 1px 1px;
display: inline-block;
@ -2562,7 +2562,7 @@ body .bi-button.button-ignore.disabled.clear:active,
.bi-input.bi-input-error,
.bi-textarea.bi-input-error {
border: none;
color: #e85050 !important;
color: #faaa39 !important;
}
.bi-label {
text-overflow: ellipsis;
@ -2595,7 +2595,7 @@ body .bi-button.button-ignore.disabled.clear:active,
-moz-border-radius: 2px;
border-radius: 2px;
background: #fddddd;
color: #e85050;
color: #faaa39;
}
.bi-tip {
position: fixed !important;
@ -2608,11 +2608,11 @@ body .bi-button.button-ignore.disabled.clear:active,
}
.bi-toast.toast-success {
background: #e1f4e7;
color: #0c6d23;
color: #5cb75d;
}
.bi-toast.toast-warning {
background: #fddddd;
color: #e85050;
color: #faaa39;
}
.bi-tooltip {
max-width: 250px;
@ -2628,7 +2628,7 @@ body .bi-button.button-ignore.disabled.clear:active,
}
.bi-tooltip.tooltip-warning {
background: #fddddd;
color: #e85050;
color: #faaa39;
border: 1px solid #f4cbcb;
}
.bi-collection-table-cell {
@ -3248,7 +3248,7 @@ ul.ztree.zTreeDragUL {
}
.bi-interactive-arrangement .interactive-arrangement-dragtag-line {
z-index: 1000000000;
background-color: #f07d0a;
background-color: #ff4949;
}
.bi-interactive-arrangement .interactive-arrangement-dragtag-icon {
z-index: 1000000000;
@ -3270,19 +3270,19 @@ ul.ztree.zTreeDragUL {
border-radius: 2px;
}
.bi-multidate-popup .multidate-popup-label {
color: #3f8ce8;
color: #3685f2;
font-size: 14px;
}
.bi-multidate-popup .multidate-popup-item:active,
.bi-multidate-popup .multidate-popup-item.active {
background-color: #3f8ce8;
background-color: #3685f2;
color: #ffffff;
-webkit-border-radius: 2px 2px 0 0;
-moz-border-radius: 2px 2px 0 0;
border-radius: 2px 2px 0 0;
}
.bi-multidate-popup .multidate-popup-button {
color: #3f8ce8;
color: #3685f2;
font-size: 14px;
}
.bi-multidate-segment .bi-multidate-editor {
@ -3303,13 +3303,13 @@ ul.ztree.zTreeDragUL {
border-radius: 2px 2px 2px 2px;
}
.bi-multi-select-search-pane .multi-select-toolbar {
color: #e85050;
color: #faaa39;
}
.bi-multi-select-check-selected-button {
z-index: 1;
}
.bi-multi-tree-check-pane .multi-tree-check-selected {
color: #3f8ce8;
color: #3685f2;
}
.bi-multi-tree-combo .multi-select-trigger-icon-button {
font-size: 16px;
@ -3318,7 +3318,7 @@ ul.ztree.zTreeDragUL {
min-height: 170px;
}
.bi-multi-tree-check-selected-button .trigger-check-selected {
color: #3f8ce8;
color: #3685f2;
z-index: 1;
}
.bi-number-editor {
@ -3365,7 +3365,7 @@ ul.ztree.zTreeDragUL {
font-size: 14px;
}
.bi-number-interval.number-error .bi-input {
color: #e85050 !important;
color: #faaa39 !important;
}
.bi-page-table-cell {
-webkit-user-select: text;
@ -3522,10 +3522,10 @@ ul.ztree.zTreeDragUL {
border-radius: 3px;
}
.bi-param-time-interval.time-error .bi-input {
color: #e85050;
color: #faaa39;
}
.bi-param-time-interval.time-error .sign-editor-text {
color: #e85050;
color: #faaa39;
}
.bi-year-popup .year-popup-navigation {
line-height: 30px;

1989
dist/bundle.js vendored

File diff suppressed because it is too large Load Diff

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

81
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/case.js vendored

@ -7555,7 +7555,7 @@ BI.BarPopoverSection = BI.inherit(BI.PopoverSection, {
BI.createWidget({
type: 'bi.right_vertical_adapt',
element: south,
hgap: 5,
lgap: 10,
items: [this.cancel, this.sure]
});
},

148
dist/core.css vendored

@ -283,16 +283,16 @@ i {
}
.base-disabled {
cursor: default !important;
color: #cccccc !important;
color: #9ea6b2 !important;
}
.base-disabled .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.base-disabled .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.base-disabled .b-font:before {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .base-disabled {
color: #666666 !important;
@ -323,13 +323,13 @@ i {
}
.bi-background {
background-color: #eff1f4;
color: #666666;
color: #3d4d66;
}
.bi-background .bi-input {
color: #666666;
color: #3d4d66;
}
.bi-background .bi-textarea {
color: #666666;
color: #3d4d66;
}
.bi-theme-dark .bi-background {
background-color: #191b2b;
@ -343,13 +343,13 @@ i {
}
.bi-card {
background-color: #ffffff;
color: #666666;
color: #3d4d66;
}
.bi-card .bi-input {
color: #666666;
color: #3d4d66;
}
.bi-card .bi-textarea {
color: #666666;
color: #3d4d66;
}
.bi-theme-dark .bi-card {
background-color: #242640;
@ -362,13 +362,13 @@ i {
color: #cccccc;
}
.bi-disabled {
color: #cccccc;
color: #9ea6b2;
}
.bi-disabled .bi-input {
color: #cccccc;
color: #9ea6b2;
}
.bi-disabled .bi-textarea {
color: #cccccc;
color: #9ea6b2;
}
.bi-theme-dark .bi-disabled {
color: #666666;
@ -380,13 +380,13 @@ i {
color: #666666;
}
.bi-tips {
color: #999999;
color: #c4c9d1;
}
.bi-tips .bi-input {
color: #999999;
color: #c4c9d1;
}
.bi-tips .bi-textarea {
color: #999999;
color: #c4c9d1;
}
.bi-border {
border: 1px solid #d4dadd;
@ -419,22 +419,22 @@ i {
border-bottom: 1px solid #525466;
}
.bi-keyword-red-mark {
color: #f07d0a;
color: #ff4949;
}
.bi-keyword-red-mark .bi-input {
color: #f07d0a;
color: #ff4949;
}
.bi-keyword-red-mark .bi-textarea {
color: #f07d0a;
color: #ff4949;
}
.bi-high-light {
color: #3f8ce8;
color: #3685f2;
}
.bi-high-light .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-high-light .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-high-light-background {
background-color: #3f8ce8;
@ -528,22 +528,22 @@ i {
.bi-list-item.disabled:hover,
.bi-list-item.disabled:active {
background-color: transparent !important;
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item.disabled .bi-input,
.bi-list-item.disabled:hover .bi-input,
.bi-list-item.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item.disabled .bi-textarea,
.bi-list-item.disabled:hover .bi-textarea,
.bi-list-item.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item.disabled .bi-high-light,
.bi-list-item.disabled:hover .bi-high-light,
.bi-list-item.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item:hover,
.bi-theme-dark .bi-list-item.hover {
@ -585,45 +585,45 @@ i {
border: 1px solid #178cdf;
}
.bi-list-item-simple {
color: #999999;
color: #c4c9d1;
}
.bi-list-item-simple .bi-input {
color: #999999;
color: #c4c9d1;
}
.bi-list-item-simple .bi-textarea {
color: #999999;
color: #c4c9d1;
}
.bi-list-item-simple:hover,
.bi-list-item-simple.hover {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-simple:hover .bi-input,
.bi-list-item-simple.hover .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-simple:hover .bi-textarea,
.bi-list-item-simple.hover .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-simple.disabled,
.bi-list-item-simple.disabled:hover,
.bi-list-item-simple.disabled:active {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-simple.disabled .bi-input,
.bi-list-item-simple.disabled:hover .bi-input,
.bi-list-item-simple.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-simple.disabled .bi-textarea,
.bi-list-item-simple.disabled:hover .bi-textarea,
.bi-list-item-simple.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-simple.disabled .bi-high-light,
.bi-list-item-simple.disabled:hover .bi-high-light,
.bi-list-item-simple.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-effect:hover {
color: #1a1a1a;
@ -636,35 +636,35 @@ i {
}
.bi-list-item-effect.active,
.bi-list-item-effect:active {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-effect.active .bi-input,
.bi-list-item-effect:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-effect.active .bi-textarea,
.bi-list-item-effect:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-effect.disabled,
.bi-list-item-effect.disabled:hover,
.bi-list-item-effect.disabled:active {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-effect.disabled .bi-input,
.bi-list-item-effect.disabled:hover .bi-input,
.bi-list-item-effect.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-effect.disabled .bi-textarea,
.bi-list-item-effect.disabled:hover .bi-textarea,
.bi-list-item-effect.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-effect.disabled .bi-high-light,
.bi-list-item-effect.disabled:hover .bi-high-light,
.bi-list-item-effect.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item-effect:hover {
color: #ffffff;
@ -677,15 +677,15 @@ i {
}
.bi-theme-dark .bi-list-item-effect.active,
.bi-theme-dark .bi-list-item-effect:active {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-effect.active .bi-input,
.bi-theme-dark .bi-list-item-effect:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-effect.active .bi-textarea,
.bi-theme-dark .bi-list-item-effect:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-effect.disabled,
.bi-theme-dark .bi-list-item-effect.disabled:hover,
@ -724,38 +724,38 @@ i {
}
.bi-list-item-active.active,
.bi-list-item-active:active {
color: #3f8ce8;
color: #3685f2;
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item-active.active .bi-input,
.bi-list-item-active:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-active.active .bi-textarea,
.bi-list-item-active:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-active.disabled,
.bi-list-item-active.disabled:hover,
.bi-list-item-active.disabled:active {
background-color: transparent !important;
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active.disabled .bi-input,
.bi-list-item-active.disabled:hover .bi-input,
.bi-list-item-active.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active.disabled .bi-textarea,
.bi-list-item-active.disabled:hover .bi-textarea,
.bi-list-item-active.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active.disabled .bi-high-light,
.bi-list-item-active.disabled:hover .bi-high-light,
.bi-list-item-active.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item-active:hover,
.bi-theme-dark .bi-list-item-active.hover {
@ -773,17 +773,17 @@ i {
}
.bi-theme-dark .bi-list-item-active.active,
.bi-theme-dark .bi-list-item-active:active {
color: #3f8ce8;
color: #3685f2;
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item-active.active .bi-input,
.bi-theme-dark .bi-list-item-active:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-active.active .bi-textarea,
.bi-theme-dark .bi-list-item-active:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-active.disabled,
.bi-theme-dark .bi-list-item-active.disabled:hover,
@ -821,37 +821,37 @@ i {
}
.bi-list-item-active2.active,
.bi-list-item-active2:active {
color: #3f8ce8;
color: #3685f2;
background-color: #ffffff;
}
.bi-list-item-active2.active .bi-input,
.bi-list-item-active2:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-active2.active .bi-textarea,
.bi-list-item-active2:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-active2.disabled,
.bi-list-item-active2.disabled:hover,
.bi-list-item-active2.disabled:active {
background-color: transparent !important;
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active2.disabled .bi-input,
.bi-list-item-active2.disabled:hover .bi-input,
.bi-list-item-active2.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active2.disabled .bi-textarea,
.bi-list-item-active2.disabled:hover .bi-textarea,
.bi-list-item-active2.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active2.disabled .bi-high-light,
.bi-list-item-active2.disabled:hover .bi-high-light,
.bi-list-item-active2.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item-active2:hover,
.bi-theme-dark .bi-list-item-active2.hover {
@ -868,16 +868,16 @@ i {
}
.bi-theme-dark .bi-list-item-active2.active,
.bi-theme-dark .bi-list-item-active2:active {
color: #3f8ce8;
color: #3685f2;
background-color: #242640;
}
.bi-theme-dark .bi-list-item-active2.active .bi-input,
.bi-theme-dark .bi-list-item-active2:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-active2.active .bi-textarea,
.bi-theme-dark .bi-list-item-active2:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-active2.disabled,
.bi-theme-dark .bi-list-item-active2.disabled:hover,
@ -934,23 +934,23 @@ i {
.bi-list-item-select.disabled,
.bi-list-item-select.disabled:hover,
.bi-list-item-select.disabled:active {
color: #cccccc !important;
color: #9ea6b2 !important;
background-color: transparent !important;
}
.bi-list-item-select.disabled .bi-input,
.bi-list-item-select.disabled:hover .bi-input,
.bi-list-item-select.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-select.disabled .bi-textarea,
.bi-list-item-select.disabled:hover .bi-textarea,
.bi-list-item-select.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-select.disabled .bi-high-light,
.bi-list-item-select.disabled:hover .bi-high-light,
.bi-list-item-select.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item-select:hover,
.bi-theme-dark .bi-list-item-select.hover {
@ -1037,23 +1037,23 @@ i {
.bi-list-item-none.disabled,
.bi-list-item-none.disabled:hover,
.bi-list-item-none.disabled:active {
color: #cccccc !important;
color: #9ea6b2 !important;
background-color: transparent !important;
}
.bi-list-item-none.disabled .bi-input,
.bi-list-item-none.disabled:hover .bi-input,
.bi-list-item-none.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-none.disabled .bi-textarea,
.bi-list-item-none.disabled:hover .bi-textarea,
.bi-list-item-none.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-none.disabled .bi-high-light,
.bi-list-item-none.disabled:hover .bi-high-light,
.bi-list-item-none.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item-none:hover,
.bi-theme-dark .bi-list-item-none.hover {

34
dist/core.js vendored

@ -19278,7 +19278,7 @@ BI.extend(jQuery.fn, {
*/
__textKeywordMarked__: function (text, keyword, py) {
if (!BI.isKey(keyword) || (text + "").length > 100) {
return this.html((text + "").replaceAll(" ", "&nbsp;"));
return this.html(BI.Func.formatSpecialCharInHtml(text));
}
keyword = keyword + "";
keyword = BI.toUpperCase(keyword);
@ -19301,7 +19301,7 @@ BI.extend(jQuery.fn, {
if (tidx >= 0) {
this.append(textLeft.substr(0, tidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.html(textLeft.substr(tidx, keyword.length).replaceAll(" ", "&nbsp;")));
.html(BI.Func.formatSpecialCharInHtml(textLeft.substr(tidx, keyword.length))));
textLeft = textLeft.substr(tidx + keyword.length);
if (py != null) {
@ -19310,7 +19310,7 @@ BI.extend(jQuery.fn, {
} else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) {
this.append(textLeft.substr(0, pidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.html(textLeft.substr(pidx, keyword.length).replaceAll(" ", "&nbsp;")));
.html(BI.Func.formatSpecialCharInHtml(textLeft.substr(pidx, keyword.length))));
if (py != null) {
py = py.substr(pidx + keyword.length);
}
@ -19915,6 +19915,27 @@ BI.extend(BI.Func, {
matched: matched,
finded: finded
}
},
/**
* 将字符串中的尖括号等字符encode成html能解析的形式
* @param str
*/
formatSpecialCharInHtml: function (str) {
return (str + "").replaceAll("\\s|<=?|>=?", function (str) {
switch (str) {
case "<":
return "&lt;";
case "<=":
return "&le;";
case ">":
return "&gt;";
case ">=":
return "&ge;";
default:
return "&nbsp;";
}
});
}
});
@ -20226,6 +20247,9 @@ BI.extend(BI.DOM, {
return stores[type];
}
return stores[type] = new storeInjection[type](config);
},
releaseStore: function (type) {
delete stores[type];
}
}
@ -20240,6 +20264,10 @@ BI.extend(BI.DOM, {
providerInstance[type] = new providers[type].$get()(config);
}
return providerInstance[type];
},
releaseProvider: function (type) {
delete providers[type];
delete providerInstance[type];
}
}

209
dist/demo.js vendored

@ -5261,39 +5261,44 @@ Demo.FIX_CONFIG = [{
id: 71,
pId: 7,
text: "定义响应式数据",
value: "demo.fix1"
value: "demo.fix_define"
}, {
id: 72,
pId: 7,
text: "state属性",
value: "demo.fix6"
value: "demo.fix_state"
}, {
id: 78,
pId: 7,
text: "计算属性",
value: "demo.fix2"
value: "demo.fix_computed"
}, {
id: 73,
pId: 7,
text: "store",
value: "demo.fix3"
value: "demo.fix_store"
}, {
id: 74,
pId: 7,
text: "watcher且或表达式",
value: "demo.fix4"
value: "demo.fix_watcher"
}, {
id: 75,
pId: 7,
text: "watcher星号表达式",
value: "demo.fix5"
value: "demo.fix_global_watcher"
}, {
id: 76,
pId: 7,
text: "context",
value: "demo.fix_context"
}, {
id: 77,
pId: 7,
text: "一个混合的例子",
value: "demo.fix"
}, {
id: 77,
id: 78,
pId: 7,
text: "场景",
value: "demo.fix_scene"
@ -5537,6 +5542,14 @@ Demo.FIX_CONFIG = [{
id: 420,
text: "滚动sliders",
value: "demo.slider"
}, {
pId: 4,
id: 421,
text: "单选下拉框"
}, {
pId: 421,
text: "bi.single_select_combo",
value: "demo.single_select_combo"
}];Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
@ -9997,7 +10010,7 @@ BI.shortcut("demo.tmp", Demo.Func);
n: 'b'
}]
});
var Computed = BI.inherit(Fix.VM, {
var Computed = BI.inherit(Fix.Model, {
computed: {
b: function () {
return this.name + "-计算属性"
@ -10038,7 +10051,81 @@ BI.shortcut("demo.tmp", Demo.Func);
}
});
BI.shortcut("demo.fix2", Demo.Fix);
BI.shortcut("demo.fix_computed", Demo.Fix);
}());;(function () {
var ParentStore = BI.inherit(Fix.Model, {
state: function () {
return {
context: "默认context"
}
},
childContext: ["context"]
})
var ChildStore = BI.inherit(Fix.Model, {
context: ["context"],
computed: {
currContext: function () {
return this.model.context
}
},
actions: {
changeContext: function () {
this.model.context = "改变后的context";
}
}
})
var Child = BI.inherit(BI.Widget, {
_store: function () {
return new ChildStore();
},
watch: {
currContext: function (val) {
this.button.setText(val);
}
},
render: function () {
var self = this;
return {
type: "bi.button",
ref: function () {
self.button = this;
},
text: this.model.context,
handler: function () {
self.store.changeContext();
}
}
},
mounted: function () {
}
})
BI.shortcut("demo.fix_context_child", Child)
var Parent = BI.inherit(BI.Widget, {
_store: function () {
return new ParentStore();
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "demo.fix_context_child",
}
}]
}
},
mounted: function () {
}
});
BI.shortcut("demo.fix_context", Parent);
}());;(function () {
var model = Fix.define({
name: "原始属性",
@ -10082,7 +10169,7 @@ BI.shortcut("demo.tmp", Demo.Func);
}
});
BI.shortcut("demo.fix1", Demo.Fix);
BI.shortcut("demo.fix_define", Demo.Fix);
}());
;(function () {
var model = Fix.define({
@ -10093,7 +10180,7 @@ BI.shortcut("demo.tmp", Demo.Func);
n: 0
}]
});
var Computed = BI.inherit(Fix.VM, {
var Computed = BI.inherit(Fix.Model, {
computed: {
b: function () {
return this.name + 1
@ -10104,7 +10191,7 @@ BI.shortcut("demo.tmp", Demo.Func);
}
})
var Store = BI.inherit(Fix.VM, {
var Store = BI.inherit(Fix.Model, {
_init: function () {
this.comp = new Computed(model);
},
@ -10153,7 +10240,6 @@ BI.shortcut("demo.tmp", Demo.Func);
},
mounted: function () {
}
});
@ -10208,7 +10294,7 @@ BI.shortcut("demo.tmp", Demo.Func);
}
});
BI.shortcut("demo.fix5", Demo.Fix);
BI.shortcut("demo.fix_global_watcher", Demo.Fix);
}());/**
* @Author: Young
* @CreationDate 2017-11-06 10:32
@ -10597,7 +10683,7 @@ BI.shortcut("demo.tmp", Demo.Func);
});
BI.shortcut("demo.fix_scene_field", Demo.FixSceneField);
Demo.FixSceneFineIndexUpdateStore = BI.inherit(Fix.VM, {
Demo.FixSceneFineIndexUpdateStore = BI.inherit(Fix.Model, {
_init: function () {
this.fineIndexUpdate = model.fineIndexUpdate;
},
@ -10654,7 +10740,7 @@ BI.shortcut("demo.tmp", Demo.Func);
BI.shortcut("demo.fix_scene_fine_index_update", Demo.FixSceneFineIndexUpdate);
})();;(function () {
var State = BI.inherit(Fix.VM, {
var State = BI.inherit(Fix.Model, {
state: function () {
return {
name: "原始属性"
@ -10700,7 +10786,7 @@ BI.shortcut("demo.tmp", Demo.Func);
}
});
BI.shortcut("demo.fix6", Demo.Fix);
BI.shortcut("demo.fix_state", Demo.Fix);
}());;(function(){
var model = Fix.define({
name: "原始属性",
@ -10711,7 +10797,7 @@ BI.shortcut("demo.tmp", Demo.Func);
}]
});
var Store = BI.inherit(Fix.VM, {
var Store = BI.inherit(Fix.Model, {
_init: function () {
},
computed: {
@ -10759,7 +10845,7 @@ BI.shortcut("demo.tmp", Demo.Func);
}
});
BI.shortcut("demo.fix3", Demo.Fix);
BI.shortcut("demo.fix_store", Demo.Fix);
}());;(function () {
var model = Fix.define({
name: "原始属性",
@ -10809,7 +10895,7 @@ BI.shortcut("demo.tmp", Demo.Func);
}
});
BI.shortcut("demo.fix4", Demo.Fix);
BI.shortcut("demo.fix_watcher", Demo.Fix);
}());Demo.Main = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-main bi-background"
@ -12903,6 +12989,88 @@ Demo.SelectTreeCombo = BI.inherit(BI.Widget, {
})
BI.shortcut("demo.select_tree_combo", Demo.SelectTreeCombo);/**
* Created by User on 2017/3/22.
*/
Demo.SingleSelectCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-single-select-combo"
},
_createSingleSelectCombo: function () {
var self = this;
var widget = BI.createWidget({
type: 'bi.single_select_combo',
itemsCreator: BI.bind(this._itemsCreator, this),
width: 200
});
widget.on(BI.SingleSelectCombo.EVENT_CONFIRM, function () {
BI.Msg.toast(JSON.stringify(this.getValue()));
});
return widget;
},
_getItemsByTimes: function (items, times) {
var res = [];
for (var i = (times - 1) * 10; items[i] && i < times * 10; i++) {
res.push(items[i]);
}
return res;
},
_hasNextByTimes: function (items, times) {
return times * 10 < items.length;
},
_itemsCreator: function (options, callback) {
var self = this;
var items = Demo.CONSTANTS.ITEMS;
var keywords = (options.keywords || []).slice();
if (options.keyword) {
keywords.push(options.keyword);
}
BI.each(keywords, function (i, kw) {
var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded);
});
if (options.selectedValues) {//过滤
var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) {
return !filter[ob.value];
});
}
if (options.type == BI.SingleSelectCombo.REQ_GET_ALL_DATA) {
callback({
items: items
});
return;
}
if (options.type == BI.SingleSelectCombo.REQ_GET_DATA_LENGTH) {
callback({count: items.length});
return;
}
BI.delay(function () {
callback({
items: self._getItemsByTimes(items, options.times),
hasNext: self._hasNextByTimes(items, options.times)
});
}, 1000);
},
render: function () {
return {
type: 'bi.absolute',
scrolly: false,
items: [{
el: this._createSingleSelectCombo(),
right: "50%",
top: 10
}]
}
}
});
BI.shortcut("demo.single_select_combo", Demo.SingleSelectCombo);/**
* Created by Dailer on 2017/7/13.
*/
Demo.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
@ -13048,6 +13216,7 @@ Demo.Slider = BI.inherit(BI.Widget, {
var intervalSlider = BI.createWidget({
type: "bi.interval_slider",
width: o.width,
digit: 0,
cls: "layout-bg-white"
});
intervalSlider.setMinAndMax({

51
dist/fix/fix.compact.js vendored

@ -17,22 +17,51 @@
return Fix.watch(vm.model, keyOrFn, _.bind(handler, vm), options)
}
var target = null
const targetStack = []
function pushTarget(_target) {
if (target) targetStack.push(target)
Fix.Model.target = target = _target
}
function popTarget() {
Fix.Model.target = target = targetStack.pop()
}
var _init = BI.Widget.prototype._init;
BI.Widget.prototype._init = function () {
var needPop = false;
if (window.Fix && this._store) {
var p = this.options.element;
while (p) {
if (p.store) {
break;
}
p = p._parent || (p.options && p.options.element);
}
if (p) {
pushTarget(p.store);
needPop = true;
}
this.store = this._store();
if (this.store instanceof Fix.VM) {
needPop && popTarget();
needPop = false;
pushTarget(this.store);
if (this.store instanceof Fix.Model) {
this.model = this.store.model;
} else {
this.model = this.store;
}
initWatch(this, this.watch);
needPop = true;
}
_init.apply(this, arguments);
needPop && popTarget();
};
var unMount = BI.Widget.prototype._unMount;
BI.Widget.prototype._unMount = function () {
var unMount = BI.Widget.prototype.__d;
BI.Widget.prototype.__d = function () {
unMount.apply(this, arguments);
this.store && BI.isFunction(this.store.destroy) && this.store.destroy();
BI.each(this._watchers, function (i, unwatches) {
@ -42,6 +71,20 @@
})
});
this._watchers && (this._watchers = []);
this.store && (this.store = null);
this.store && (this.store._parent = null, this.store = null);
}
_.each(["each", "map", "reduce", "reduceRight", "find", "filter", "reject", "every", "all", "some", "any", "max", "min",
"sortBy", "groupBy", "indexBy", "countBy", "partition",
"keys", "allKeys", "values", "pairs", "invert",
"mapObject", "findKey", "pick", "omit", "tap"], function (name) {
var old = BI[name]
BI[name] = function (obj, fn) {
return typeof fn === "function" ? old(obj, function (key, value) {
if (!(key in Fix.$$skipArray)) {
return fn.apply(null, arguments);
}
}) : old.apply(null, arguments);
}
});
}());

574
dist/fix/fix.js vendored

@ -127,9 +127,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var _resolve = void 0;
callbacks.push(function () {
if (cb) {
try {
cb.call(ctx);
} catch (e) {}
// try {
cb.call(ctx);
// } catch (e) {
// }
} else if (_resolve) {
_resolve(ctx);
}
@ -469,56 +470,53 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
function defineReactive(obj, observer, shallow) {
var props = {};
var model = void 0;
if (typeof Proxy === 'function') {
var deps = {},
childObs = {},
cache = {};
_.each(obj, function (val, key) {
if (key in $$skipArray) {
return;
}
cache[key] = val;
var dep = deps[key] = observer && observer['__dep' + key] || new Dep();
observer && (observer['__dep' + key] = dep);
childObs[key] = !shallow && observe(val, observer, key);
});
return model = new Proxy(props, {
has: function has(target, key) {
return key in obj;
},
get: function get(target, key) {
if (key in $$skipArray) {
return target[key];
}
var value = cache[key];
if (Dep.target) {
deps[key].depend();
if (childObs[key]) {
childObs[key].dep.depend();
if (_.isArray(value)) {
dependArray(value);
}
}
}
return value;
},
set: function set(target, key, newVal) {
if (key in $$skipArray) {
return target[key] = newVal;
}
var value = cache[key],
dep = deps[key];
if (newVal === value || newVal !== newVal && value !== value) {
return newVal;
}
cache[key] = newVal;
childObs[key] = !shallow && observe(newVal, observer, key);
obj[key] = childObs[key] ? childObs[key].model : newVal;
notify(model, key, dep);
return obj[key];
}
});
}
// if (typeof Proxy === 'function') {
// const deps = {}, childObs = {}, cache = {}
// _.each(obj, function (val, key) {
// if (key in $$skipArray) {
// return
// }
// cache[key] = val
// const dep = deps[key] = (observer && observer['__dep' + key]) || new Dep()
// observer && (observer['__dep' + key] = dep)
// childObs[key] = !shallow && observe(val, observer, key)
// })
// return model = new Proxy(props, {
// has: function (target, key) {
// return key in obj;
// },
// get: function (target, key) {
// if (key in $$skipArray) {
// return target[key]
// }
// const value = cache[key]
// if (Dep.target) {
// deps[key].depend()
// if (childObs[key]) {
// childObs[key].dep.depend()
// if (_.isArray(value)) {
// dependArray(value)
// }
// }
// }
// return value
// },
// set: function (target, key, newVal) {
// if (key in $$skipArray) {
// return target[key] = newVal
// }
// const value = cache[key], dep = deps[key]
// if (newVal === value || (newVal !== newVal && value !== value)) {
// return newVal
// }
// cache[key] = newVal
// childObs[key] = !shallow && observe(newVal, observer, key)
// obj[key] = childObs[key] ? childObs[key].model : newVal
// notify(model, key, dep)
// return obj[key]
// }
// })
// }
_.each(obj, function (val, key) {
if (key in $$skipArray) {
return;
@ -730,9 +728,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
try {
value = this.getter.call(vm, vm);
} catch (e) {
if (this.user) {} else {
throw e;
}
// if (this.user) {
// } else {
throw e;
// }
} finally {
// "touch" every property so they are all tracked as
// dependencies for deep watching
@ -797,9 +796,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var oldValue = this.value;
this.value = value;
if (this.user) {
try {
this.cb.call(this.vm, value, oldValue);
} catch (e) {}
// try {
this.cb.call(this.vm, value, oldValue);
// } catch (e) {
// }
} else {
this.cb.call(this.vm, value, oldValue);
}
@ -824,9 +824,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
// remove self from vm's watcher list
// this is a somewhat expensive operation so we skip it
// if the vm is being destroyed.
if (!this.vm._isBeingDestroyed) {
remove(this.vm._watchers, this);
}
remove(this.vm._watchers, this);
var i = this.deps.length;
while (i--) {
this.deps[i].removeSub(this);
@ -873,10 +871,154 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
}
}
var falsy$1;
var operators = {
'||': falsy$1,
'&&': falsy$1,
'(': falsy$1,
')': falsy$1
};
function runBinaryFunction(binarys) {
var expr = '';
for (var i = 0, len = binarys.length; i < len; i++) {
if (_.isBoolean(binarys[i]) || _.has(operators, binarys[i])) {
expr += binarys[i];
} else {
expr += 'false';
}
}
return new Function('return ' + expr)();
}
function routeToRegExp(route) {
route = route.replace(/\*./g, '[a-zA-Z0-9_]+.');
return '^' + route + '$';
}
function watch(model, expOrFn, cb, options) {
if (isPlainObject(cb)) {
options = cb;
cb = cb.handler;
}
if (typeof cb === 'string') {
cb = model[cb];
}
options = options || {};
options.user = true;
var exps = void 0;
if (_.isFunction(expOrFn) || !(exps = expOrFn.match(/[a-zA-Z0-9_.*]+|[|][|]|[&][&]|[(]|[)]/g)) || exps.length === 1 && !/\*/.test(expOrFn)) {
var watcher = new Watcher(model, expOrFn, cb, options);
if (options.immediate) {
cb(watcher.value);
}
return function unwatchFn() {
watcher.teardown();
};
}
var watchers = [];
var fns = exps.slice();
var complete = false,
running = false;
var callback = function callback(index) {
if (complete === true) {
return;
}
fns[index] = true;
if (runBinaryFunction(fns)) {
complete = true;
cb();
}
if (!running) {
running = true;
nextTick(function () {
complete = false;
running = false;
fns = exps.slice();
});
}
};
_.each(exps, function (exp, i) {
if (_.has(operators, exp)) {
return;
}
//a.**或a.*形式
if (/^[1-9a-zA-Z.]+(\*\*$|\*$)/.test(exp)) {
var isGlobal = /\*\*$/.test(exp);
if (isGlobal) {
//a.**的形式
exp = exp.replace(".**", "");
} else {
//a.*的形式
exp = exp.replace(".*", "");
}
var getter = parsePath(exp);
var v = getter.call(model, model);
var dep = new Dep();
if (isGlobal) {
(v.__ob__._scopeDeps || (v.__ob__._scopeDeps = [])).push(dep);
} else {
(v.__ob__._deps || (v.__ob__._deps = [])).push(dep);
}
var w = new Watcher(model, function () {
dep.depend();
return NaN;
}, function () {
callback(i);
});
watchers.push(function unwatchFn() {
w.teardown();
v.__ob__._scopeDeps && remove(v.__ob__._scopeDeps, dep);
v.__ob__._deps && remove(v.__ob__._deps, dep);
});
return;
}
if (/\*\*$|\*$/.test(exp)) {
throw new Error('not support');
}
//其他含有*的情况,如*.a,*.*.a,a.*.a.*
if (/\*/.test(exp)) {
//补全路径
var parent = model.__ob__.parent,
root = model.__ob__;
while (parent) {
exp = '*.' + exp;
root = parent;
parent = parent.parent;
}
var regStr = routeToRegExp(exp);
var _dep = new Dep();
root._globalDeps || (root._globalDeps = {});
root._globalDeps[regStr] = _dep;
var _w = new Watcher(model, function () {
_dep.depend();
return NaN;
}, function () {
callback(i);
});
watchers.push(function unwatchFn() {
_w.teardown();
root._globalDeps && delete root._globalDeps[regStr];
});
return;
}
var watcher = new Watcher(model, exp, function () {
callback(i);
}, options);
watchers.push(function unwatchFn() {
watcher.teardown();
});
});
return watchers;
}
var computedWatcherOptions = { lazy: true };
function initState(vm, state) {
vm.$$state = observe(state).model;
if (state) {
vm.$$state = observe(state).model;
}
}
function initComputed(vm, computed) {
@ -895,16 +1037,16 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
function defineComputed(vm, computed) {
var props = {};
if (typeof Proxy === 'function') {
return vm.$$computed = new Proxy(props, {
has: function has(target, key) {
return computed && key in computed;
},
get: function get(target, key) {
return createComputedGetter(vm, key)();
}
});
}
// if (typeof Proxy === 'function') {
// return vm.$$computed = new Proxy(props, {
// has: function (target, key) {
// return computed && key in computed
// },
// get: function (target, key) {
// return createComputedGetter(vm, key)()
// }
// })
// }
var shouldCache = true;
for (var key in computed) {
if (!(key in vm)) {
@ -944,10 +1086,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
};
}
function initWatch(vm, watch) {
function initWatch(vm, watch$$1) {
vm._watchers || (vm._watchers = []);
for (var key in watch) {
var handler = watch[key];
for (var key in watch$$1) {
var handler = watch$$1[key];
if (_.isArray(handler)) {
for (var i = 0; i < handler.length; i++) {
vm._watchers.push(createWatcher(vm, key, handler[i]));
@ -958,8 +1100,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
}
}
function createWatcher(vm, keyOrFn, handler, options) {
return Fix.watch(vm.model, keyOrFn, _.bind(handler, vm), options);
function createWatcher(vm, keyOrFn, handler) {
return watch(vm.model, keyOrFn, _.bind(handler, vm.$$model ? vm.model : vm), {
sync: true
});
}
function initMethods(vm, methods) {
@ -970,36 +1114,36 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
function defineProps(vm, keys) {
var props = {};
if (typeof Proxy === 'function') {
return vm.model = new Proxy(props, {
has: function has(target, key) {
return keys.indexOf(key) > -1;
},
get: function get(target, key) {
if (key in $$skipArray) {
return props[key];
}
if (vm.$$computed && key in vm.$$computed) {
return vm.$$computed[key];
}
if (vm.$$state && key in vm.$$state) {
return vm.$$state[key];
}
return vm.$$model[key];
},
set: function set(target, key, val) {
if (key in $$skipArray) {
return props[key] = val;
}
if (vm.$$state && key in vm.$$state) {
return vm.$$state[key] = val;
}
if (vm.$$model && key in vm.$$model) {
return vm.$$model[key] = val;
}
}
});
}
// if (typeof Proxy === 'function') {
// return vm.model = new Proxy(props, {
// has: function (target, key) {
// return keys.indexOf(key) > -1;
// },
// get: function (target, key) {
// if (key in $$skipArray) {
// return props[key]
// }
// if (vm.$$computed && key in vm.$$computed) {
// return vm.$$computed[key]
// }
// if (vm.$$state && key in vm.$$state) {
// return vm.$$state[key]
// }
// return vm.$$model[key]
// },
// set: function (target, key, val) {
// if (key in $$skipArray) {
// return props[key] = val
// }
// if (vm.$$state && key in vm.$$state) {
// return vm.$$state[key] = val
// }
// if (vm.$$model && key in vm.$$model) {
// return vm.$$model[key] = val
// }
// }
// })
// }
var _loop = function _loop(i, len) {
var key = keys[i];
@ -1014,7 +1158,16 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
if (vm.$$state && key in vm.$$state) {
return vm.$$state[key];
}
return vm.$$model[key];
if (vm.$$model && key in vm.$$model) {
return vm.$$model;
}
var p = vm._parent;
while (p) {
if (p.$$context && key in p.$$context) {
return p.$$context[key];
}
p = p._parent;
}
},
set: function set(val) {
if (vm.$$state && key in vm.$$state) {
@ -1023,6 +1176,13 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
if (vm.$$model && key in vm.$$model) {
return vm.$$model[key] = val;
}
var p = vm._parent;
while (p) {
if (p.$$context && key in p.$$context) {
return p.$$context[key] = val;
}
p = p._parent;
}
}
};
}
@ -1034,11 +1194,36 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
vm.model = createViewModel$1({}, props);
}
var VM = function () {
function VM(model) {
_classCallCheck(this, VM);
function defineContext(vm, keys) {
var props = {};
var _loop2 = function _loop2(i, len) {
var key = keys[i];
if (!(key in $$skipArray)) {
props[key] = {
enumerable: true,
configurable: true,
get: function get() {
return vm.model[key];
},
set: function set(val) {
return vm.model[key] = val;
}
};
}
};
for (var i = 0, len = keys.length; i < len; i++) {
_loop2(i, len);
}
vm.$$context = createViewModel$1({}, props);
}
var Model = function () {
function Model(model) {
_classCallCheck(this, Model);
if (model instanceof Observer || model instanceof VM) {
if (model instanceof Observer || model instanceof Model) {
model = model.model;
}
if (_.has(model, '__ob__')) {
@ -1046,23 +1231,25 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
} else {
this.options = model || {};
}
var state = this.state && this.state();
var keys = _.keys(this.$$model).concat(_.keys(state)).concat(_.keys(this.computed));
this._parent = Model.target;
var state = _.isFunction(this.state) ? this.state() : this.state;
var keys = _.keys(this.$$model).concat(_.keys(state)).concat(_.keys(this.computed)).concat(this.context);
defineProps(this, keys);
this.childContext && defineContext(this, this.childContext);
this.$$model && (this.model.__ob__ = this.$$model.__ob__);
state && initState(this, state);
this._init();
initState(this, state);
initComputed(this, this.computed);
initWatch(this, this.watch);
initMethods(this, this.actions);
this._init();
if (this.$$model) {
return this.model;
}
}
VM.prototype._init = function _init() {};
Model.prototype._init = function _init() {};
VM.prototype.destroy = function destroy() {
Model.prototype.destroy = function destroy() {
for (var _key3 in this._computedWatchers) {
this._computedWatchers[_key3].teardown();
}
@ -1074,153 +1261,14 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
});
this._watchers && (this._watchers = []);
this.destroyed && this.destroyed();
this.$$model = null;
this.$$computed = null;
this.$$state = null;
};
return VM;
return Model;
}();
var falsy$1;
var operators = {
'||': falsy$1,
'&&': falsy$1,
'(': falsy$1,
')': falsy$1
};
function runBinaryFunction(binarys) {
var expr = '';
for (var i = 0, len = binarys.length; i < len; i++) {
if (_.isBoolean(binarys[i]) || _.has(operators, binarys[i])) {
expr += binarys[i];
} else {
expr += 'false';
}
}
return new Function('return ' + expr)();
}
function routeToRegExp(route) {
route = route.replace(/\*./g, '[a-zA-Z0-9_]+.');
return '^' + route + '$';
}
function watch(model, expOrFn, cb, options) {
if (isPlainObject(cb)) {
options = cb;
cb = cb.handler;
}
if (typeof cb === 'string') {
cb = model[cb];
}
options = options || {};
options.user = true;
var exps = void 0;
if (_.isFunction(expOrFn) || !(exps = expOrFn.match(/[a-zA-Z0-9_.*]+|[|][|]|[&][&]|[(]|[)]/g)) || exps.length === 1 && !/\*/.test(expOrFn)) {
var watcher = new Watcher(model, expOrFn, cb, options);
if (options.immediate) {
cb(watcher.value);
}
return function unwatchFn() {
watcher.teardown();
};
}
var watchers = [];
var fns = exps.slice();
var complete = false,
running = false;
var callback = function callback(index) {
if (complete === true) {
return;
}
fns[index] = true;
if (runBinaryFunction(fns)) {
complete = true;
cb();
}
if (!running) {
running = true;
nextTick(function () {
complete = false;
running = false;
fns = exps.slice();
});
}
};
_.each(exps, function (exp, i) {
if (_.has(operators, exp)) {
return;
}
//a.**或a.*形式
if (/^[1-9a-zA-Z.]+(\*\*$|\*$)/.test(exp)) {
var isGlobal = /\*\*$/.test(exp);
if (isGlobal) {
//a.**的形式
exp = exp.replace(".**", "");
} else {
//a.*的形式
exp = exp.replace(".*", "");
}
var getter = parsePath(exp);
var v = getter.call(model, model);
var dep = new Dep();
if (isGlobal) {
(v.__ob__._scopeDeps || (v.__ob__._scopeDeps = [])).push(dep);
} else {
(v.__ob__._deps || (v.__ob__._deps = [])).push(dep);
}
var w = new Watcher(model, function () {
dep.depend();
return NaN;
}, function () {
callback(i);
});
watchers.push(function unwatchFn() {
w.teardown();
v.__ob__._scopeDeps && remove(v.__ob__._scopeDeps, dep);
v.__ob__._deps && remove(v.__ob__._deps, dep);
});
return;
}
if (/\*\*$|\*$/.test(exp)) {
throw new Error('not support');
}
//其他含有*的情况,如*.a,*.*.a,a.*.a.*
if (/\*/.test(exp)) {
//补全路径
var parent = model.__ob__.parent,
root = model.__ob__;
while (parent) {
exp = '*.' + exp;
root = parent;
parent = parent.parent;
}
var regStr = routeToRegExp(exp);
var _dep = new Dep();
root._globalDeps || (root._globalDeps = {});
root._globalDeps[regStr] = _dep;
var _w = new Watcher(model, function () {
_dep.depend();
return NaN;
}, function () {
callback(i);
});
watchers.push(function unwatchFn() {
_w.teardown();
root._globalDeps && delete root._globalDeps[regStr];
});
return;
}
var watcher = new Watcher(model, exp, function () {
callback(i);
}, options);
watchers.push(function unwatchFn() {
watcher.teardown();
});
});
return watchers;
}
function toJSON(model) {
var result = void 0;
if (_.isArray(model)) {
@ -1249,7 +1297,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
exports.define = define;
exports.version = version;
exports.$$skipArray = $$skipArray;
exports.VM = VM;
exports.Model = Model;
exports.observerState = observerState;
exports.Observer = Observer;
exports.observe = observe;

16
dist/resource.css vendored

@ -25,7 +25,7 @@ body {
-ms-user-select: none;
-o-user-select: none;
user-select: none;
color: #666666;
color: #3d4d66;
font: normal 12px "Microsoft YaHei", "Hiragino Sans GB W3";
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
@ -398,7 +398,7 @@ textarea::-webkit-scrollbar-thumb:hover {
.search-close-h-font:hover .b-font:before,
.search-close-h-font.hover .b-font:before {
content: "\e600";
color: #e85050;
color: #faaa39;
}
.search-close-h-font.disabled .b-font:before {
content: "\e600";
@ -540,7 +540,7 @@ textarea::-webkit-scrollbar-thumb:hover {
}
.dot-e-font:active .b-font:before {
content: "\e606";
color: #3f8ce8;
color: #3685f2;
}
.dot-e-font.disabled .b-font:before {
content: "\e606";
@ -864,7 +864,7 @@ textarea::-webkit-scrollbar-thumb:hover {
.trigger-triangle-font:active .b-font:before,
.trigger-triangle-font.active .b-font:before {
content: "\e66a";
color: #3f8ce8;
color: #3685f2;
}
.trigger-triangle-font.disabled .b-font:before {
content: "\e66a";
@ -923,11 +923,11 @@ textarea::-webkit-scrollbar-thumb:hover {
}
.check-font .b-font:before {
content: "\e611";
color: #3f8ce8;
color: #3685f2;
}
.check-font.disabled .b-font:before {
content: "\e611";
color: #3f8ce8;
color: #3685f2;
}
.item-check-font .b-font {
*zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = '&#xe611;');
@ -971,11 +971,11 @@ textarea::-webkit-scrollbar-thumb:hover {
}
.drag-tag-font .b-font:before {
content: "\e600";
color: #f07d0a;
color: #ff4949;
}
.drag-tag-font.disabled .b-font:before {
content: "\e600";
color: #f07d0a;
color: #ff4949;
}
.less-font .b-font {
*zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = '&#xe633;');

20
dist/widget.css vendored

@ -73,7 +73,7 @@
}
.bi-interactive-arrangement .interactive-arrangement-dragtag-line {
z-index: 1000000000;
background-color: #f07d0a;
background-color: #ff4949;
}
.bi-interactive-arrangement .interactive-arrangement-dragtag-icon {
z-index: 1000000000;
@ -95,19 +95,19 @@
border-radius: 2px;
}
.bi-multidate-popup .multidate-popup-label {
color: #3f8ce8;
color: #3685f2;
font-size: 14px;
}
.bi-multidate-popup .multidate-popup-item:active,
.bi-multidate-popup .multidate-popup-item.active {
background-color: #3f8ce8;
background-color: #3685f2;
color: #ffffff;
-webkit-border-radius: 2px 2px 0 0;
-moz-border-radius: 2px 2px 0 0;
border-radius: 2px 2px 0 0;
}
.bi-multidate-popup .multidate-popup-button {
color: #3f8ce8;
color: #3685f2;
font-size: 14px;
}
.bi-multidate-segment .bi-multidate-editor {
@ -128,13 +128,13 @@
border-radius: 2px 2px 2px 2px;
}
.bi-multi-select-search-pane .multi-select-toolbar {
color: #e85050;
color: #faaa39;
}
.bi-multi-select-check-selected-button {
z-index: 1;
}
.bi-multi-tree-check-pane .multi-tree-check-selected {
color: #3f8ce8;
color: #3685f2;
}
.bi-multi-tree-combo .multi-select-trigger-icon-button {
font-size: 16px;
@ -143,7 +143,7 @@
min-height: 170px;
}
.bi-multi-tree-check-selected-button .trigger-check-selected {
color: #3f8ce8;
color: #3685f2;
z-index: 1;
}
.bi-number-editor {
@ -190,7 +190,7 @@
font-size: 14px;
}
.bi-number-interval.number-error .bi-input {
color: #e85050 !important;
color: #faaa39 !important;
}
.bi-page-table-cell {
-webkit-user-select: text;
@ -347,10 +347,10 @@
border-radius: 3px;
}
.bi-param-time-interval.time-error .bi-input {
color: #e85050;
color: #faaa39;
}
.bi-param-time-interval.time-error .sign-editor-text {
color: #e85050;
color: #faaa39;
}
.bi-year-popup .year-popup-navigation {
line-height: 30px;

1614
dist/widget.js vendored

File diff suppressed because it is too large Load Diff

2
package.json

@ -1,6 +1,6 @@
{
"name": "fineui",
"version": "1.0.1",
"version": "1.1.0",
"description": "fineui",
"main": "index.js",
"dependencies": {},

48
src/base/combination/combo.js

@ -129,18 +129,20 @@ BI.Combo = BI.inherit(BI.Widget, {
}
});
self.element.on("mouseleave." + self.getName(), function (e) {
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
if (self.popupView) {
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
});
self.popupView.element.off("mouseenter." + self.getName());
});
self.popupView.element.off("mouseenter." + self.getName());
});
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
}
});
break;
case "click":
@ -186,18 +188,20 @@ BI.Combo = BI.inherit(BI.Widget, {
st(e);
});
self.element.on("mouseleave." + self.getName(), function (e) {
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
if (self.popupView) {
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
});
self.popupView.element.off("mouseenter." + self.getName());
});
self.popupView.element.off("mouseenter." + self.getName());
});
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
}
});
break;
}

2
src/base/single/text.js

@ -114,7 +114,7 @@ BI.Text = BI.inherit(BI.Single, {
setText: function (text) {
BI.Text.superclass.setText.apply(this, arguments);
this.options.text = text;
this.text.element.html((text + "").replaceAll(" ", "&nbsp;"));
this.text.element.html(BI.Func.formatSpecialCharInHtml(text));
}
});

5
src/base/table/table.grid.quick.js

@ -169,6 +169,11 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
this.bottomRightGrid.setEstimatedColumnSize((o.columnSize.length - freezeColLength) > 0 ? (totalRightColumnSize / (o.columnSize.length - freezeColLength)) : 0);
this.bottomRightGrid.setEstimatedRowSize(o.rowSize);
this.topLeftGrid.setColumnCount(freezeColLength);
this.topRightGrid.setColumnCount(o.columnSize.length - freezeColLength);
this.bottomLeftGrid.setColumnCount(freezeColLength);
this.bottomRightGrid.setColumnCount(o.columnSize.length - freezeColLength);
var items = this.contextLayout.attr("items");
items[1].left = regionSize;
items[2].top = this._getFreezeHeaderHeight();

2
src/case/floatbox/floatboxsection.bar.js

@ -41,7 +41,7 @@ BI.BarPopoverSection = BI.inherit(BI.PopoverSection, {
BI.createWidget({
type: 'bi.right_vertical_adapt',
element: south,
hgap: 5,
lgap: 10,
items: [this.cancel, this.sure]
});
},

6
src/core/func/dom.js

@ -20,7 +20,7 @@ BI.extend(jQuery.fn, {
*/
__textKeywordMarked__: function (text, keyword, py) {
if (!BI.isKey(keyword) || (text + "").length > 100) {
return this.html((text + "").replaceAll(" ", "&nbsp;"));
return this.html(BI.Func.formatSpecialCharInHtml(text));
}
keyword = keyword + "";
keyword = BI.toUpperCase(keyword);
@ -43,7 +43,7 @@ BI.extend(jQuery.fn, {
if (tidx >= 0) {
this.append(textLeft.substr(0, tidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.html(textLeft.substr(tidx, keyword.length).replaceAll(" ", "&nbsp;")));
.html(BI.Func.formatSpecialCharInHtml(textLeft.substr(tidx, keyword.length))));
textLeft = textLeft.substr(tidx + keyword.length);
if (py != null) {
@ -52,7 +52,7 @@ BI.extend(jQuery.fn, {
} else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) {
this.append(textLeft.substr(0, pidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.html(textLeft.substr(pidx, keyword.length).replaceAll(" ", "&nbsp;")));
.html(BI.Func.formatSpecialCharInHtml(textLeft.substr(pidx, keyword.length))));
if (py != null) {
py = py.substr(pidx + keyword.length);
}

21
src/core/func/function.js

@ -68,6 +68,27 @@ BI.extend(BI.Func, {
matched: matched,
finded: finded
}
},
/**
* 将字符串中的尖括号等字符encode成html能解析的形式
* @param str
*/
formatSpecialCharInHtml: function (str) {
return (str + "").replaceAll("\\s|<=?|>=?", function (str) {
switch (str) {
case "<":
return "&lt;";
case "<=":
return "&le;";
case ">":
return "&gt;";
case ">=":
return "&ge;";
default:
return "&nbsp;";
}
});
}
});

7
src/core/inject.js

@ -77,6 +77,9 @@
return stores[type];
}
return stores[type] = new storeInjection[type](config);
},
releaseStore: function (type) {
delete stores[type];
}
}
@ -91,6 +94,10 @@
providerInstance[type] = new providers[type].$get()(config);
}
return providerInstance[type];
},
releaseProvider: function (type) {
delete providers[type];
delete providerInstance[type];
}
}

4
src/css/base/formula/codemirror.css

@ -184,7 +184,7 @@
.cm-s-default span[class*="fieldName"] {
display: inline-block;
color: white;
background: #3f8ce8;
background: #3685f2;
padding: 0 5px;
margin: 1px 1px;
}
@ -206,7 +206,7 @@
border-radius: 3px;
}
.cm-s-default span[class*="#"] {
color: #3f8ce8;
color: #3685f2;
}
.cm-s-default .cm-error {
color: #f00;

12
src/css/base/single/button/button.css

@ -41,7 +41,7 @@ body .bi-button.button-common.clear,
#body .bi-button.button-common.clear,
body .bi-button.button-common.clear .b-font:before,
#body .bi-button.button-common.clear .b-font:before {
color: #3f8ce8;
color: #3685f2;
}
body .bi-button.button-ignore,
#body .bi-button.button-ignore {
@ -79,11 +79,11 @@ body .bi-button.button-success.clear,
#body .bi-button.button-success.clear,
body .bi-button.button-success.clear .b-font:before,
#body .bi-button.button-success.clear .b-font:before {
color: #0c6d23;
color: #5cb75d;
}
body .bi-button.button-warning,
#body .bi-button.button-warning {
background-color: #e85050;
background-color: #ff4949;
border-color: #e85050;
}
body .bi-button.button-warning,
@ -101,7 +101,7 @@ body .bi-button.button-warning.clear,
#body .bi-button.button-warning.clear,
body .bi-button.button-warning.clear .b-font:before,
#body .bi-button.button-warning.clear .b-font:before {
color: #e85050;
color: #faaa39;
}
body .bi-button.button-common.disabled,
#body .bi-button.button-common.disabled,
@ -153,7 +153,7 @@ body .bi-button.button-ignore.disabled,
#body .bi-button.button-ignore.disabled,
body .bi-button.button-ignore.disabled .b-font:before,
#body .bi-button.button-ignore.disabled .b-font:before {
color: #cccccc !important;
color: #9ea6b2 !important;
}
body .bi-button.button-common.disabled.clear,
#body .bi-button.button-common.disabled.clear,
@ -182,7 +182,7 @@ body .bi-button.button-warning.disabled.clear .b-font:before,
#body .bi-button.button-warning.disabled.clear .b-font:before,
body .bi-button.button-ignore.disabled.clear .b-font:before,
#body .bi-button.button-ignore.disabled.clear .b-font:before {
color: #cccccc !important;
color: #9ea6b2 !important;
}
body .bi-button.button-common.disabled.clear:hover,
#body .bi-button.button-common.disabled.clear:hover,

2
src/css/base/single/button/item.singleselect.icontext.css

@ -1,4 +1,4 @@
.bi-single-select-icon-text-item:active .b-font:before,
.bi-single-select-icon-text-item.active .b-font:before {
color: #3f8ce8;
color: #3685f2;
}

2
src/css/base/single/editor/editor.code.css

@ -9,7 +9,7 @@
display: inline-block;
}
.bi-code-editor .error-param {
color: #e85050;
color: #faaa39;
padding: 0 5px;
margin: 1px 1px;
display: inline-block;

2
src/css/base/single/input/input.css

@ -15,5 +15,5 @@
.bi-input.bi-input-error,
.bi-textarea.bi-input-error {
border: none;
color: #e85050 !important;
color: #faaa39 !important;
}

2
src/css/base/single/tip/tip.bubble.css

@ -6,5 +6,5 @@
-moz-border-radius: 2px;
border-radius: 2px;
background: #fddddd;
color: #e85050;
color: #faaa39;
}

4
src/css/base/single/tip/tip.toast.css

@ -6,9 +6,9 @@
}
.bi-toast.toast-success {
background: #e1f4e7;
color: #0c6d23;
color: #5cb75d;
}
.bi-toast.toast-warning {
background: #fddddd;
color: #e85050;
color: #faaa39;
}

2
src/css/base/single/tip/tip.tooltip.css

@ -12,6 +12,6 @@
}
.bi-tooltip.tooltip-warning {
background: #fddddd;
color: #e85050;
color: #faaa39;
border: 1px solid #f4cbcb;
}

148
src/css/core/utils/common.css

@ -1,15 +1,15 @@
.base-disabled {
cursor: default !important;
color: #cccccc !important;
color: #9ea6b2 !important;
}
.base-disabled .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.base-disabled .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.base-disabled .b-font:before {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .base-disabled {
color: #666666 !important;
@ -40,13 +40,13 @@
}
.bi-background {
background-color: #eff1f4;
color: #666666;
color: #3d4d66;
}
.bi-background .bi-input {
color: #666666;
color: #3d4d66;
}
.bi-background .bi-textarea {
color: #666666;
color: #3d4d66;
}
.bi-theme-dark .bi-background {
background-color: #191b2b;
@ -60,13 +60,13 @@
}
.bi-card {
background-color: #ffffff;
color: #666666;
color: #3d4d66;
}
.bi-card .bi-input {
color: #666666;
color: #3d4d66;
}
.bi-card .bi-textarea {
color: #666666;
color: #3d4d66;
}
.bi-theme-dark .bi-card {
background-color: #242640;
@ -79,13 +79,13 @@
color: #cccccc;
}
.bi-disabled {
color: #cccccc;
color: #9ea6b2;
}
.bi-disabled .bi-input {
color: #cccccc;
color: #9ea6b2;
}
.bi-disabled .bi-textarea {
color: #cccccc;
color: #9ea6b2;
}
.bi-theme-dark .bi-disabled {
color: #666666;
@ -97,13 +97,13 @@
color: #666666;
}
.bi-tips {
color: #999999;
color: #c4c9d1;
}
.bi-tips .bi-input {
color: #999999;
color: #c4c9d1;
}
.bi-tips .bi-textarea {
color: #999999;
color: #c4c9d1;
}
.bi-border {
border: 1px solid #d4dadd;
@ -136,22 +136,22 @@
border-bottom: 1px solid #525466;
}
.bi-keyword-red-mark {
color: #f07d0a;
color: #ff4949;
}
.bi-keyword-red-mark .bi-input {
color: #f07d0a;
color: #ff4949;
}
.bi-keyword-red-mark .bi-textarea {
color: #f07d0a;
color: #ff4949;
}
.bi-high-light {
color: #3f8ce8;
color: #3685f2;
}
.bi-high-light .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-high-light .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-high-light-background {
background-color: #3f8ce8;
@ -245,22 +245,22 @@
.bi-list-item.disabled:hover,
.bi-list-item.disabled:active {
background-color: transparent !important;
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item.disabled .bi-input,
.bi-list-item.disabled:hover .bi-input,
.bi-list-item.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item.disabled .bi-textarea,
.bi-list-item.disabled:hover .bi-textarea,
.bi-list-item.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item.disabled .bi-high-light,
.bi-list-item.disabled:hover .bi-high-light,
.bi-list-item.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item:hover,
.bi-theme-dark .bi-list-item.hover {
@ -302,45 +302,45 @@
border: 1px solid #178cdf;
}
.bi-list-item-simple {
color: #999999;
color: #c4c9d1;
}
.bi-list-item-simple .bi-input {
color: #999999;
color: #c4c9d1;
}
.bi-list-item-simple .bi-textarea {
color: #999999;
color: #c4c9d1;
}
.bi-list-item-simple:hover,
.bi-list-item-simple.hover {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-simple:hover .bi-input,
.bi-list-item-simple.hover .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-simple:hover .bi-textarea,
.bi-list-item-simple.hover .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-simple.disabled,
.bi-list-item-simple.disabled:hover,
.bi-list-item-simple.disabled:active {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-simple.disabled .bi-input,
.bi-list-item-simple.disabled:hover .bi-input,
.bi-list-item-simple.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-simple.disabled .bi-textarea,
.bi-list-item-simple.disabled:hover .bi-textarea,
.bi-list-item-simple.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-simple.disabled .bi-high-light,
.bi-list-item-simple.disabled:hover .bi-high-light,
.bi-list-item-simple.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-effect:hover {
color: #1a1a1a;
@ -353,35 +353,35 @@
}
.bi-list-item-effect.active,
.bi-list-item-effect:active {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-effect.active .bi-input,
.bi-list-item-effect:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-effect.active .bi-textarea,
.bi-list-item-effect:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-effect.disabled,
.bi-list-item-effect.disabled:hover,
.bi-list-item-effect.disabled:active {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-effect.disabled .bi-input,
.bi-list-item-effect.disabled:hover .bi-input,
.bi-list-item-effect.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-effect.disabled .bi-textarea,
.bi-list-item-effect.disabled:hover .bi-textarea,
.bi-list-item-effect.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-effect.disabled .bi-high-light,
.bi-list-item-effect.disabled:hover .bi-high-light,
.bi-list-item-effect.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item-effect:hover {
color: #ffffff;
@ -394,15 +394,15 @@
}
.bi-theme-dark .bi-list-item-effect.active,
.bi-theme-dark .bi-list-item-effect:active {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-effect.active .bi-input,
.bi-theme-dark .bi-list-item-effect:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-effect.active .bi-textarea,
.bi-theme-dark .bi-list-item-effect:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-effect.disabled,
.bi-theme-dark .bi-list-item-effect.disabled:hover,
@ -441,38 +441,38 @@
}
.bi-list-item-active.active,
.bi-list-item-active:active {
color: #3f8ce8;
color: #3685f2;
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item-active.active .bi-input,
.bi-list-item-active:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-active.active .bi-textarea,
.bi-list-item-active:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-active.disabled,
.bi-list-item-active.disabled:hover,
.bi-list-item-active.disabled:active {
background-color: transparent !important;
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active.disabled .bi-input,
.bi-list-item-active.disabled:hover .bi-input,
.bi-list-item-active.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active.disabled .bi-textarea,
.bi-list-item-active.disabled:hover .bi-textarea,
.bi-list-item-active.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active.disabled .bi-high-light,
.bi-list-item-active.disabled:hover .bi-high-light,
.bi-list-item-active.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item-active:hover,
.bi-theme-dark .bi-list-item-active.hover {
@ -490,17 +490,17 @@
}
.bi-theme-dark .bi-list-item-active.active,
.bi-theme-dark .bi-list-item-active:active {
color: #3f8ce8;
color: #3685f2;
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item-active.active .bi-input,
.bi-theme-dark .bi-list-item-active:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-active.active .bi-textarea,
.bi-theme-dark .bi-list-item-active:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-active.disabled,
.bi-theme-dark .bi-list-item-active.disabled:hover,
@ -538,37 +538,37 @@
}
.bi-list-item-active2.active,
.bi-list-item-active2:active {
color: #3f8ce8;
color: #3685f2;
background-color: #ffffff;
}
.bi-list-item-active2.active .bi-input,
.bi-list-item-active2:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-active2.active .bi-textarea,
.bi-list-item-active2:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-list-item-active2.disabled,
.bi-list-item-active2.disabled:hover,
.bi-list-item-active2.disabled:active {
background-color: transparent !important;
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active2.disabled .bi-input,
.bi-list-item-active2.disabled:hover .bi-input,
.bi-list-item-active2.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active2.disabled .bi-textarea,
.bi-list-item-active2.disabled:hover .bi-textarea,
.bi-list-item-active2.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-active2.disabled .bi-high-light,
.bi-list-item-active2.disabled:hover .bi-high-light,
.bi-list-item-active2.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item-active2:hover,
.bi-theme-dark .bi-list-item-active2.hover {
@ -585,16 +585,16 @@
}
.bi-theme-dark .bi-list-item-active2.active,
.bi-theme-dark .bi-list-item-active2:active {
color: #3f8ce8;
color: #3685f2;
background-color: #242640;
}
.bi-theme-dark .bi-list-item-active2.active .bi-input,
.bi-theme-dark .bi-list-item-active2:active .bi-input {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-active2.active .bi-textarea,
.bi-theme-dark .bi-list-item-active2:active .bi-textarea {
color: #3f8ce8;
color: #3685f2;
}
.bi-theme-dark .bi-list-item-active2.disabled,
.bi-theme-dark .bi-list-item-active2.disabled:hover,
@ -651,23 +651,23 @@
.bi-list-item-select.disabled,
.bi-list-item-select.disabled:hover,
.bi-list-item-select.disabled:active {
color: #cccccc !important;
color: #9ea6b2 !important;
background-color: transparent !important;
}
.bi-list-item-select.disabled .bi-input,
.bi-list-item-select.disabled:hover .bi-input,
.bi-list-item-select.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-select.disabled .bi-textarea,
.bi-list-item-select.disabled:hover .bi-textarea,
.bi-list-item-select.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-select.disabled .bi-high-light,
.bi-list-item-select.disabled:hover .bi-high-light,
.bi-list-item-select.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item-select:hover,
.bi-theme-dark .bi-list-item-select.hover {
@ -754,23 +754,23 @@
.bi-list-item-none.disabled,
.bi-list-item-none.disabled:hover,
.bi-list-item-none.disabled:active {
color: #cccccc !important;
color: #9ea6b2 !important;
background-color: transparent !important;
}
.bi-list-item-none.disabled .bi-input,
.bi-list-item-none.disabled:hover .bi-input,
.bi-list-item-none.disabled:active .bi-input {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-none.disabled .bi-textarea,
.bi-list-item-none.disabled:hover .bi-textarea,
.bi-list-item-none.disabled:active .bi-textarea {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-list-item-none.disabled .bi-high-light,
.bi-list-item-none.disabled:hover .bi-high-light,
.bi-list-item-none.disabled:active .bi-high-light {
color: #cccccc !important;
color: #9ea6b2 !important;
}
.bi-theme-dark .bi-list-item-none:hover,
.bi-theme-dark .bi-list-item-none.hover {

2
src/css/resource/app.css

@ -25,7 +25,7 @@ body {
-ms-user-select: none;
-o-user-select: none;
user-select: none;
color: #666666;
color: #3d4d66;
font: normal 12px "Microsoft YaHei", "Hiragino Sans GB W3";
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;

14
src/css/resource/font.css

@ -69,7 +69,7 @@
.search-close-h-font:hover .b-font:before,
.search-close-h-font.hover .b-font:before {
content: "\e600";
color: #e85050;
color: #faaa39;
}
.search-close-h-font.disabled .b-font:before {
content: "\e600";
@ -211,7 +211,7 @@
}
.dot-e-font:active .b-font:before {
content: "\e606";
color: #3f8ce8;
color: #3685f2;
}
.dot-e-font.disabled .b-font:before {
content: "\e606";
@ -535,7 +535,7 @@
.trigger-triangle-font:active .b-font:before,
.trigger-triangle-font.active .b-font:before {
content: "\e66a";
color: #3f8ce8;
color: #3685f2;
}
.trigger-triangle-font.disabled .b-font:before {
content: "\e66a";
@ -594,11 +594,11 @@
}
.check-font .b-font:before {
content: "\e611";
color: #3f8ce8;
color: #3685f2;
}
.check-font.disabled .b-font:before {
content: "\e611";
color: #3f8ce8;
color: #3685f2;
}
.item-check-font .b-font {
*zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = '&#xe611;');
@ -642,11 +642,11 @@
}
.drag-tag-font .b-font:before {
content: "\e600";
color: #f07d0a;
color: #ff4949;
}
.drag-tag-font.disabled .b-font:before {
content: "\e600";
color: #f07d0a;
color: #ff4949;
}
.less-font .b-font {
*zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = '&#xe633;');

2
src/css/widget/interactivearrangement/interactivearrangement.css

@ -1,6 +1,6 @@
.bi-interactive-arrangement .interactive-arrangement-dragtag-line {
z-index: 1000000000;
background-color: #f07d0a;
background-color: #ff4949;
}
.bi-interactive-arrangement .interactive-arrangement-dragtag-icon {
z-index: 1000000000;

6
src/css/widget/multidate/multidate.popup.css

@ -1,16 +1,16 @@
.bi-multidate-popup .multidate-popup-label {
color: #3f8ce8;
color: #3685f2;
font-size: 14px;
}
.bi-multidate-popup .multidate-popup-item:active,
.bi-multidate-popup .multidate-popup-item.active {
background-color: #3f8ce8;
background-color: #3685f2;
color: #ffffff;
-webkit-border-radius: 2px 2px 0 0;
-moz-border-radius: 2px 2px 0 0;
border-radius: 2px 2px 0 0;
}
.bi-multidate-popup .multidate-popup-button {
color: #3f8ce8;
color: #3685f2;
font-size: 14px;
}

2
src/css/widget/multiselect/search/multiselect.search.pane.css

@ -1,3 +1,3 @@
.bi-multi-select-search-pane .multi-select-toolbar {
color: #e85050;
color: #faaa39;
}

2
src/css/widget/multitree/check/multi.tree.check.pane.css

@ -1,3 +1,3 @@
.bi-multi-tree-check-pane .multi-tree-check-selected {
color: #3f8ce8;
color: #3685f2;
}

2
src/css/widget/multitree/trigger/multi.tree.button.checkselected.css

@ -1,4 +1,4 @@
.bi-multi-tree-check-selected-button .trigger-check-selected {
color: #3f8ce8;
color: #3685f2;
z-index: 1;
}

2
src/css/widget/numberinterval/numberinterval.css

@ -37,5 +37,5 @@
font-size: 14px;
}
.bi-number-interval.number-error .bi-input {
color: #e85050 !important;
color: #faaa39 !important;
}

4
src/css/widget/timeinterval/timeinterval.css

@ -1,6 +1,6 @@
.bi-param-time-interval.time-error .bi-input {
color: #e85050;
color: #faaa39;
}
.bi-param-time-interval.time-error .sign-editor-text {
color: #e85050;
color: #faaa39;
}

18
src/less/lib/constant.less

@ -16,18 +16,18 @@
//font color
@font-color-black: #1a1a1a;//
@font-color-normal: #666666;//
@font-color-normal: #3d4d66;//
@font-color-normal-theme-dark: #cccccc;//
@font-color-disabled: #cccccc;//
@font-color-disabled: #9ea6b2;//
@font-color-disabled-theme-dark: #666666;//
@font-color-tips: #999999;//
@font-color-tips: #c4c9d1;//
@font-color-dark: #d4dadd;
@font-color-gray: #999999;
@font-color-white: #ffffff;//
@font-color-highlight: #3f8ce8;
@font-color-success: #0c6d23;
@font-color-warning: #e85050;//
@font-color-redmark: #f07d0a;//
@font-color-highlight: #3685f2;
@font-color-success: #5cb75d;
@font-color-warning: #faaa39;//
@font-color-redmark: #ff4949;//
@font-color-orange: #fbb03b;//
//background color
@ -42,8 +42,8 @@
@background-color-disabled: #cccccc;
@background-color-alert: #fddddd;
@background-color-warning: #fbb03b;
@background-color-negative: #e85050;
@background-color-warning: #faaa39;
@background-color-negative: #ff4949;
@background-color-dark-success: #58cc7d;
@background-color-light-success: #e1f4e7;

7
src/widget/multidate/multidate.popup.js

@ -214,6 +214,11 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
this.textButton.setEnable(false);
}
},
_checkValueValid: function (value) {
return BI.isNotNull(value) && BI.isNotEmptyObject(value) && BI.isNotEmptyString(value);
},
setValue: function (v) {
this.storeValue = v;
var self = this, date;
@ -269,7 +274,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
self._setInnerValue(this.day);
break;
default:
if (BI.isNull(value) || BI.isEmptyObject(value)) {
if (!this._checkValueValid(value)) {
var date = new Date();
this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YMD_CARD);
this.ymd.setValue({

2
src/widget/multiselecttree/multiselecttree.js

@ -95,7 +95,7 @@ BI.MultiSelectTree = BI.inherit(BI.Widget, {
element: this,
items: [{
el: this.searcher,
height: 30
height: 24
}, {
el: this.adapter,
height: "fill"

157
src/widget/singleselect/search/singleselect.search.loader.js

@ -0,0 +1,157 @@
/**
* 单选加载数据搜索loader面板
* Created by guy on 15/11/4.
* @class BI.SingleSelectSearchLoader
* @extends Widget
*/
BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectSearchLoader.superclass._defaultConfig.apply(this, arguments), {
baseCls: 'bi-single-select-search-loader',
itemsCreator: BI.emptyFn,
keywordGetter: BI.emptyFn,
valueFormatter: BI.emptyFn
});
},
_init: function () {
BI.SingleSelectSearchLoader.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
var hasNext = false;
this.button_group = BI.createWidget({
type: "bi.single_select_list",
element: this,
logic: {
dynamic: false
},
el: {
tipText: BI.i18nText("BI-No_Select"),
el: {
type: "bi.loader",
isDefaultInit: false,
logic: {
dynamic: true,
scrolly: true
},
el: {
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
behaviors: {
redmark: function () {
return true;
}
},
layouts: [{
type: "bi.vertical"
}]
}
}
},
itemsCreator: function (op, callback) {
self.storeValue && (op = BI.extend(op || {}, {
selectedValues: self.storeValue.value
}));
opts.itemsCreator(op, function (ob) {
var keyword = ob.keyword = opts.keywordGetter();
hasNext = ob.hasNext;
var firstItems = [];
if (op.times === 1 && self.storeValue) {
var json = BI.map(self.storeValue.value, function (i, v) {
var txt = opts.valueFormatter(v) || v;
return {
text: txt,
value: v,
title: txt,
selected: false
}
});
firstItems = self._createItems(json);
}
callback(firstItems.concat(self._createItems(ob.items)), keyword);
if (op.times === 1 && self.storeValue) {
self.setValue(self.storeValue);
}
});
},
hasNext: function () {
return hasNext;
}
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.button_group.on(BI.SingleSelectList.EVENT_CHANGE, function () {
self.fireEvent(BI.SingleSelectSearchLoader.EVENT_CHANGE, arguments);
});
},
_createItems: function (items) {
return BI.createItems(items, {
type: "bi.single_select_radio_item",
logic: {
dynamic: false
},
height: 25,
selected: false
})
},
_filterValues: function (src) {
var o = this.options;
var keyword = o.keywordGetter();
var values = BI.deepClone(src.value) || [];
var newValues = BI.map(values, function (i, v) {
return {
text: o.valueFormatter(v) || v,
value: v
};
});
if (BI.isKey(keyword)) {
var search = BI.Func.getSearchResult(newValues, keyword);
values = search.matched.concat(search.finded);
}
return BI.map(values, function (i, v) {
return {
text: v.text,
title: v.text,
value: v.value,
selected: false
}
})
},
setValue: function (v) {
//暂存的值一定是新的值,不然v改掉后,storeValue也跟着改了
this.storeValue = BI.deepClone(v);
this.button_group.setValue(v);
},
getValue: function () {
return this.button_group.getValue();
},
getAllButtons: function () {
return this.button_group.getAllButtons();
},
empty: function () {
this.button_group.empty();
},
populate: function (items) {
this.button_group.populate.apply(this.button_group, arguments);
},
resetHeight: function (h) {
this.button_group.resetHeight(h);
},
resetWidth: function (w) {
this.button_group.resetWidth(w);
}
});
BI.SingleSelectSearchLoader.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.single_select_search_loader', BI.SingleSelectSearchLoader);

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

@ -0,0 +1,98 @@
/**
*
* 在搜索框中输入文本弹出的面板
* @class BI.SingleSelectSearchPane
* @extends Widget
*/
BI.SingleSelectSearchPane = BI.inherit(BI.Widget, {
constants: {
height: 25,
lgap: 10,
tgap: 5
},
_defaultConfig: function () {
return BI.extend(BI.SingleSelectSearchPane.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-search-pane bi-card",
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
keywordGetter: BI.emptyFn
});
},
_init: function () {
BI.SingleSelectSearchPane.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: 'single-select-toolbar',
height: this.constants.height
});
this.loader = BI.createWidget({
type: "bi.single_select_search_loader",
keywordGetter: o.keywordGetter,
valueFormatter: o.valueFormatter,
itemsCreator: function (op, callback) {
o.itemsCreator.apply(self, [op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
}]);
}
});
this.loader.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.resizer = BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: this.tooltipClick,
height: 0
}, {
el: this.loader
}]
});
this.tooltipClick.setVisible(false);
},
setKeyword: function (keyword) {
var btn;
var isVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === 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();
}
},
hasMatched: function () {
return this.tooltipClick.isVisible();
},
setValue: function (v) {
this.loader.setValue(v);
},
getValue: function () {
return this.loader.getValue();
},
empty: function () {
this.loader.empty();
},
populate: function (items) {
this.loader.populate.apply(this.loader, arguments);
}
});
BI.SingleSelectSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.single_select_search_pane", BI.SingleSelectSearchPane);

361
src/widget/singleselect/singleselect.combo.js

@ -0,0 +1,361 @@
/**
*
* @class BI.SingleSelectCombo
* @extends BI.Single
*/
BI.SingleSelectCombo = BI.inherit(BI.Single, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: 'bi-single-select-combo',
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 28
});
},
_init: function () {
BI.SingleSelectCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var assertShowValue = function () {
BI.isKey(self._startValue) && (self.storeValue.value = [self._startValue]);
self.trigger.getSearcher().setState(self.storeValue);
};
this.storeValue = {};
//标记正在请求数据
this.requesting = false;
this.trigger = BI.createWidget({
type: "bi.single_select_trigger",
height: o.height,
// adapter: this.popup,
masker: {
offset: {
left: 1,
top: 1,
right: 2,
bottom: 33
}
},
valueFormatter: o.valueFormatter,
itemsCreator: function (op, callback) {
o.itemsCreator(op, function (res) {
if (op.times === 1 && BI.isNotNull(op.keywords)) {
//预防trigger内部把当前的storeValue改掉
self.trigger.setValue(BI.deepClone(self.getValue()));
}
callback.apply(self, arguments);
});
}
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_START, function () {
self._setStartValue("");
this.getSearcher().setValue(self.storeValue);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_STOP, function () {
self._setStartValue("");
});
this.trigger.on(BI.SingleSelectTrigger.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("");
})
}
});
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_CHANGE, function (value, obj) {
if (obj instanceof BI.MultiSelectBar) {
self._joinAll(this.getValue(), function () {
assertShowValue();
});
} else {
self._join(this.getValue(), function () {
assertShowValue();
});
}
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_COUNTER_CLICK, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.combo = BI.createWidget({
type: "bi.combo",
toggle: false,
el: this.trigger,
adjustLength: 1,
popup: {
type: 'bi.single_select_popup_view',
ref: function () {
self.popup = this;
self.trigger.setAdapter(this);
},
listeners: [{
eventName: BI.SingleSelectPopupView.EVENT_CHANGE,
action: function () {
self.storeValue = this.getValue();
self._adjust(function () {
assertShowValue();
});
}
}, {
eventName: BI.SingleSelectPopupView.EVENT_CLICK_CONFIRM,
action: function () {
self._defaultState();
}
}, {
eventName: BI.SingleSelectPopupView.EVENT_CLICK_CLEAR,
action: function () {
self.setValue();
self._defaultState();
}
}],
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
onLoaded: function () {
BI.nextTick(function () {
self.combo.adjustWidth();
self.combo.adjustHeight();
self.trigger.getSearcher().adjustView();
});
}
},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
this.setValue(self.storeValue);
BI.nextTick(function () {
self.populate();
});
});
//当退出的时候如果还在处理请求,则等请求结束后再对外发确定事件
this.wants2Quit = false;
this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () {
//important:关闭弹出时又可能没有退出编辑状态
self.trigger.stopEditing();
if (self.requesting === true) {
self.wants2Quit = true;
} else {
self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM);
}
});
var triggerBtn = BI.createWidget({
type: "bi.trigger_icon_button",
width: o.height,
height: o.height,
cls: "single-select-trigger-icon-button bi-border-left"
});
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
self.trigger.getCounter().hideView();
if (self.combo.isViewVisible()) {
self.combo.hideView();
} else {
self.combo.showView();
}
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.combo,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}]
})
},
_defaultState: function () {
this.trigger.stopEditing();
this.combo.hideView();
},
_assertValue: function (val) {
val || (val = {});
val.type || (val.type = BI.Selection.Single);
val.value || (val.value = []);
},
_makeMap: function (values) {
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.SingleSelectCombo.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.pluck(ob.items, "value");
digest(values);
});
function digest(items) {
var selectedMap = self._makeMap(items);
BI.each(keywords, function (i, val) {
if (BI.isNotNull(selectedMap[val])) {
self.storeValue.value["remove"](val);
}
});
self._adjust(callback);
}
},
_joinAll: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
this.requesting = true;
o.itemsCreator({
type: BI.SingleSelectCombo.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()]
}, function (ob) {
var items = BI.pluck(ob.items, "value");
if (self.storeValue.type === res.type) {
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
delete map[v];
}
});
change && (self.storeValue.value = BI.values(map));
self._adjust(callback);
return;
}
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];
BI.each(items, function (i, item) {
if (BI.isNotNull(selectedMap[items[i]])) {
delete selectedMap[items[i]];
}
if (BI.isNull(notSelectedMap[items[i]])) {
newItems.push(item);
}
});
self.storeValue.value = newItems.concat(BI.values(selectedMap));
self._adjust(callback);
})
},
_adjust: function (callback) {
var self = this, o = this.options;
if (!this._count) {
o.itemsCreator({
type: BI.SingleSelectCombo.REQ_GET_DATA_LENGTH
}, function (res) {
self._count = res.count;
adjust();
callback();
});
} else {
adjust();
callback();
}
function adjust() {
if (self.wants2Quit === true) {
self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM);
self.wants2Quit = false;
}
self.requesting = false;
}
},
_join: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
this._assertValue(this.storeValue);
if (this.storeValue.type === res.type) {
var map = this._makeMap(this.storeValue.value);
BI.each(res.value, function (i, v) {
if (!map[v]) {
self.storeValue.value.push(v);
map[v] = v;
}
});
var change = false;
BI.each(res.assist, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
delete map[v];
}
});
change && (this.storeValue.value = BI.values(map));
self._adjust(callback);
return;
}
this._joinAll(res, callback);
},
_setStartValue: function (value) {
this._startValue = value;
this.popup.setStartValue(value);
},
setValue: function (v) {
this.storeValue = v || {};
this._assertValue(this.storeValue);
this.combo.setValue(this.storeValue);
},
getValue: function () {
return BI.deepClone(this.storeValue);
},
populate: function () {
this._count = null;
this.combo.populate.apply(this.combo, arguments);
}
});
BI.extend(BI.SingleSelectCombo, {
REQ_GET_DATA_LENGTH: 0,
REQ_GET_ALL_DATA: -1
});
BI.SingleSelectCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut('bi.single_select_combo', BI.SingleSelectCombo);

137
src/widget/singleselect/singleselect.list.js

@ -0,0 +1,137 @@
/**
* 选择列表
*
* Created by GUY on 2015/11/1.
* @class BI.SingleSelectList
* @extends BI.Widget
*/
BI.SingleSelectList = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectList.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-list",
direction: BI.Direction.Top,//toolbar的位置
logic: {
dynamic: true
},
items: [],
itemsCreator: BI.emptyFn,
hasNext: BI.emptyFn,
onLoaded: BI.emptyFn,
el: {
type: "bi.list_pane"
}
})
},
_init: function () {
BI.SingleSelectList.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.list = BI.createWidget(o.el, {
type: "bi.list_pane",
items: o.items,
itemsCreator: function (op, callback) {
o.itemsCreator(op, function (items) {
callback.apply(self, arguments);
});
},
onLoaded: o.onLoaded,
hasNext: o.hasNext
});
this.list.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (type === BI.Events.CLICK) {
self.fireEvent(BI.SingleSelectList.EVENT_CHANGE, value, obj);
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({
scrolly: true
}, o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.list)
}))));
},
hasPrev: function () {
return this.list.hasPrev();
},
hasNext: function () {
return this.list.hasNext();
},
prependItems: function (items) {
this.list.prependItems.apply(this.list, arguments);
},
addItems: function (items) {
this.list.addItems.apply(this.list, arguments);
},
setValue: function (data) {
this.list["setValue"](data.value);
},
getValue: function () {
return {
type: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
value: this.list.getValue(),
assist: this.list.getNotSelectedValue()
};
},
empty: function () {
this.list.empty();
},
populate: function (items) {
this.list.populate.apply(this.list, arguments);
},
resetHeight: function (h) {
this.list.resetHeight ? this.list.resetHeight(h) :
this.list.element.css({"max-height": h + "px"})
},
setNotSelectedValue: function () {
this.list.setNotSelectedValue.apply(this.list, arguments);
},
getNotSelectedValue: function () {
return this.list.getNotSelectedValue();
},
getAllButtons: function () {
return this.list.getAllButtons();
},
getAllLeaves: function () {
return this.list.getAllLeaves();
},
getSelectedButtons: function () {
return this.list.getSelectedButtons();
},
getNotSelectedButtons: function () {
return this.list.getNotSelectedButtons();
},
getIndexByValue: function (value) {
return this.list.getIndexByValue(value);
},
getNodeById: function (id) {
return this.list.getNodeById(id);
},
getNodeByValue: function (value) {
return this.list.getNodeByValue(value);
}
});
BI.SingleSelectList.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.single_select_list", BI.SingleSelectList);

163
src/widget/singleselect/singleselect.loader.js

@ -0,0 +1,163 @@
/**
* 单选加载数据面板
* Created by guy on 15/11/2.
* @class BI.SingleSelectLoader
* @extends Widget
*/
BI.SingleSelectLoader = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectLoader.superclass._defaultConfig.apply(this, arguments), {
baseCls: 'bi-single-select-loader',
logic: {
dynamic: true
},
el: {
height: 400
},
valueFormatter: BI.emptyFn,
itemsCreator: BI.emptyFn,
onLoaded: BI.emptyFn
});
},
_init: function () {
BI.SingleSelectLoader.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
var hasNext = false;
this.button_group = BI.createWidget({
type: "bi.single_select_list",
element: this,
logic: opts.logic,
el: BI.extend({
onLoaded: opts.onLoaded,
el: {
type: "bi.loader",
isDefaultInit: false,
logic: {
dynamic: true,
scrolly: true
},
el: {
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
behaviors: {
redmark: function () {
return true;
}
},
layouts: [{
type: "bi.vertical"
}]
}
}
}, opts.el),
itemsCreator: function (op, callback) {
var startValue = self._startValue;
self.storeValue && (op = BI.extend(op || {}, {
selectedValues: self.storeValue.value
}));
opts.itemsCreator(op, function (ob) {
hasNext = ob.hasNext;
var firstItems = [];
if (op.times === 1 && self.storeValue) {
var json = BI.map(self.storeValue.value, function (i, v) {
var txt = opts.valueFormatter(v) || v;
return {
text: txt,
value: v,
title: txt,
selected: false
}
});
if (BI.isKey(self._startValue) && !self.storeValue.value.contains(self._startValue)) {
var txt = opts.valueFormatter(startValue) || startValue;
json.unshift({
text: txt,
value: startValue,
title: txt,
selected: true
})
}
firstItems = self._createItems(json);
}
callback(firstItems.concat(self._createItems(ob.items)), ob.keyword || "");
if (op.times === 1 && self.storeValue) {
BI.isKey(startValue) && self.storeValue.value["pushDistinct"](startValue);
self.setValue(self.storeValue);
}
(op.times === 1) && self._scrollToTop();
});
},
hasNext: function () {
return hasNext;
}
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.button_group.on(BI.SingleSelectList.EVENT_CHANGE, function () {
self.fireEvent(BI.SingleSelectLoader.EVENT_CHANGE, arguments);
});
},
_createItems: function (items) {
return BI.createItems(items, {
type: "bi.single_select_radio_item",
logic: this.options.logic,
height: 25,
selected: false
})
},
_scrollToTop: function () {
var self = this;
BI.delay(function () {
self.button_group.element.scrollTop(0);
}, 30);
},
_assertValue: function (val) {
val || (val = {});
val.type || (val.type = BI.Selection.Single);
val.value || (val.value = []);
},
setStartValue: function (v) {
this._startValue = v;
},
setValue: function (v) {
this.storeValue = v || {};
this._assertValue(this.storeValue);
this.button_group.setValue(this.storeValue);
},
getValue: function () {
return this.button_group.getValue();
},
getAllButtons: function () {
return this.button_group.getAllButtons();
},
empty: function () {
this.button_group.empty();
},
populate: function (items) {
this.button_group.populate.apply(this.button_group, arguments);
},
resetHeight: function (h) {
this.button_group.resetHeight(h);
},
resetWidth: function (w) {
this.button_group.resetWidth(w);
}
});
BI.SingleSelectLoader.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.single_select_loader', BI.SingleSelectLoader);

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

@ -0,0 +1,91 @@
/**
* 带加载的单选下拉面板
* @class BI.SingleSelectPopupView
* @extends Widget
*/
BI.SingleSelectPopupView = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectPopupView.superclass._defaultConfig.apply(this, arguments), {
baseCls: 'bi-single-select-popup-view',
maxWidth: 'auto',
minWidth: 135,
maxHeight: 400,
valueFormatter: BI.emptyFn,
itemsCreator: BI.emptyFn,
onLoaded: BI.emptyFn
});
},
_init: function () {
BI.SingleSelectPopupView.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
this.loader = BI.createWidget({
type: "bi.single_select_loader",
itemsCreator: opts.itemsCreator,
valueFormatter: opts.valueFormatter,
onLoaded: opts.onLoaded
});
this.popupView = BI.createWidget({
type: "bi.multi_popup_view",
stopPropagation: false,
maxWidth: opts.maxWidth,
minWidth: opts.minWidth,
maxHeight: opts.maxHeight,
element: this,
buttons: [BI.i18nText('BI-Basic_Clears'), BI.i18nText('BI-Basic_Sure')],
el: this.loader
});
this.popupView.on(BI.MultiPopupView.EVENT_CHANGE, function () {
self.fireEvent(BI.SingleSelectPopupView.EVENT_CHANGE);
});
this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON, function (index) {
switch (index) {
case 0:
self.fireEvent(BI.SingleSelectPopupView.EVENT_CLICK_CLEAR);
break;
case 1:
self.fireEvent(BI.SingleSelectPopupView.EVENT_CLICK_CONFIRM);
break;
}
});
},
isAllSelected: function () {
return this.loader.isAllSelected();
},
setStartValue: function (v) {
this.loader.setStartValue(v);
},
setValue: function (v) {
this.popupView.setValue(v);
},
getValue: function () {
return this.popupView.getValue();
},
populate: function (items) {
this.popupView.populate.apply(this.popupView, arguments);
},
resetHeight: function (h) {
this.popupView.resetHeight(h);
},
resetWidth: function (w) {
this.popupView.resetWidth(w);
}
});
BI.SingleSelectPopupView.EVENT_CHANGE = "EVENT_CHANGE";
BI.SingleSelectPopupView.EVENT_CLICK_CONFIRM = "EVENT_CLICK_CONFIRM";
BI.SingleSelectPopupView.EVENT_CLICK_CLEAR = "EVENT_CLICK_CLEAR";
BI.shortcut('bi.single_select_popup_view', BI.SingleSelectPopupView);

110
src/widget/singleselect/singleselect.trigger.js

@ -0,0 +1,110 @@
/**
*
* 单选下拉框
* @class BI.SingleSelectTrigger
* @extends BI.Trigger
*/
BI.SingleSelectTrigger = BI.inherit(BI.Trigger, {
constants: {
height: 14,
rgap: 4,
lgap: 4
},
_defaultConfig: function () {
return BI.extend(BI.SingleSelectTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-trigger bi-border",
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
searcher: {},
switcher: {},
adapter: null,
masker: {}
});
},
_init: function () {
BI.SingleSelectTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options;
if (o.height) {
this.setHeight(o.height - 2);
}
this.searcher = BI.createWidget(o.searcher, {
type: "bi.single_select_searcher",
height: o.height,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
popup: {},
adapter: o.adapter,
masker: o.masker
});
this.searcher.on(BI.SingleSelectSearcher.EVENT_START, function () {
self.fireEvent(BI.SingleSelectTrigger.EVENT_START);
});
this.searcher.on(BI.SingleSelectSearcher.EVENT_PAUSE, function () {
self.fireEvent(BI.SingleSelectTrigger.EVENT_PAUSE);
});
this.searcher.on(BI.SingleSelectSearcher.EVENT_SEARCHING, function () {
self.fireEvent(BI.SingleSelectTrigger.EVENT_SEARCHING, arguments);
});
this.searcher.on(BI.SingleSelectSearcher.EVENT_STOP, function () {
self.fireEvent(BI.SingleSelectTrigger.EVENT_STOP);
});
this.searcher.on(BI.SingleSelectSearcher.EVENT_CHANGE, function () {
self.fireEvent(BI.SingleSelectTrigger.EVENT_CHANGE, arguments);
});
var wrapper = BI.createWidget({
type: 'bi.htape',
element: this,
items: [
{
el: this.searcher,
width: 'fill'
}, {
el: BI.createWidget(),
width: 30
}]
});
},
getSearcher: function () {
return this.searcher;
},
stopEditing: function () {
this.searcher.stopSearch();
},
setAdapter: function (adapter) {
this.searcher.setAdapter(adapter);
},
setValue: function (ob) {
this.searcher.setValue(ob);
},
getKey: function () {
return this.searcher.getKey();
},
getValue: function () {
return this.searcher.getValue();
}
});
BI.SingleSelectTrigger.EVENT_TRIGGER_CLICK = "EVENT_TRIGGER_CLICK";
BI.SingleSelectTrigger.EVENT_COUNTER_CLICK = "EVENT_COUNTER_CLICK";
BI.SingleSelectTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.SingleSelectTrigger.EVENT_START = "EVENT_START";
BI.SingleSelectTrigger.EVENT_STOP = "EVENT_STOP";
BI.SingleSelectTrigger.EVENT_PAUSE = "EVENT_PAUSE";
BI.SingleSelectTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.SingleSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW = "EVENT_BEFORE_COUNTER_POPUPVIEW";
BI.shortcut('bi.single_select_trigger', BI.SingleSelectTrigger);

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

@ -0,0 +1,82 @@
/**
* 单选输入框
* Created by guy on 15/11/3.
* @class BI.SingleSelectEditor
* @extends Widget
*/
BI.SingleSelectEditor = BI.inherit(BI.Widget, {
_const: {
checkSelected: BI.i18nText('BI-Check_Selected')
},
_defaultConfig: function () {
return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: 'bi-single-select-editor',
el: {}
});
},
_init: function () {
BI.SingleSelectEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: 'bi.state_editor',
element: this,
height: o.height,
watermark: BI.i18nText('BI-Basic_Search'),
allowBlank: true
});
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_CLICK_LABEL, function () {
});
},
focus: function () {
this.editor.focus();
},
blur: function () {
this.editor.blur();
},
setState: function (state) {
this.editor.setState(state);
},
setValue: function (v) {
this.editor.setValue(v);
},
getValue: function () {
var v = this.editor.getState();
if (BI.isArray(v) && v.length > 0) {
return v[v.length - 1];
} else {
return "";
}
},
getKeywords: function () {
var val = this.editor.getLastValidValue();
var keywords = val.match(/[\S]+/g);
if (BI.isEndWithBlank(val)) {
return keywords.concat([' ']);
}
return keywords;
},
populate: function (items) {
}
});
BI.SingleSelectEditor.EVENT_PAUSE = "SingleSelectEditor.EVENT_PAUSE";
BI.shortcut('bi.single_select_editor', BI.SingleSelectEditor);

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

@ -0,0 +1,148 @@
/**
* searcher
* Created by guy on 15/11/3.
* @class BI.SingleSelectSearcher
* @extends Widget
*/
BI.SingleSelectSearcher = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectSearcher.superclass._defaultConfig.apply(this, arguments), {
baseCls: 'bi-single-select-searcher',
itemsCreator: BI.emptyFn,
el: {},
popup: {},
valueFormatter: BI.emptyFn,
adapter: null,
masker: {}
});
},
_init: function () {
BI.SingleSelectSearcher.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: 'bi.single_select_editor',
height: o.height
});
this.searcher = BI.createWidget({
type: "bi.searcher",
element: this,
height: o.height,
isAutoSearch: false,
isAutoSync: false,
onSearch: function (op, callback) {
callback();
},
el: this.editor,
popup: BI.extend({
type: "bi.single_select_search_pane",
valueFormatter: o.valueFormatter,
keywordGetter: function () {
return self.editor.getValue();
},
itemsCreator: function (op, callback) {
op.keyword = self.editor.getValue();
this.setKeyword(op.keyword);
o.itemsCreator(op, callback);
}
}, o.popup),
adapter: o.adapter,
masker: o.masker
});
this.searcher.on(BI.Searcher.EVENT_START, function () {
self.fireEvent(BI.SingleSelectSearcher.EVENT_START);
});
this.searcher.on(BI.Searcher.EVENT_PAUSE, function () {
if (this.hasMatched()) {
}
self.fireEvent(BI.SingleSelectSearcher.EVENT_PAUSE);
});
this.searcher.on(BI.Searcher.EVENT_STOP, function () {
self.fireEvent(BI.SingleSelectSearcher.EVENT_STOP);
});
this.searcher.on(BI.Searcher.EVENT_CHANGE, function () {
self.fireEvent(BI.SingleSelectSearcher.EVENT_CHANGE, arguments);
});
this.searcher.on(BI.Searcher.EVENT_SEARCHING, function () {
var keywords = this.getKeywords();
self.fireEvent(BI.SingleSelectSearcher.EVENT_SEARCHING, keywords);
});
},
adjustView: function () {
this.searcher.adjustView();
},
isSearching: function () {
return this.searcher.isSearching();
},
stopSearch: function () {
this.searcher.stopSearch();
},
getKeyword: function () {
return this.editor.getValue();
},
hasMatched: function () {
return this.searcher.hasMatched();
},
hasChecked: function () {
return this.searcher.getView() && this.searcher.getView().hasChecked();
},
setAdapter: function (adapter) {
this.searcher.setAdapter(adapter);
},
setState: function (ob) {
var o = this.options;
ob || (ob = {});
ob.value || (ob.value = []);
if (ob.value.length === 0) {
this.editor.setState(BI.Selection.None);
} else {
var state = "";
BI.each(ob.value, function (i, v) {
if (i === 0) {
state += "" + (o.valueFormatter(v + "") || v);
} else {
state += "," + (o.valueFormatter(v + "") || v);
}
});
this.editor.setState(state);
}
},
setValue: function (ob) {
this.setState(ob);
this.searcher.setValue(ob);
},
getKey: function () {
return this.editor.getValue();
},
getValue: function () {
return this.searcher.getValue();
},
populate: function (items) {
this.searcher.populate.apply(this.searcher, arguments);
}
});
BI.SingleSelectSearcher.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.SingleSelectSearcher.EVENT_CHANGE = "EVENT_CHANGE";
BI.SingleSelectSearcher.EVENT_START = "EVENT_START";
BI.SingleSelectSearcher.EVENT_STOP = "EVENT_STOP";
BI.SingleSelectSearcher.EVENT_PAUSE = "EVENT_PAUSE";
BI.SingleSelectSearcher.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.shortcut('bi.single_select_searcher', BI.SingleSelectSearcher);

15
src/widget/singleslider/singleslider.js

@ -82,9 +82,6 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
allowBlank: false,
validationChecker: function (v) {
return self._checkValidation(v);
},
quitChecker: function (v) {
return self._checkValidation(v);
}
});
this.label.element.hover(function () {
@ -225,7 +222,17 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
},
_checkValidation: function (v) {
return BI.isNumeric(v) && !(BI.isNull(v) || v < this.min || v > this.max)
var o = this.options;
var valid = false;
if (BI.isNumeric(v) && !(BI.isNull(v) || v < this.min || v > this.max)) {
if(o.digit === false){
valid = true;
}else{
var dotText = (v + "").split(".")[1] || "";
valid = (dotText.length === o.digit);
}
}
return valid;
},
_setBlueTrack: function (percent) {

Loading…
Cancel
Save