Browse Source

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

* commit '813f0d1451d0b8d9dd84c150e1cb094b413c1860':
  update
  update
  update
  update
  改一下isValid
  调整
  add
  add
  update
  numericinterval初始valid
  update
  floatbox左右宽度
  add
  setSelectedValue
es6
guy 7 years ago
parent
commit
3808c7c2b4
  1. 62
      bi/base.js
  2. 27
      bi/case.js
  3. 183
      bi/core.css
  4. 69
      bi/core.js
  5. 1
      bi/widget.css
  6. 191
      bi/widget.js
  7. 62
      docs/base.js
  8. 27
      docs/case.js
  9. 183
      docs/core.css
  10. 69
      docs/core.js
  11. 1
      docs/widget.css
  12. 191
      docs/widget.js
  13. 5
      src/base/combination/combo.js
  14. 5
      src/base/combination/expander.js
  15. 4
      src/base/combination/loader.js
  16. 5
      src/base/combination/switcher.js
  17. 4
      src/base/single/label/label.js
  18. 19
      src/base/table/table.collection.quick.js
  19. 16
      src/base/table/table.grid.quick.js
  20. 4
      src/base/tree/customtree.js
  21. 2
      src/case/calendar/calendar.year.js
  22. 4
      src/case/layer/pane.list.js
  23. 4
      src/case/list/list.select.js
  24. 4
      src/case/loader/loader.lazy.js
  25. 4
      src/case/loader/loader.list.js
  26. 4
      src/case/loader/sort.list.js
  27. 4
      src/case/tree/tree.level.js
  28. 1
      src/case/trigger/trigger.text.js
  29. 2
      src/core/alias.js
  30. 30
      src/core/behavior/behavior.highlight.js
  31. 7
      src/core/controller/router.floatbox.js
  32. 6
      src/core/events.js
  33. 2
      src/core/func/function.js
  34. 6
      src/core/view.js
  35. 16
      src/core/widget.js
  36. 183
      src/css/core/utils/common.css
  37. 1
      src/css/widget/year/popup.year.css
  38. 144
      src/less/core/utils/common.less
  39. 4
      src/less/lib/colors.less
  40. 1
      src/less/lib/constant.less
  41. 1
      src/less/widget/year/popup.year.less
  42. 8
      src/widget/adaptivearrangement/adaptivearrangement.js
  43. 14
      src/widget/arrangement/arrangement.js
  44. 8
      src/widget/branchrelation/branchrelation.js
  45. 4
      src/widget/interactivearrangement/interactivearrangement.js
  46. 14
      src/widget/month/combo.month.js
  47. 6
      src/widget/month/popup.month.js
  48. 4
      src/widget/multilayerselecttree/multilayerselecttree.leveltree.js
  49. 4
      src/widget/multilayersingletree/multilayersingletree.leveltree.js
  50. 2
      src/widget/multitree/check/multi.tree.check.pane.js
  51. 3
      src/widget/multitree/multi.tree.combo.js
  52. 7
      src/widget/numericalinterval/numericalinterval.js
  53. 4
      src/widget/pathchooser/pathchooser.js
  54. 16
      src/widget/quarter/combo.quarter.js
  55. 6
      src/widget/quarter/popup.quarter.js
  56. 5
      src/widget/sequencetable/treenumber.sequencetable.js
  57. 43
      src/widget/year/combo.year.js
  58. 5
      src/widget/year/popup.year.js
  59. 19
      src/widget/yearmonth/combo.yearmonth.js
  60. 19
      src/widget/yearquarter/combo.yearquarter.js

62
bi/base.js

@ -3264,11 +3264,6 @@ BI.Combo = BI.inherit(BI.Widget, {
return this.position;
},
doBehavior: function () {
this._assertPopupView();
this.popupView && this.popupView.doBehavior.apply(this.popupView, arguments);
},
toggle: function () {
this._toggle();
},
@ -3532,11 +3527,6 @@ BI.Expander = BI.inherit(BI.Widget, {
return this.popupView;
},
doBehavior: function () {
//this._assertPopupView();
this.popupView && this.popupView.doBehavior.apply(this.popupView, arguments);
},
getAllLeaves: function () {
return this.popupView && this.popupView.getAllLeaves();
},
@ -3946,10 +3936,6 @@ BI.Loader = BI.inherit(BI.Widget, {
this.button_group.populate.apply(this.button_group, arguments);
},
doBehavior: function () {
this.button_group.doBehavior.apply(this.button_group, arguments);
},
setNotSelectedValue: function () {
this.button_group.setNotSelectedValue.apply(this.button_group, arguments);
},
@ -4704,11 +4690,6 @@ BI.Switcher = BI.inherit(BI.Widget, {
this.isViewVisible() && BI.Maskers.show(this.getName());
},
doBehavior: function () {
this._assertPopupView();
this.popupView && this.popupView.doBehavior.apply(this.popupView, arguments);
},
getAllLeaves: function () {
return this.popupView && this.popupView.getAllLeaves();
},
@ -19638,7 +19619,7 @@ BI.Label = BI.inherit(BI.Single, {
}
if (o.whiteSpace == "normal") {
this.text = BI.createWidget(json);
this.text = BI.createWidget({
BI.createWidget({
type: "bi.center_adapt",
hgap: o.hgap,
vgap: o.vgap,
@ -19836,7 +19817,7 @@ BI.Label = BI.inherit(BI.Single, {
}
if (o.whiteSpace == "normal") {
this.text = BI.createWidget(json)
this.text = BI.createWidget({
BI.createWidget({
type: "bi.vertical_adapt",
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -29554,8 +29535,7 @@ BI.QuickCollectionTable = BI.inherit(BI.CollectionTable, {
_populateTable: function () {
var self = this, o = this.options;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0,
summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var freezeColLength = this._getFreezeColLength();
summaryColumnSizeArray = []
BI.each(o.columnSize, function (i, size) {
if (o.isNeedFreeze === true && o.freezeCols.contains(i)) {
totalLeftColumnSize += size;
@ -29571,13 +29551,13 @@ BI.QuickCollectionTable = BI.inherit(BI.CollectionTable, {
});
var otlw = regionSize;
var otlh = o.header.length * o.headerRowSize;
var otlh = this._getFreezeHeaderHeight();
var otrw = this._width - regionSize;
var otrh = o.header.length * o.headerRowSize;
var otrh = this._getFreezeHeaderHeight();
var oblw = regionSize;
var oblh = this._height - o.header.length * o.headerRowSize;
var oblh = this._height - otlh;
var obrw = this._width - regionSize;
var obrh = this._height - o.header.length * o.headerRowSize;
var obrh = this._height - otrh;
this.topLeft.setWidth(otlw);
this.topLeft.setHeight(otlh);
@ -29599,9 +29579,9 @@ BI.QuickCollectionTable = BI.inherit(BI.CollectionTable, {
var items = this.contextLayout.attr("items");
items[1].left = regionSize;
items[2].top = o.header.length * o.headerRowSize;
items[2].top = this._getFreezeHeaderHeight();
items[3].left = regionSize;
items[3].top = o.header.length * o.headerRowSize;
items[3].top = this._getFreezeHeaderHeight();
this.contextLayout.attr("items", items);
this.contextLayout.resize();
@ -29617,8 +29597,8 @@ BI.QuickCollectionTable = BI.inherit(BI.CollectionTable, {
};
run(this.topLeftItems, o.header, leftHeader);
run(this.topRightItems, o.header, rightHeader);
run(this.bottomLeftItems, o.items, leftItems);
run(this.bottomRightItems, o.items, rightItems);
run(this.bottomLeftItems, this._getActualItems(), leftItems);
run(this.bottomRightItems, this._getActualItems(), rightItems);
this.topLeftCollection.populate(leftHeader);
this.topRightCollection.populate(rightHeader);
@ -30274,7 +30254,7 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
_populateTable: function () {
var self = this, o = this.options;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [];
var freezeColLength = this._getFreezeColLength();
BI.each(o.columnSize, function (i, size) {
if (o.isNeedFreeze === true && o.freezeCols.contains(i)) {
@ -30291,13 +30271,13 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
});
var otlw = regionSize;
var otlh = o.header.length * o.headerRowSize;
var otlh = this._getFreezeHeaderHeight();
var otrw = this._width - regionSize;
var otrh = o.header.length * o.headerRowSize;
var otrh = this._getFreezeHeaderHeight();
var oblw = regionSize;
var oblh = this._height - o.header.length * o.headerRowSize;
var oblh = this._height - otlh;
var obrw = this._width - regionSize;
var obrh = this._height - o.header.length * o.headerRowSize;
var obrh = this._height - otrh;
this.topLeft.setWidth(otlw);
this.topLeft.setHeight(otlh);
@ -30328,9 +30308,9 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
var items = this.contextLayout.attr("items");
items[1].left = regionSize;
items[2].top = o.header.length * o.headerRowSize;
items[2].top = this._getFreezeHeaderHeight();
items[3].left = regionSize;
items[3].top = o.header.length * o.headerRowSize;
items[3].top = this._getFreezeHeaderHeight();
this.contextLayout.attr("items", items);
this.contextLayout.resize();
@ -30350,7 +30330,7 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
}
});
});
BI.each(o.items, function (i, cols) {
BI.each(this._getActualItems(), function (i, cols) {
leftItems[i] = [];
rightItems[i] = [];
BI.each(cols, function (j, col) {
@ -33019,10 +32999,6 @@ BI.CustomTree = BI.inherit(BI.Widget, {
this.tree.populate.apply(this.tree, args);
},
doBehavior: function () {
this.tree.doBehavior.apply(this.tree, arguments);
},
setValue: function (v) {
this.tree && this.tree.setValue(v);
},

27
bi/case.js

@ -1820,6 +1820,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, {
var conf = BI.YearCalendar.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-year-calendar",
behaviors: {},
logic: {
dynamic: false
},
@ -1884,6 +1885,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, {
this.years = BI.createWidget({
type: "bi.button_group",
behaviors: o.behaviors,
items: BI.createItems(items, {}),
layouts: [BI.LogicFactory.createLogic("table", BI.extend({}, o.logic, {
columns: 2,
@ -8360,10 +8362,6 @@ BI.ListPane = BI.inherit(BI.Pane, {
this.button_group.empty();
},
doBehavior: function () {
this.button_group.doBehavior.apply(this.button_group, arguments);
},
setNotSelectedValue: function () {
this.button_group.setNotSelectedValue.apply(this.button_group, arguments);
},
@ -8653,10 +8651,6 @@ BI.SelectList = BI.inherit(BI.Widget, {
this.list.element.css({"max-height": h - toolHeight + "px"})
},
doBehavior: function () {
this.list.doBehavior.apply(this.list, arguments);
},
setNotSelectedValue: function () {
this.list.setNotSelectedValue.apply(this.list, arguments);
this._checkAllSelected();
@ -8751,10 +8745,6 @@ BI.LazyLoader = BI.inherit(BI.Widget, {
this.loader.empty();
},
doBehavior: function () {
this.loader.doBehavior();
},
setNotSelectedValue: function () {
this.loader.setNotSelectedValue.apply(this.loader, arguments);
},
@ -8950,10 +8940,6 @@ BI.ListLoader = BI.inherit(BI.Widget, {
});
},
doBehavior: function () {
this.button_group.doBehavior.apply(this.button_group, arguments);
},
setNotSelectedValue: function () {
this.button_group.setNotSelectedValue.apply(this.button_group, arguments);
},
@ -9122,10 +9108,6 @@ BI.SortList = BI.inherit(BI.Widget, {
this.loader.empty();
},
doBehavior: function () {
this.loader.doBehavior.apply(this.loader, arguments);
},
setNotSelectedValue: function () {
this.loader.setNotSelectedValue.apply(this.loader, arguments);
},
@ -12126,10 +12108,6 @@ BI.LevelTree = BI.inherit(BI.Widget, {
this.tree.populate(items);
},
doBehavior: function () {
this.tree.doBehavior.apply(this.tree, arguments);
},
setValue: function (v) {
this.tree.setValue(v);
},
@ -12411,6 +12389,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
});
this.trigerButton = BI.createWidget({
type: "bi.trigger_icon_button",
cls: "bi-border-left",
width: c.triggerWidth
});

183
bi/core.css

@ -2958,12 +2958,18 @@ i {
cursor: default !important;
color: #cccccc !important;
}
.base-disabled .bi-input {
color: #cccccc !important;
}
.base-disabled .b-font:before {
color: #cccccc !important;
}
.bi-theme-dark .base-disabled {
color: #666666 !important;
}
.bi-theme-dark .base-disabled .bi-input {
color: #666666 !important;
}
.bi-theme-dark .base-disabled .b-font:before {
color: #666666 !important;
}
@ -2986,27 +2992,48 @@ i {
background-color: #eff1f4;
color: #666666;
}
.bi-background .bi-input {
color: #666666;
}
.bi-theme-dark .bi-background {
background-color: #191b2b;
color: #cccccc;
}
.bi-theme-dark .bi-background .bi-input {
color: #cccccc;
}
.bi-card {
background-color: #ffffff;
color: #666666;
}
.bi-card .bi-input {
color: #666666;
}
.bi-theme-dark .bi-card {
background-color: #242640;
color: #cccccc;
}
.bi-theme-dark .bi-card .bi-input {
color: #cccccc;
}
.bi-disabled {
color: #cccccc;
}
.bi-disabled .bi-input {
color: #cccccc;
}
.bi-theme-dark .bi-disabled {
color: #666666;
}
.bi-theme-dark .bi-disabled .bi-input {
color: #666666;
}
.bi-tips {
color: #999999;
}
.bi-tips .bi-input {
color: #999999;
}
.bi-border {
border: 1px solid #d4dadd;
}
@ -3040,13 +3067,22 @@ i {
.bi-keyword-red-mark {
color: #f07d0a;
}
.bi-keyword-red-mark .bi-input {
color: #f07d0a;
}
.bi-high-light {
color: #3f8ce8;
}
.bi-high-light .bi-input {
color: #3f8ce8;
}
.bi-high-light-background {
background-color: #3f8ce8;
color: #ffffff;
}
.bi-high-light-background .bi-input {
color: #ffffff;
}
.bi-high-light-border {
border-color: #178cdf;
}
@ -3054,9 +3090,15 @@ i {
color: #cccccc;
cursor: text;
}
.bi-water-mark .bi-input {
color: #cccccc;
}
.bi-theme-dark .bi-water-mark {
color: #666666;
}
.bi-theme-dark .bi-water-mark .bi-input {
color: #666666;
}
.bi-resizer {
background: #1a1a1a;
opacity: 0.2;
@ -3071,28 +3113,46 @@ i {
background-color: rgba(26, 26, 26, 0.2);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#331a1a1a,endColorstr=#331a1a1a);
}
.bi-mask .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-mask {
color: #242640;
background-color: rgba(255, 255, 255, 0.2);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#33ffffff,endColorstr=#33ffffff);
}
.bi-theme-dark .bi-mask .bi-input {
color: #242640;
}
.bi-z-index-mask {
color: #ffffff;
background-color: rgba(26, 26, 26, 0.5);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#801a1a1a,endColorstr=#801a1a1a);
}
.bi-z-index-mask .bi-input {
color: #ffffff;
}
.bi-list-item:hover,
.bi-list-item.hover {
color: #1a1a1a;
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item:hover .bi-input,
.bi-list-item.hover .bi-input {
color: #1a1a1a;
}
.bi-list-item.disabled,
.bi-list-item.disabled:hover,
.bi-list-item.disabled:active {
background-color: transparent !important;
color: #cccccc !important;
}
.bi-list-item.disabled .bi-input,
.bi-list-item.disabled:hover .bi-input,
.bi-list-item.disabled:active .bi-input {
color: #cccccc !important;
}
.bi-list-item.disabled .bi-high-light,
.bi-list-item.disabled:hover .bi-high-light,
.bi-list-item.disabled:active .bi-high-light {
@ -3104,12 +3164,21 @@ i {
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item:hover .bi-input,
.bi-theme-dark .bi-list-item.hover .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-list-item.disabled,
.bi-theme-dark .bi-list-item.disabled:hover,
.bi-theme-dark .bi-list-item.disabled:active {
background-color: transparent !important;
color: #666666 !important;
}
.bi-theme-dark .bi-list-item.disabled .bi-input,
.bi-theme-dark .bi-list-item.disabled:hover .bi-input,
.bi-theme-dark .bi-list-item.disabled:active .bi-input {
color: #666666 !important;
}
.bi-theme-dark .bi-list-item.disabled .bi-high-light,
.bi-theme-dark .bi-list-item.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item.disabled:active .bi-high-light {
@ -3122,15 +3191,27 @@ i {
.bi-list-item-simple {
color: #999999;
}
.bi-list-item-simple .bi-input {
color: #999999;
}
.bi-list-item-simple:hover,
.bi-list-item-simple.hover {
color: #3f8ce8;
}
.bi-list-item-simple:hover .bi-input,
.bi-list-item-simple.hover .bi-input {
color: #3f8ce8;
}
.bi-list-item-simple.disabled,
.bi-list-item-simple.disabled:hover,
.bi-list-item-simple.disabled:active {
color: #cccccc !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;
}
.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 {
@ -3139,15 +3220,27 @@ i {
.bi-list-item-effect:hover {
color: #1a1a1a;
}
.bi-list-item-effect:hover .bi-input {
color: #1a1a1a;
}
.bi-list-item-effect.active,
.bi-list-item-effect:active {
color: #3f8ce8;
}
.bi-list-item-effect.active .bi-input,
.bi-list-item-effect:active .bi-input {
color: #3f8ce8;
}
.bi-list-item-effect.disabled,
.bi-list-item-effect.disabled:hover,
.bi-list-item-effect.disabled:active {
color: #cccccc !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;
}
.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 {
@ -3156,16 +3249,28 @@ i {
.bi-theme-dark .bi-list-item-effect:hover {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-effect:hover .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-effect.active,
.bi-theme-dark .bi-list-item-effect:active {
color: #3f8ce8;
}
.bi-theme-dark .bi-list-item-effect.active .bi-input,
.bi-theme-dark .bi-list-item-effect:active .bi-input {
color: #3f8ce8;
}
.bi-theme-dark .bi-list-item-effect.disabled,
.bi-theme-dark .bi-list-item-effect.disabled:hover,
.bi-theme-dark .bi-list-item-effect.disabled:active {
background-color: transparent !important;
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-effect.disabled .bi-input,
.bi-theme-dark .bi-list-item-effect.disabled:hover .bi-input,
.bi-theme-dark .bi-list-item-effect.disabled:active .bi-input {
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-effect.disabled .bi-high-light,
.bi-theme-dark .bi-list-item-effect.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item-effect.disabled:active .bi-high-light {
@ -3177,18 +3282,31 @@ i {
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item-active:hover .bi-input,
.bi-list-item-active.hover .bi-input {
color: #1a1a1a;
}
.bi-list-item-active.active,
.bi-list-item-active:active {
color: #3f8ce8;
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;
}
.bi-list-item-active.disabled,
.bi-list-item-active.disabled:hover,
.bi-list-item-active.disabled:active {
background-color: transparent !important;
color: #cccccc !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;
}
.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 {
@ -3200,18 +3318,31 @@ i {
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item-active:hover .bi-input,
.bi-theme-dark .bi-list-item-active.hover .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-active.active,
.bi-theme-dark .bi-list-item-active:active {
color: #3f8ce8;
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;
}
.bi-theme-dark .bi-list-item-active.disabled,
.bi-theme-dark .bi-list-item-active.disabled:hover,
.bi-theme-dark .bi-list-item-active.disabled:active {
background-color: transparent !important;
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-active.disabled .bi-input,
.bi-theme-dark .bi-list-item-active.disabled:hover .bi-input,
.bi-theme-dark .bi-list-item-active.disabled:active .bi-input {
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-active.disabled .bi-high-light,
.bi-theme-dark .bi-list-item-active.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item-active.disabled:active .bi-high-light {
@ -3222,17 +3353,30 @@ i {
color: #1a1a1a;
background-color: #ffffff;
}
.bi-list-item-active2:hover .bi-input,
.bi-list-item-active2.hover .bi-input {
color: #1a1a1a;
}
.bi-list-item-active2.active,
.bi-list-item-active2:active {
color: #3f8ce8;
background-color: #ffffff;
}
.bi-list-item-active2.active .bi-input,
.bi-list-item-active2:active .bi-input {
color: #3f8ce8;
}
.bi-list-item-active2.disabled,
.bi-list-item-active2.disabled:hover,
.bi-list-item-active2.disabled:active {
background-color: transparent !important;
color: #cccccc !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;
}
.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 {
@ -3243,17 +3387,30 @@ i {
color: #ffffff;
background-color: #242640;
}
.bi-theme-dark .bi-list-item-active2:hover .bi-input,
.bi-theme-dark .bi-list-item-active2.hover .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-active2.active,
.bi-theme-dark .bi-list-item-active2:active {
color: #3f8ce8;
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;
}
.bi-theme-dark .bi-list-item-active2.disabled,
.bi-theme-dark .bi-list-item-active2.disabled:hover,
.bi-theme-dark .bi-list-item-active2.disabled:active {
background-color: transparent !important;
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-active2.disabled .bi-input,
.bi-theme-dark .bi-list-item-active2.disabled:hover .bi-input,
.bi-theme-dark .bi-list-item-active2.disabled:active .bi-input {
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-active2.disabled .bi-high-light,
.bi-theme-dark .bi-list-item-active2.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item-active2.disabled:active .bi-high-light {
@ -3265,11 +3422,19 @@ i {
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item-select:hover .bi-input,
.bi-list-item-select.hover .bi-input {
color: #1a1a1a;
}
.bi-list-item-select:active,
.bi-list-item-select.active {
color: #ffffff;
background-color: #3f8ce8;
}
.bi-list-item-select:active .bi-input,
.bi-list-item-select.active .bi-input {
color: #ffffff;
}
.bi-list-item-select:active .bi-high-light,
.bi-list-item-select.active .bi-high-light {
color: #ffffff;
@ -3280,6 +3445,11 @@ i {
color: #cccccc !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;
}
.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 {
@ -3291,11 +3461,19 @@ i {
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item-select:hover .bi-input,
.bi-theme-dark .bi-list-item-select.hover .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-select:active,
.bi-theme-dark .bi-list-item-select.active {
color: #ffffff;
background-color: #3f8ce8;
}
.bi-theme-dark .bi-list-item-select:active .bi-input,
.bi-theme-dark .bi-list-item-select.active .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-select:active .bi-high-light,
.bi-theme-dark .bi-list-item-select.active .bi-high-light {
color: #ffffff;
@ -3306,6 +3484,11 @@ i {
background-color: transparent !important;
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-select.disabled .bi-input,
.bi-theme-dark .bi-list-item-select.disabled:hover .bi-input,
.bi-theme-dark .bi-list-item-select.disabled:active .bi-input {
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-select.disabled .bi-high-light,
.bi-theme-dark .bi-list-item-select.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item-select.disabled:active .bi-high-light {

69
bi/core.js

@ -3184,7 +3184,7 @@ if (!window.BI) {
if (numReg) {
var num = numReg[0];
var orilen = num.length;
var newnum = BI.parseInt(num) + 1 + '';
var newnum = parseInt(num) + 1 + '';
//进位到整数部分
if (newnum.length > orilen) {
newnum = newnum.substr(1);
@ -3728,6 +3728,12 @@ _.extend(BI, {
*/
DESTROY: '_DESTROY',
/**
* @static
* @property 取消挂载事件
*/
UNMOUNT: '_UNMOUNT',
/**
* @static
* @property 清除选择
@ -4360,6 +4366,8 @@ BI.Widget = BI.inherit(BI.OB, {
update: function () {
},
beforeDestroyed: null,
destroyed: null,
_init: function () {
@ -4577,6 +4585,14 @@ BI.Widget = BI.inherit(BI.OB, {
}
},
doBehavior: function () {
var args = arguments;
//递归将所有子组件使有效
BI.each(this._children, function (i, child) {
child.doBehavior && child.doBehavior.apply(child, args);
});
},
getWidth: function () {
return this.options.width;
},
@ -4711,18 +4727,20 @@ BI.Widget = BI.inherit(BI.OB, {
},
__d: function () {
this.beforeDestroyed && this.beforeDestroyed();
BI.each(this._children, function (i, widget) {
widget._unMount && widget._unMount();
});
this._children = {};
this._parent = null;
this._isMounted = false;
this.destroyed && this.destroyed();
},
_unMount: function () {
this.__d();
this.fireEvent(BI.Events.UNMOUNT);
this.purgeListeners();
this.destroyed && this.destroyed();
},
isolate: function () {
@ -4742,14 +4760,12 @@ BI.Widget = BI.inherit(BI.OB, {
_destroy: function () {
this.__d();
this.destroyed && this.destroyed();
this.element.destroy();
this.purgeListeners();
},
destroy: function () {
this.__d();
this.destroyed && this.destroyed();
this.element.destroy();
this.fireEvent(BI.Events.DESTROY);
this.purgeListeners();
@ -5245,6 +5261,8 @@ BI.View = BI.inherit(BI.V, {
created: null,
beforeDestroyed: null,
destroyed: null,
_init: function () {
@ -5734,18 +5752,22 @@ BI.View = BI.inherit(BI.V, {
},
_unMount: function () {
this.beforeDestroyed && this.beforeDestroyed();
BI.each(this._cardLayouts, function (name, card) {
card && card._unMount();
});
delete this._cardLayouts;
delete this._cards;
this.destroyed && this.destroyed();
this.trigger(BI.Events.UNMOUNT);
this.off();
},
_destroy: function () {
var self = this;
BI.each(this._cardLayouts, function (name, card) {
card && card._unMount();
BI.Layers.remove(name + self.cid);
});
delete this._cardLayouts;
delete this._cards;
@ -10973,26 +10995,34 @@ BI.Behavior = BI.inherit(BI.OB, {
* @extends BI.Behavior
*/
BI.HighlightBehavior = BI.inherit(BI.Behavior, {
_defaultConfig: function() {
return BI.extend(BI.HighlightBehavior.superclass._defaultConfig.apply(this, arguments), {
});
_defaultConfig: function () {
return BI.extend(BI.HighlightBehavior.superclass._defaultConfig.apply(this, arguments), {});
},
_init : function() {
_init: function () {
BI.HighlightBehavior.superclass._init.apply(this, arguments);
},
doBehavior: function(items){
doBehavior: function (items) {
var args = Array.prototype.slice.call(arguments, 1),
o = this.options;
BI.each(items, function(i, item){
if(item instanceof BI.Single) {
if (o.rule(item.getValue(), item)) {
item.doHighLight.apply(item, args);
BI.each(items, function (i, item) {
if (item instanceof BI.Single) {
var rule = o.rule(item.getValue(), item);
function doBe(run) {
if (run === true) {
item.doHighLight.apply(item, args);
} else {
item.unHighLight.apply(item, args);
}
}
if (BI.isFunction(rule)) {
rule(doBe);
} else {
item.unHighLight.apply(item, args);
doBe(rule);
}
} else {
item.doBehavior.apply(item, args);
@ -15943,7 +15973,10 @@ BI.FloatBoxRouter = BI.inherit(BI.WRouter, {
var view = this.createView(url, data, viewData, context);
isValid && context.model.addChild(modelData, view.model);
view.listenTo(view.model, "destroy", function () {
self.remove(url);
self.remove(url, context);
});
context.on(BI.Events.UNMOUNT, function () {
self.remove(url, context);
});
this.store[url].populate(view);
this.views[url] = view;
@ -15982,7 +16015,7 @@ BI.FloatBoxRouter = BI.inherit(BI.WRouter, {
remove: function (url, context) {
url = context.rootURL + "/" + url;
if(this.controller){
if (this.controller) {
this.controller.remove(url);
delete this.store[url];
this.views[url] && this.views[url].model.destroy();
@ -16812,7 +16845,7 @@ BI.extend(BI.DOM, {
}
var rgb = this.rgb2json(this.hex2rgb(hex));
var grayLevel = Math.round(rgb.r * 0.299 + rgb.g * 0.587 + rgb.b * 0.114);
if (grayLevel < 140) {
if (grayLevel < 192/**网上给的是140**/) {
return true;
}
return false;

1
bi/widget.css

@ -516,7 +516,6 @@
/**** custom color(自定义颜色,用于特定场景) ****/
.bi-year-popup .year-popup-navigation {
line-height: 30px;
color: #3f8ce8;
}
.bi-year-popup .year-popup-navigation > .center-element {
border-left: 1px solid #d4dadd;

191
bi/widget.js

@ -103,12 +103,13 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
_getStart: function (nodes) {
var self = this;
var start = this.start;
BI.each(nodes, function (i, node) {
BI.some(nodes, function (i, node) {
if (BI.isNotEmptyArray(node.children)) {
BI.each(node.children, function (index, child) {
return BI.some(node.children, function (index, child) {
if (index === 0) {
if (self.cache[child.text || child.value]) {
start = self.cache[child.text || child.value];
return true;
}
}
});
@ -474,8 +475,8 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, {
width: ui.size.width,
height: height
});
self.arrangement.scrollTo(height);
}, 500);
self.arrangement.scrollTo({top: height});
}, 300);
};
this.arrangement.container.element.resizable({
handles: "s",
@ -878,6 +879,10 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, {
return this.arrangement.setRegionPosition(name, position);
},
scrollTo: function (scroll) {
this.arrangement.scrollTo(scroll);
},
zoom: function (ratio) {
this.arrangement.zoom(ratio);
},
@ -1204,7 +1209,8 @@ BI.Arrangement = BI.inherit(BI.Widget, {
findBottomRegions.push(region);
}
});
var topValid = isRegionsValid(findTopRegions, "top"), bottomValid = isRegionsValid(findBottomRegions, "bottom");
var topValid = isRegionsValid(findTopRegions, "top"),
bottomValid = isRegionsValid(findBottomRegions, "bottom");
if (topValid && bottomValid) {
BI.each(findTopRegions, function (i, region) {
var clone = BI.clone(region);
@ -1247,7 +1253,8 @@ BI.Arrangement = BI.inherit(BI.Widget, {
findRightRegions.push(region);
}
});
var leftValid = isRegionsValid(findLeftRegions, "left"), rightValid = isRegionsValid(findRightRegions, "right");
var leftValid = isRegionsValid(findLeftRegions, "left"),
rightValid = isRegionsValid(findRightRegions, "right");
if (leftValid && rightValid) {
BI.each(findLeftRegions, function (i, region) {
var clone = BI.clone(region);
@ -3678,8 +3685,9 @@ BI.Arrangement = BI.inherit(BI.Widget, {
this.resize();
},
scrollTo: function (top) {
this.scrollContainer.element.scrollTop(top);
scrollTo: function (scroll) {
this.scrollContainer.element.scrollTop(scroll.top);
this.scrollContainer.element.scrollLeft(scroll.left);
},
zoom: function (ratio) {
@ -3690,6 +3698,7 @@ BI.Arrangement = BI.inherit(BI.Widget, {
var occupied = this._applyContainer();
switch (this.getLayoutType()) {
case BI.Arrangement.LAYOUT_TYPE.ADAPTIVE:
case BI.Arrangement.LAYOUT_TYPE.FREE:
if (this._isArrangeFine()) {
var width = this.getClientWidth();
var xRatio = (ratio.x || 1) * width / (occupied.left + occupied.width);
@ -3710,8 +3719,6 @@ BI.Arrangement = BI.inherit(BI.Widget, {
this.relayout();
}
break;
case BI.Arrangement.LAYOUT_TYPE.FREE:
break;
case BI.Arrangement.LAYOUT_TYPE.GRID:
if (this._isArrangeFine()) {
var width = this.getClientWidth();
@ -4217,7 +4224,7 @@ BI.BranchRelation = BI.inherit(BI.Widget, {
if (end.length > 0) {
path += "M" + BI.first(end).x + "," + split + "L" + BI.last(end).x + "," + split;
}
self.svg.path(path).attr("stroke", "gray");
self.svg.path(path).attr("stroke", "#d4dadd");
}
})
});
@ -4238,7 +4245,7 @@ BI.BranchRelation = BI.inherit(BI.Widget, {
if (end.length > 0) {
path += "M" + BI.first(end).x + "," + split + "L" + BI.last(end).x + "," + split;
}
self.svg.path(path).attr("stroke", "gray");
self.svg.path(path).attr("stroke", "#d4dadd");
}
})
});
@ -4259,7 +4266,7 @@ BI.BranchRelation = BI.inherit(BI.Widget, {
if (end.length > 0) {
path += "M" + split + "," + BI.first(end).x + "L" + split + "," + BI.last(end).x;
}
self.svg.path(path).attr("stroke", "gray");
self.svg.path(path).attr("stroke", "#d4dadd");
}
})
});
@ -4280,7 +4287,7 @@ BI.BranchRelation = BI.inherit(BI.Widget, {
if (end.length > 0) {
path += "M" + split + "," + BI.first(end).x + "L" + split + "," + BI.last(end).x;
}
self.svg.path(path).attr("stroke", "gray");
self.svg.path(path).attr("stroke", "#d4dadd");
}
})
});
@ -7681,6 +7688,10 @@ BI.InteractiveArrangement = BI.inherit(BI.Widget, {
return this.arrangement.setRegionPosition(name, position);
},
scrollTo: function (scroll) {
this.arrangement.scrollTo(scroll);
},
zoom: function (ratio) {
this.arrangement.zoom(ratio);
},
@ -7739,6 +7750,7 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MonthCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-month-combo",
behaviors: {},
height: 25
});
},
@ -7751,9 +7763,9 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
});
this.trigger.on(BI.MonthTrigger.EVENT_CONFIRM, function (v) {
if(this.getKey() && this.getKey() !== self.storeValue) {
if (this.getKey() && this.getKey() !== self.storeValue) {
self.setValue(this.getValue());
}else if(!this.getKey()){
} else if (!this.getKey()) {
self.setValue();
}
self.fireEvent(BI.MonthCombo.EVENT_CONFIRM);
@ -7774,7 +7786,8 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
});
this.popup = BI.createWidget({
type: "bi.month_popup"
type: "bi.month_popup",
behaviors: o.behaviors
});
this.popup.on(BI.MonthPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
@ -7792,7 +7805,10 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
minWidth: 85,
el: this.popup
}
})
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.MonthCombo.EVENT_BEFORE_POPUPVIEW);
});
},
setValue: function (v) {
@ -7806,6 +7822,7 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
});
BI.MonthCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.MonthCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut('bi.month_combo', BI.MonthCombo);/**
* 月份展示面板
*
@ -7817,13 +7834,14 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MonthPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-month-popup"
baseCls: "bi-month-popup",
behaviors: {}
});
},
_init: function () {
BI.MonthPopup.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
//纵向排列月
var month = [0, 6, 1, 7, 2, 8, 3, 9, 4, 10, 5, 11];
@ -7854,6 +7872,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
this.month = BI.createWidget({
type: "bi.button_group",
element: this,
behaviors: o.behaviors,
items: BI.createItems(items, {}),
layouts: [BI.LogicFactory.createLogic("table", BI.extend({
dynamic: true
@ -8170,10 +8189,6 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, {
this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0));
},
doBehavior: function () {
this.tree.doBehavior.apply(this.tree, arguments);
},
setValue: function (v) {
this.tree.setValue(v);
},
@ -8715,10 +8730,6 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, {
this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0));
},
doBehavior: function () {
this.tree.doBehavior.apply(this.tree, arguments);
},
setValue: function (v) {
this.tree.setValue(v);
},
@ -11614,7 +11625,7 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
setValue: function (v) {
v || (v = {});
this.display.setValue(v.value);
this.display.setSelectedValue(v.value);
},
getValue: function () {
@ -11732,6 +11743,9 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
self.trigger.getSearcher().adjustView();
});
}
},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
});
@ -12279,8 +12293,8 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
var conf = BI.NumericalInterval.superclass._defaultConfig.apply(this, arguments)
return BI.extend(conf, {
extraCls: "bi-numerical-interval",
height: 25
height: 25,
validation: "valid"
})
},
_init: function () {
@ -12681,8 +12695,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
})
},
isValid: function () {
isStateValid: function () {
return this.options.validation === "valid";
},
@ -13106,8 +13119,8 @@ BI.shortcut('bi.page_table', BI.PageTable);/**
BI.PathChooser = BI.inherit(BI.Widget, {
_const: {
lineColor: "#c4c6c6",
selectLineColor: "#009de3"
lineColor: "#d4dadd",
selectLineColor: "#3f8ce8"
},
_defaultConfig: function () {
@ -13976,6 +13989,7 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.QuarterCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-quarter-combo",
behaviors: {},
height: 25
});
},
@ -13996,24 +14010,25 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
this.trigger.on(BI.QuarterTrigger.EVENT_START, function () {
self.combo.isViewVisible() && self.combo.hideView();
});
this.trigger.on(BI.QuarterTrigger.EVENT_STOP, function(){
this.trigger.on(BI.QuarterTrigger.EVENT_STOP, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.trigger.on(BI.QuarterTrigger.EVENT_CONFIRM, function () {
if(self.combo.isViewVisible()) {
if (self.combo.isViewVisible()) {
return;
}
if(this.getKey() && this.getKey() !== self.storeValue) {
if (this.getKey() && this.getKey() !== self.storeValue) {
self.setValue(this.getKey());
}else if(!this.getKey()){
} else if (!this.getKey()) {
self.setValue();
}
self.fireEvent(BI.QuarterCombo.EVENT_CONFIRM);
});
this.popup = BI.createWidget({
type: "bi.quarter_popup"
type: "bi.quarter_popup",
behaviors: o.behaviors
});
this.popup.on(BI.QuarterPopup.EVENT_CHANGE, function () {
@ -14033,6 +14048,9 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
el: this.popup
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.QuarterCombo.EVENT_BEFORE_POPUPVIEW);
});
},
setValue: function (v) {
@ -14046,6 +14064,7 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
});
BI.QuarterCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.QuarterCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut('bi.quarter_combo', BI.QuarterCombo);/**
* 季度展示面板
*
@ -14057,13 +14076,14 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.QuarterPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-quarter-popup"
baseCls: "bi-quarter-popup",
behaviors: {}
});
},
_init: function () {
BI.QuarterPopup.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
var items = [{
text: Date._QN[01],
@ -14093,6 +14113,7 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
this.quarter = BI.createWidget({
type: "bi.button_group",
element: this,
behaviors: o.behaviors,
items: BI.createItems(items, {}),
layouts: [{
type: "bi.vertical"
@ -16581,6 +16602,7 @@ BI.YearCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.YearCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-year-combo",
behaviors: {},
min: '1900-01-01', //最小日期
max: '2099-12-31', //最大日期
height: 25
@ -16608,7 +16630,7 @@ BI.YearCombo = BI.inherit(BI.Widget, {
self.combo.isViewVisible() && self.combo.hideView();
});
this.trigger.on(BI.YearTrigger.EVENT_CONFIRM, function () {
if(self.combo.isViewVisible()) {
if (self.combo.isViewVisible()) {
return;
}
if (this.getKey() && this.getKey() !== self.storeValue) {
@ -16619,45 +16641,50 @@ BI.YearCombo = BI.inherit(BI.Widget, {
self.fireEvent(BI.YearCombo.EVENT_CONFIRM);
});
this.popup = BI.createWidget({
type: "bi.year_popup",
min: o.min,
max: o.max
});
this.popup.on(BI.YearPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
self.fireEvent(BI.YearCombo.EVENT_CONFIRM);
});
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
destroyWhenHide: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
popup: {
minWidth: 85,
stopPropagation: false,
el: this.popup
el: {
type: "bi.year_popup",
ref: function () {
self.popup = this;
},
listeners: [{
eventName: BI.YearPopup.EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
self.fireEvent(BI.YearCombo.EVENT_CONFIRM);
}
}],
behaviors: o.behaviors,
min: o.min,
max: o.max
}
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
var value = self.trigger.getKey();
if (BI.isNotNull(value)) {
self.popup.setValue(value);
} else if(!value && value !== self.storeValue){
} else if (!value && value !== self.storeValue) {
self.popup.setValue(self.storeValue);
}else {
} else {
self.setValue();
}
self.fireEvent(BI.YearCombo.EVENT_BEFORE_POPUPVIEW);
});
},
setValue: function (v) {
this.trigger.setValue(v);
this.popup.setValue(v);
this.combo.setValue(v);
},
getValue: function () {
@ -16665,6 +16692,7 @@ BI.YearCombo = BI.inherit(BI.Widget, {
}
});
BI.YearCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.YearCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut('bi.year_combo', BI.YearCombo);/**
* 年份展示面板
*
@ -16677,6 +16705,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.YearPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-year-popup",
behaviors: {},
min: '1900-01-01', //最小日期
max: '2099-12-31' //最大日期
});
@ -16687,6 +16716,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
var calendar = BI.createWidget({
type: "bi.year_calendar",
behaviors: o.behaviors,
min: o.min,
max: o.max,
logic: {
@ -16723,11 +16753,12 @@ BI.YearPopup = BI.inherit(BI.Widget, {
this.navigation = BI.createWidget({
type: "bi.navigation",
element: this,
single: true,
logic: {
dynamic: true
},
tab: {
cls: "year-popup-navigation bi-border-top",
cls: "year-popup-navigation bi-high-light bi-border-top",
height: 25,
items: [backBtn, preBtn]
},
@ -16882,6 +16913,8 @@ BI.YearMonthCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.YearMonthCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-year-month-combo",
yearBehaviors: {},
monthBehaviors: {},
height: 25
});
},
@ -16890,20 +16923,28 @@ BI.YearMonthCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.year = BI.createWidget({
type: "bi.year_combo"
type: "bi.year_combo",
behaviors: o.yearBehaviors
});
this.month = BI.createWidget({
type: "bi.month_combo"
type: "bi.month_combo",
behaviors: o.monthBehaviors
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function(){
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {
self.fireEvent(BI.YearMonthCombo.EVENT_CONFIRM);
});
this.year.on(BI.YearCombo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.YearMonthCombo.EVENT_BEFORE_POPUPVIEW);
});
this.month.on(BI.MonthCombo.EVENT_CONFIRM, function(){
this.month.on(BI.MonthCombo.EVENT_CONFIRM, function () {
self.fireEvent(BI.YearMonthCombo.EVENT_CONFIRM);
});
this.month.on(BI.MonthCombo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.YearMonthCombo.EVENT_BEFORE_POPUPVIEW);
});
BI.createWidget({
type: "bi.center",
@ -16928,6 +16969,7 @@ BI.YearMonthCombo = BI.inherit(BI.Widget, {
}
});
BI.YearMonthCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.YearMonthCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut('bi.year_month_combo', BI.YearMonthCombo);/**
* 年份 + 月份下拉框
*
@ -16938,6 +16980,8 @@ BI.YearQuarterCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.YearQuarterCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-year-quarter-combo",
yearBehaviors: {},
quarterBehaviors: {},
height: 25
});
},
@ -16946,20 +16990,28 @@ BI.YearQuarterCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.year = BI.createWidget({
type: "bi.year_combo"
type: "bi.year_combo",
behaviors: o.yearBehaviors
});
this.quarter = BI.createWidget({
type: "bi.quarter_combo"
type: "bi.quarter_combo",
behaviors: o.quarterBehaviors
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function(){
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {
self.fireEvent(BI.YearQuarterCombo.EVENT_CONFIRM);
});
this.year.on(BI.YearCombo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.YearQuarterCombo.EVENT_BEFORE_POPUPVIEW);
});
this.quarter.on(BI.QuarterCombo.EVENT_CONFIRM, function(){
this.quarter.on(BI.QuarterCombo.EVENT_CONFIRM, function () {
self.fireEvent(BI.YearQuarterCombo.EVENT_CONFIRM);
});
this.quarter.on(BI.QuarterCombo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.YearQuarterCombo.EVENT_BEFORE_POPUPVIEW);
});
BI.createWidget({
type: "bi.center",
@ -16984,6 +17036,7 @@ BI.YearQuarterCombo = BI.inherit(BI.Widget, {
}
});
BI.YearQuarterCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.YearQuarterCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut('bi.year_quarter_combo', BI.YearQuarterCombo);/**
* 简单的复选下拉框控件, 适用于数据量少的情况 与valuechooser的区别是allvaluechooser setValue和getValue返回的是所有值
* 封装了字段处理逻辑

62
docs/base.js

@ -3264,11 +3264,6 @@ BI.Combo = BI.inherit(BI.Widget, {
return this.position;
},
doBehavior: function () {
this._assertPopupView();
this.popupView && this.popupView.doBehavior.apply(this.popupView, arguments);
},
toggle: function () {
this._toggle();
},
@ -3532,11 +3527,6 @@ BI.Expander = BI.inherit(BI.Widget, {
return this.popupView;
},
doBehavior: function () {
//this._assertPopupView();
this.popupView && this.popupView.doBehavior.apply(this.popupView, arguments);
},
getAllLeaves: function () {
return this.popupView && this.popupView.getAllLeaves();
},
@ -3946,10 +3936,6 @@ BI.Loader = BI.inherit(BI.Widget, {
this.button_group.populate.apply(this.button_group, arguments);
},
doBehavior: function () {
this.button_group.doBehavior.apply(this.button_group, arguments);
},
setNotSelectedValue: function () {
this.button_group.setNotSelectedValue.apply(this.button_group, arguments);
},
@ -4704,11 +4690,6 @@ BI.Switcher = BI.inherit(BI.Widget, {
this.isViewVisible() && BI.Maskers.show(this.getName());
},
doBehavior: function () {
this._assertPopupView();
this.popupView && this.popupView.doBehavior.apply(this.popupView, arguments);
},
getAllLeaves: function () {
return this.popupView && this.popupView.getAllLeaves();
},
@ -19638,7 +19619,7 @@ BI.Label = BI.inherit(BI.Single, {
}
if (o.whiteSpace == "normal") {
this.text = BI.createWidget(json);
this.text = BI.createWidget({
BI.createWidget({
type: "bi.center_adapt",
hgap: o.hgap,
vgap: o.vgap,
@ -19836,7 +19817,7 @@ BI.Label = BI.inherit(BI.Single, {
}
if (o.whiteSpace == "normal") {
this.text = BI.createWidget(json)
this.text = BI.createWidget({
BI.createWidget({
type: "bi.vertical_adapt",
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
@ -29554,8 +29535,7 @@ BI.QuickCollectionTable = BI.inherit(BI.CollectionTable, {
_populateTable: function () {
var self = this, o = this.options;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0,
summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var freezeColLength = this._getFreezeColLength();
summaryColumnSizeArray = []
BI.each(o.columnSize, function (i, size) {
if (o.isNeedFreeze === true && o.freezeCols.contains(i)) {
totalLeftColumnSize += size;
@ -29571,13 +29551,13 @@ BI.QuickCollectionTable = BI.inherit(BI.CollectionTable, {
});
var otlw = regionSize;
var otlh = o.header.length * o.headerRowSize;
var otlh = this._getFreezeHeaderHeight();
var otrw = this._width - regionSize;
var otrh = o.header.length * o.headerRowSize;
var otrh = this._getFreezeHeaderHeight();
var oblw = regionSize;
var oblh = this._height - o.header.length * o.headerRowSize;
var oblh = this._height - otlh;
var obrw = this._width - regionSize;
var obrh = this._height - o.header.length * o.headerRowSize;
var obrh = this._height - otrh;
this.topLeft.setWidth(otlw);
this.topLeft.setHeight(otlh);
@ -29599,9 +29579,9 @@ BI.QuickCollectionTable = BI.inherit(BI.CollectionTable, {
var items = this.contextLayout.attr("items");
items[1].left = regionSize;
items[2].top = o.header.length * o.headerRowSize;
items[2].top = this._getFreezeHeaderHeight();
items[3].left = regionSize;
items[3].top = o.header.length * o.headerRowSize;
items[3].top = this._getFreezeHeaderHeight();
this.contextLayout.attr("items", items);
this.contextLayout.resize();
@ -29617,8 +29597,8 @@ BI.QuickCollectionTable = BI.inherit(BI.CollectionTable, {
};
run(this.topLeftItems, o.header, leftHeader);
run(this.topRightItems, o.header, rightHeader);
run(this.bottomLeftItems, o.items, leftItems);
run(this.bottomRightItems, o.items, rightItems);
run(this.bottomLeftItems, this._getActualItems(), leftItems);
run(this.bottomRightItems, this._getActualItems(), rightItems);
this.topLeftCollection.populate(leftHeader);
this.topRightCollection.populate(rightHeader);
@ -30274,7 +30254,7 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
_populateTable: function () {
var self = this, o = this.options;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [];
var freezeColLength = this._getFreezeColLength();
BI.each(o.columnSize, function (i, size) {
if (o.isNeedFreeze === true && o.freezeCols.contains(i)) {
@ -30291,13 +30271,13 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
});
var otlw = regionSize;
var otlh = o.header.length * o.headerRowSize;
var otlh = this._getFreezeHeaderHeight();
var otrw = this._width - regionSize;
var otrh = o.header.length * o.headerRowSize;
var otrh = this._getFreezeHeaderHeight();
var oblw = regionSize;
var oblh = this._height - o.header.length * o.headerRowSize;
var oblh = this._height - otlh;
var obrw = this._width - regionSize;
var obrh = this._height - o.header.length * o.headerRowSize;
var obrh = this._height - otrh;
this.topLeft.setWidth(otlw);
this.topLeft.setHeight(otlh);
@ -30328,9 +30308,9 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
var items = this.contextLayout.attr("items");
items[1].left = regionSize;
items[2].top = o.header.length * o.headerRowSize;
items[2].top = this._getFreezeHeaderHeight();
items[3].left = regionSize;
items[3].top = o.header.length * o.headerRowSize;
items[3].top = this._getFreezeHeaderHeight();
this.contextLayout.attr("items", items);
this.contextLayout.resize();
@ -30350,7 +30330,7 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
}
});
});
BI.each(o.items, function (i, cols) {
BI.each(this._getActualItems(), function (i, cols) {
leftItems[i] = [];
rightItems[i] = [];
BI.each(cols, function (j, col) {
@ -33019,10 +32999,6 @@ BI.CustomTree = BI.inherit(BI.Widget, {
this.tree.populate.apply(this.tree, args);
},
doBehavior: function () {
this.tree.doBehavior.apply(this.tree, arguments);
},
setValue: function (v) {
this.tree && this.tree.setValue(v);
},

27
docs/case.js

@ -1820,6 +1820,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, {
var conf = BI.YearCalendar.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-year-calendar",
behaviors: {},
logic: {
dynamic: false
},
@ -1884,6 +1885,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, {
this.years = BI.createWidget({
type: "bi.button_group",
behaviors: o.behaviors,
items: BI.createItems(items, {}),
layouts: [BI.LogicFactory.createLogic("table", BI.extend({}, o.logic, {
columns: 2,
@ -8360,10 +8362,6 @@ BI.ListPane = BI.inherit(BI.Pane, {
this.button_group.empty();
},
doBehavior: function () {
this.button_group.doBehavior.apply(this.button_group, arguments);
},
setNotSelectedValue: function () {
this.button_group.setNotSelectedValue.apply(this.button_group, arguments);
},
@ -8653,10 +8651,6 @@ BI.SelectList = BI.inherit(BI.Widget, {
this.list.element.css({"max-height": h - toolHeight + "px"})
},
doBehavior: function () {
this.list.doBehavior.apply(this.list, arguments);
},
setNotSelectedValue: function () {
this.list.setNotSelectedValue.apply(this.list, arguments);
this._checkAllSelected();
@ -8751,10 +8745,6 @@ BI.LazyLoader = BI.inherit(BI.Widget, {
this.loader.empty();
},
doBehavior: function () {
this.loader.doBehavior();
},
setNotSelectedValue: function () {
this.loader.setNotSelectedValue.apply(this.loader, arguments);
},
@ -8950,10 +8940,6 @@ BI.ListLoader = BI.inherit(BI.Widget, {
});
},
doBehavior: function () {
this.button_group.doBehavior.apply(this.button_group, arguments);
},
setNotSelectedValue: function () {
this.button_group.setNotSelectedValue.apply(this.button_group, arguments);
},
@ -9122,10 +9108,6 @@ BI.SortList = BI.inherit(BI.Widget, {
this.loader.empty();
},
doBehavior: function () {
this.loader.doBehavior.apply(this.loader, arguments);
},
setNotSelectedValue: function () {
this.loader.setNotSelectedValue.apply(this.loader, arguments);
},
@ -12126,10 +12108,6 @@ BI.LevelTree = BI.inherit(BI.Widget, {
this.tree.populate(items);
},
doBehavior: function () {
this.tree.doBehavior.apply(this.tree, arguments);
},
setValue: function (v) {
this.tree.setValue(v);
},
@ -12411,6 +12389,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
});
this.trigerButton = BI.createWidget({
type: "bi.trigger_icon_button",
cls: "bi-border-left",
width: c.triggerWidth
});

183
docs/core.css

@ -2958,12 +2958,18 @@ i {
cursor: default !important;
color: #cccccc !important;
}
.base-disabled .bi-input {
color: #cccccc !important;
}
.base-disabled .b-font:before {
color: #cccccc !important;
}
.bi-theme-dark .base-disabled {
color: #666666 !important;
}
.bi-theme-dark .base-disabled .bi-input {
color: #666666 !important;
}
.bi-theme-dark .base-disabled .b-font:before {
color: #666666 !important;
}
@ -2986,27 +2992,48 @@ i {
background-color: #eff1f4;
color: #666666;
}
.bi-background .bi-input {
color: #666666;
}
.bi-theme-dark .bi-background {
background-color: #191b2b;
color: #cccccc;
}
.bi-theme-dark .bi-background .bi-input {
color: #cccccc;
}
.bi-card {
background-color: #ffffff;
color: #666666;
}
.bi-card .bi-input {
color: #666666;
}
.bi-theme-dark .bi-card {
background-color: #242640;
color: #cccccc;
}
.bi-theme-dark .bi-card .bi-input {
color: #cccccc;
}
.bi-disabled {
color: #cccccc;
}
.bi-disabled .bi-input {
color: #cccccc;
}
.bi-theme-dark .bi-disabled {
color: #666666;
}
.bi-theme-dark .bi-disabled .bi-input {
color: #666666;
}
.bi-tips {
color: #999999;
}
.bi-tips .bi-input {
color: #999999;
}
.bi-border {
border: 1px solid #d4dadd;
}
@ -3040,13 +3067,22 @@ i {
.bi-keyword-red-mark {
color: #f07d0a;
}
.bi-keyword-red-mark .bi-input {
color: #f07d0a;
}
.bi-high-light {
color: #3f8ce8;
}
.bi-high-light .bi-input {
color: #3f8ce8;
}
.bi-high-light-background {
background-color: #3f8ce8;
color: #ffffff;
}
.bi-high-light-background .bi-input {
color: #ffffff;
}
.bi-high-light-border {
border-color: #178cdf;
}
@ -3054,9 +3090,15 @@ i {
color: #cccccc;
cursor: text;
}
.bi-water-mark .bi-input {
color: #cccccc;
}
.bi-theme-dark .bi-water-mark {
color: #666666;
}
.bi-theme-dark .bi-water-mark .bi-input {
color: #666666;
}
.bi-resizer {
background: #1a1a1a;
opacity: 0.2;
@ -3071,28 +3113,46 @@ i {
background-color: rgba(26, 26, 26, 0.2);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#331a1a1a,endColorstr=#331a1a1a);
}
.bi-mask .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-mask {
color: #242640;
background-color: rgba(255, 255, 255, 0.2);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#33ffffff,endColorstr=#33ffffff);
}
.bi-theme-dark .bi-mask .bi-input {
color: #242640;
}
.bi-z-index-mask {
color: #ffffff;
background-color: rgba(26, 26, 26, 0.5);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#801a1a1a,endColorstr=#801a1a1a);
}
.bi-z-index-mask .bi-input {
color: #ffffff;
}
.bi-list-item:hover,
.bi-list-item.hover {
color: #1a1a1a;
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item:hover .bi-input,
.bi-list-item.hover .bi-input {
color: #1a1a1a;
}
.bi-list-item.disabled,
.bi-list-item.disabled:hover,
.bi-list-item.disabled:active {
background-color: transparent !important;
color: #cccccc !important;
}
.bi-list-item.disabled .bi-input,
.bi-list-item.disabled:hover .bi-input,
.bi-list-item.disabled:active .bi-input {
color: #cccccc !important;
}
.bi-list-item.disabled .bi-high-light,
.bi-list-item.disabled:hover .bi-high-light,
.bi-list-item.disabled:active .bi-high-light {
@ -3104,12 +3164,21 @@ i {
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item:hover .bi-input,
.bi-theme-dark .bi-list-item.hover .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-list-item.disabled,
.bi-theme-dark .bi-list-item.disabled:hover,
.bi-theme-dark .bi-list-item.disabled:active {
background-color: transparent !important;
color: #666666 !important;
}
.bi-theme-dark .bi-list-item.disabled .bi-input,
.bi-theme-dark .bi-list-item.disabled:hover .bi-input,
.bi-theme-dark .bi-list-item.disabled:active .bi-input {
color: #666666 !important;
}
.bi-theme-dark .bi-list-item.disabled .bi-high-light,
.bi-theme-dark .bi-list-item.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item.disabled:active .bi-high-light {
@ -3122,15 +3191,27 @@ i {
.bi-list-item-simple {
color: #999999;
}
.bi-list-item-simple .bi-input {
color: #999999;
}
.bi-list-item-simple:hover,
.bi-list-item-simple.hover {
color: #3f8ce8;
}
.bi-list-item-simple:hover .bi-input,
.bi-list-item-simple.hover .bi-input {
color: #3f8ce8;
}
.bi-list-item-simple.disabled,
.bi-list-item-simple.disabled:hover,
.bi-list-item-simple.disabled:active {
color: #cccccc !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;
}
.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 {
@ -3139,15 +3220,27 @@ i {
.bi-list-item-effect:hover {
color: #1a1a1a;
}
.bi-list-item-effect:hover .bi-input {
color: #1a1a1a;
}
.bi-list-item-effect.active,
.bi-list-item-effect:active {
color: #3f8ce8;
}
.bi-list-item-effect.active .bi-input,
.bi-list-item-effect:active .bi-input {
color: #3f8ce8;
}
.bi-list-item-effect.disabled,
.bi-list-item-effect.disabled:hover,
.bi-list-item-effect.disabled:active {
color: #cccccc !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;
}
.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 {
@ -3156,16 +3249,28 @@ i {
.bi-theme-dark .bi-list-item-effect:hover {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-effect:hover .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-effect.active,
.bi-theme-dark .bi-list-item-effect:active {
color: #3f8ce8;
}
.bi-theme-dark .bi-list-item-effect.active .bi-input,
.bi-theme-dark .bi-list-item-effect:active .bi-input {
color: #3f8ce8;
}
.bi-theme-dark .bi-list-item-effect.disabled,
.bi-theme-dark .bi-list-item-effect.disabled:hover,
.bi-theme-dark .bi-list-item-effect.disabled:active {
background-color: transparent !important;
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-effect.disabled .bi-input,
.bi-theme-dark .bi-list-item-effect.disabled:hover .bi-input,
.bi-theme-dark .bi-list-item-effect.disabled:active .bi-input {
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-effect.disabled .bi-high-light,
.bi-theme-dark .bi-list-item-effect.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item-effect.disabled:active .bi-high-light {
@ -3177,18 +3282,31 @@ i {
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item-active:hover .bi-input,
.bi-list-item-active.hover .bi-input {
color: #1a1a1a;
}
.bi-list-item-active.active,
.bi-list-item-active:active {
color: #3f8ce8;
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;
}
.bi-list-item-active.disabled,
.bi-list-item-active.disabled:hover,
.bi-list-item-active.disabled:active {
background-color: transparent !important;
color: #cccccc !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;
}
.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 {
@ -3200,18 +3318,31 @@ i {
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item-active:hover .bi-input,
.bi-theme-dark .bi-list-item-active.hover .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-active.active,
.bi-theme-dark .bi-list-item-active:active {
color: #3f8ce8;
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;
}
.bi-theme-dark .bi-list-item-active.disabled,
.bi-theme-dark .bi-list-item-active.disabled:hover,
.bi-theme-dark .bi-list-item-active.disabled:active {
background-color: transparent !important;
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-active.disabled .bi-input,
.bi-theme-dark .bi-list-item-active.disabled:hover .bi-input,
.bi-theme-dark .bi-list-item-active.disabled:active .bi-input {
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-active.disabled .bi-high-light,
.bi-theme-dark .bi-list-item-active.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item-active.disabled:active .bi-high-light {
@ -3222,17 +3353,30 @@ i {
color: #1a1a1a;
background-color: #ffffff;
}
.bi-list-item-active2:hover .bi-input,
.bi-list-item-active2.hover .bi-input {
color: #1a1a1a;
}
.bi-list-item-active2.active,
.bi-list-item-active2:active {
color: #3f8ce8;
background-color: #ffffff;
}
.bi-list-item-active2.active .bi-input,
.bi-list-item-active2:active .bi-input {
color: #3f8ce8;
}
.bi-list-item-active2.disabled,
.bi-list-item-active2.disabled:hover,
.bi-list-item-active2.disabled:active {
background-color: transparent !important;
color: #cccccc !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;
}
.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 {
@ -3243,17 +3387,30 @@ i {
color: #ffffff;
background-color: #242640;
}
.bi-theme-dark .bi-list-item-active2:hover .bi-input,
.bi-theme-dark .bi-list-item-active2.hover .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-active2.active,
.bi-theme-dark .bi-list-item-active2:active {
color: #3f8ce8;
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;
}
.bi-theme-dark .bi-list-item-active2.disabled,
.bi-theme-dark .bi-list-item-active2.disabled:hover,
.bi-theme-dark .bi-list-item-active2.disabled:active {
background-color: transparent !important;
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-active2.disabled .bi-input,
.bi-theme-dark .bi-list-item-active2.disabled:hover .bi-input,
.bi-theme-dark .bi-list-item-active2.disabled:active .bi-input {
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-active2.disabled .bi-high-light,
.bi-theme-dark .bi-list-item-active2.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item-active2.disabled:active .bi-high-light {
@ -3265,11 +3422,19 @@ i {
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item-select:hover .bi-input,
.bi-list-item-select.hover .bi-input {
color: #1a1a1a;
}
.bi-list-item-select:active,
.bi-list-item-select.active {
color: #ffffff;
background-color: #3f8ce8;
}
.bi-list-item-select:active .bi-input,
.bi-list-item-select.active .bi-input {
color: #ffffff;
}
.bi-list-item-select:active .bi-high-light,
.bi-list-item-select.active .bi-high-light {
color: #ffffff;
@ -3280,6 +3445,11 @@ i {
color: #cccccc !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;
}
.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 {
@ -3291,11 +3461,19 @@ i {
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item-select:hover .bi-input,
.bi-theme-dark .bi-list-item-select.hover .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-select:active,
.bi-theme-dark .bi-list-item-select.active {
color: #ffffff;
background-color: #3f8ce8;
}
.bi-theme-dark .bi-list-item-select:active .bi-input,
.bi-theme-dark .bi-list-item-select.active .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-select:active .bi-high-light,
.bi-theme-dark .bi-list-item-select.active .bi-high-light {
color: #ffffff;
@ -3306,6 +3484,11 @@ i {
background-color: transparent !important;
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-select.disabled .bi-input,
.bi-theme-dark .bi-list-item-select.disabled:hover .bi-input,
.bi-theme-dark .bi-list-item-select.disabled:active .bi-input {
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-select.disabled .bi-high-light,
.bi-theme-dark .bi-list-item-select.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item-select.disabled:active .bi-high-light {

69
docs/core.js

@ -14362,6 +14362,8 @@ BI.Widget = BI.inherit(BI.OB, {
update: function () {
},
beforeDestroyed: null,
destroyed: null,
_init: function () {
@ -14579,6 +14581,14 @@ BI.Widget = BI.inherit(BI.OB, {
}
},
doBehavior: function () {
var args = arguments;
//递归将所有子组件使有效
BI.each(this._children, function (i, child) {
child.doBehavior && child.doBehavior.apply(child, args);
});
},
getWidth: function () {
return this.options.width;
},
@ -14713,18 +14723,20 @@ BI.Widget = BI.inherit(BI.OB, {
},
__d: function () {
this.beforeDestroyed && this.beforeDestroyed();
BI.each(this._children, function (i, widget) {
widget._unMount && widget._unMount();
});
this._children = {};
this._parent = null;
this._isMounted = false;
this.destroyed && this.destroyed();
},
_unMount: function () {
this.__d();
this.fireEvent(BI.Events.UNMOUNT);
this.purgeListeners();
this.destroyed && this.destroyed();
},
isolate: function () {
@ -14744,14 +14756,12 @@ BI.Widget = BI.inherit(BI.OB, {
_destroy: function () {
this.__d();
this.destroyed && this.destroyed();
this.element.destroy();
this.purgeListeners();
},
destroy: function () {
this.__d();
this.destroyed && this.destroyed();
this.element.destroy();
this.fireEvent(BI.Events.DESTROY);
this.purgeListeners();
@ -15247,6 +15257,8 @@ BI.View = BI.inherit(BI.V, {
created: null,
beforeDestroyed: null,
destroyed: null,
_init: function () {
@ -15736,18 +15748,22 @@ BI.View = BI.inherit(BI.V, {
},
_unMount: function () {
this.beforeDestroyed && this.beforeDestroyed();
BI.each(this._cardLayouts, function (name, card) {
card && card._unMount();
});
delete this._cardLayouts;
delete this._cards;
this.destroyed && this.destroyed();
this.trigger(BI.Events.UNMOUNT);
this.off();
},
_destroy: function () {
var self = this;
BI.each(this._cardLayouts, function (name, card) {
card && card._unMount();
BI.Layers.remove(name + self.cid);
});
delete this._cardLayouts;
delete this._cards;
@ -20124,7 +20140,7 @@ BI.PopoverSection.EVENT_CLOSE = "EVENT_CLOSE";;(function () {
if (numReg) {
var num = numReg[0];
var orilen = num.length;
var newnum = BI.parseInt(num) + 1 + '';
var newnum = parseInt(num) + 1 + '';
//进位到整数部分
if (newnum.length > orilen) {
newnum = newnum.substr(1);
@ -20620,26 +20636,34 @@ BI.PopoverSection.EVENT_CLOSE = "EVENT_CLOSE";;(function () {
* @extends BI.Behavior
*/
BI.HighlightBehavior = BI.inherit(BI.Behavior, {
_defaultConfig: function() {
return BI.extend(BI.HighlightBehavior.superclass._defaultConfig.apply(this, arguments), {
});
_defaultConfig: function () {
return BI.extend(BI.HighlightBehavior.superclass._defaultConfig.apply(this, arguments), {});
},
_init : function() {
_init: function () {
BI.HighlightBehavior.superclass._init.apply(this, arguments);
},
doBehavior: function(items){
doBehavior: function (items) {
var args = Array.prototype.slice.call(arguments, 1),
o = this.options;
BI.each(items, function(i, item){
if(item instanceof BI.Single) {
if (o.rule(item.getValue(), item)) {
item.doHighLight.apply(item, args);
BI.each(items, function (i, item) {
if (item instanceof BI.Single) {
var rule = o.rule(item.getValue(), item);
function doBe(run) {
if (run === true) {
item.doHighLight.apply(item, args);
} else {
item.unHighLight.apply(item, args);
}
}
if (BI.isFunction(rule)) {
rule(doBe);
} else {
item.unHighLight.apply(item, args);
doBe(rule);
}
} else {
item.doBehavior.apply(item, args);
@ -21536,7 +21560,10 @@ BI.FloatBoxRouter = BI.inherit(BI.WRouter, {
var view = this.createView(url, data, viewData, context);
isValid && context.model.addChild(modelData, view.model);
view.listenTo(view.model, "destroy", function () {
self.remove(url);
self.remove(url, context);
});
context.on(BI.Events.UNMOUNT, function () {
self.remove(url, context);
});
this.store[url].populate(view);
this.views[url] = view;
@ -21575,7 +21602,7 @@ BI.FloatBoxRouter = BI.inherit(BI.WRouter, {
remove: function (url, context) {
url = context.rootURL + "/" + url;
if(this.controller){
if (this.controller) {
this.controller.remove(url);
delete this.store[url];
this.views[url] && this.views[url].model.destroy();
@ -21742,6 +21769,12 @@ _.extend(BI, {
*/
DESTROY: '_DESTROY',
/**
* @static
* @property 取消挂载事件
*/
UNMOUNT: '_UNMOUNT',
/**
* @static
* @property 清除选择
@ -22830,7 +22863,7 @@ BI.extend(BI.DOM, {
}
var rgb = this.rgb2json(this.hex2rgb(hex));
var grayLevel = Math.round(rgb.r * 0.299 + rgb.g * 0.587 + rgb.b * 0.114);
if (grayLevel < 140) {
if (grayLevel < 192/**网上给的是140**/) {
return true;
}
return false;

1
docs/widget.css

@ -516,7 +516,6 @@
/**** custom color(自定义颜色,用于特定场景) ****/
.bi-year-popup .year-popup-navigation {
line-height: 30px;
color: #3f8ce8;
}
.bi-year-popup .year-popup-navigation > .center-element {
border-left: 1px solid #d4dadd;

191
docs/widget.js

@ -103,12 +103,13 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
_getStart: function (nodes) {
var self = this;
var start = this.start;
BI.each(nodes, function (i, node) {
BI.some(nodes, function (i, node) {
if (BI.isNotEmptyArray(node.children)) {
BI.each(node.children, function (index, child) {
return BI.some(node.children, function (index, child) {
if (index === 0) {
if (self.cache[child.text || child.value]) {
start = self.cache[child.text || child.value];
return true;
}
}
});
@ -474,8 +475,8 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, {
width: ui.size.width,
height: height
});
self.arrangement.scrollTo(height);
}, 500);
self.arrangement.scrollTo({top: height});
}, 300);
};
this.arrangement.container.element.resizable({
handles: "s",
@ -878,6 +879,10 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, {
return this.arrangement.setRegionPosition(name, position);
},
scrollTo: function (scroll) {
this.arrangement.scrollTo(scroll);
},
zoom: function (ratio) {
this.arrangement.zoom(ratio);
},
@ -1204,7 +1209,8 @@ BI.Arrangement = BI.inherit(BI.Widget, {
findBottomRegions.push(region);
}
});
var topValid = isRegionsValid(findTopRegions, "top"), bottomValid = isRegionsValid(findBottomRegions, "bottom");
var topValid = isRegionsValid(findTopRegions, "top"),
bottomValid = isRegionsValid(findBottomRegions, "bottom");
if (topValid && bottomValid) {
BI.each(findTopRegions, function (i, region) {
var clone = BI.clone(region);
@ -1247,7 +1253,8 @@ BI.Arrangement = BI.inherit(BI.Widget, {
findRightRegions.push(region);
}
});
var leftValid = isRegionsValid(findLeftRegions, "left"), rightValid = isRegionsValid(findRightRegions, "right");
var leftValid = isRegionsValid(findLeftRegions, "left"),
rightValid = isRegionsValid(findRightRegions, "right");
if (leftValid && rightValid) {
BI.each(findLeftRegions, function (i, region) {
var clone = BI.clone(region);
@ -3678,8 +3685,9 @@ BI.Arrangement = BI.inherit(BI.Widget, {
this.resize();
},
scrollTo: function (top) {
this.scrollContainer.element.scrollTop(top);
scrollTo: function (scroll) {
this.scrollContainer.element.scrollTop(scroll.top);
this.scrollContainer.element.scrollLeft(scroll.left);
},
zoom: function (ratio) {
@ -3690,6 +3698,7 @@ BI.Arrangement = BI.inherit(BI.Widget, {
var occupied = this._applyContainer();
switch (this.getLayoutType()) {
case BI.Arrangement.LAYOUT_TYPE.ADAPTIVE:
case BI.Arrangement.LAYOUT_TYPE.FREE:
if (this._isArrangeFine()) {
var width = this.getClientWidth();
var xRatio = (ratio.x || 1) * width / (occupied.left + occupied.width);
@ -3710,8 +3719,6 @@ BI.Arrangement = BI.inherit(BI.Widget, {
this.relayout();
}
break;
case BI.Arrangement.LAYOUT_TYPE.FREE:
break;
case BI.Arrangement.LAYOUT_TYPE.GRID:
if (this._isArrangeFine()) {
var width = this.getClientWidth();
@ -4217,7 +4224,7 @@ BI.BranchRelation = BI.inherit(BI.Widget, {
if (end.length > 0) {
path += "M" + BI.first(end).x + "," + split + "L" + BI.last(end).x + "," + split;
}
self.svg.path(path).attr("stroke", "gray");
self.svg.path(path).attr("stroke", "#d4dadd");
}
})
});
@ -4238,7 +4245,7 @@ BI.BranchRelation = BI.inherit(BI.Widget, {
if (end.length > 0) {
path += "M" + BI.first(end).x + "," + split + "L" + BI.last(end).x + "," + split;
}
self.svg.path(path).attr("stroke", "gray");
self.svg.path(path).attr("stroke", "#d4dadd");
}
})
});
@ -4259,7 +4266,7 @@ BI.BranchRelation = BI.inherit(BI.Widget, {
if (end.length > 0) {
path += "M" + split + "," + BI.first(end).x + "L" + split + "," + BI.last(end).x;
}
self.svg.path(path).attr("stroke", "gray");
self.svg.path(path).attr("stroke", "#d4dadd");
}
})
});
@ -4280,7 +4287,7 @@ BI.BranchRelation = BI.inherit(BI.Widget, {
if (end.length > 0) {
path += "M" + split + "," + BI.first(end).x + "L" + split + "," + BI.last(end).x;
}
self.svg.path(path).attr("stroke", "gray");
self.svg.path(path).attr("stroke", "#d4dadd");
}
})
});
@ -7681,6 +7688,10 @@ BI.InteractiveArrangement = BI.inherit(BI.Widget, {
return this.arrangement.setRegionPosition(name, position);
},
scrollTo: function (scroll) {
this.arrangement.scrollTo(scroll);
},
zoom: function (ratio) {
this.arrangement.zoom(ratio);
},
@ -7739,6 +7750,7 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MonthCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-month-combo",
behaviors: {},
height: 25
});
},
@ -7751,9 +7763,9 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
});
this.trigger.on(BI.MonthTrigger.EVENT_CONFIRM, function (v) {
if(this.getKey() && this.getKey() !== self.storeValue) {
if (this.getKey() && this.getKey() !== self.storeValue) {
self.setValue(this.getValue());
}else if(!this.getKey()){
} else if (!this.getKey()) {
self.setValue();
}
self.fireEvent(BI.MonthCombo.EVENT_CONFIRM);
@ -7774,7 +7786,8 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
});
this.popup = BI.createWidget({
type: "bi.month_popup"
type: "bi.month_popup",
behaviors: o.behaviors
});
this.popup.on(BI.MonthPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
@ -7792,7 +7805,10 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
minWidth: 85,
el: this.popup
}
})
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.MonthCombo.EVENT_BEFORE_POPUPVIEW);
});
},
setValue: function (v) {
@ -7806,6 +7822,7 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
});
BI.MonthCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.MonthCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut('bi.month_combo', BI.MonthCombo);/**
* 月份展示面板
*
@ -7817,13 +7834,14 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MonthPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-month-popup"
baseCls: "bi-month-popup",
behaviors: {}
});
},
_init: function () {
BI.MonthPopup.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
//纵向排列月
var month = [0, 6, 1, 7, 2, 8, 3, 9, 4, 10, 5, 11];
@ -7854,6 +7872,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
this.month = BI.createWidget({
type: "bi.button_group",
element: this,
behaviors: o.behaviors,
items: BI.createItems(items, {}),
layouts: [BI.LogicFactory.createLogic("table", BI.extend({
dynamic: true
@ -8170,10 +8189,6 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, {
this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0));
},
doBehavior: function () {
this.tree.doBehavior.apply(this.tree, arguments);
},
setValue: function (v) {
this.tree.setValue(v);
},
@ -8715,10 +8730,6 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, {
this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0));
},
doBehavior: function () {
this.tree.doBehavior.apply(this.tree, arguments);
},
setValue: function (v) {
this.tree.setValue(v);
},
@ -11614,7 +11625,7 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
setValue: function (v) {
v || (v = {});
this.display.setValue(v.value);
this.display.setSelectedValue(v.value);
},
getValue: function () {
@ -11732,6 +11743,9 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
self.trigger.getSearcher().adjustView();
});
}
},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
});
@ -12279,8 +12293,8 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
var conf = BI.NumericalInterval.superclass._defaultConfig.apply(this, arguments)
return BI.extend(conf, {
extraCls: "bi-numerical-interval",
height: 25
height: 25,
validation: "valid"
})
},
_init: function () {
@ -12681,8 +12695,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
})
},
isValid: function () {
isStateValid: function () {
return this.options.validation === "valid";
},
@ -13106,8 +13119,8 @@ BI.shortcut('bi.page_table', BI.PageTable);/**
BI.PathChooser = BI.inherit(BI.Widget, {
_const: {
lineColor: "#c4c6c6",
selectLineColor: "#009de3"
lineColor: "#d4dadd",
selectLineColor: "#3f8ce8"
},
_defaultConfig: function () {
@ -13976,6 +13989,7 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.QuarterCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-quarter-combo",
behaviors: {},
height: 25
});
},
@ -13996,24 +14010,25 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
this.trigger.on(BI.QuarterTrigger.EVENT_START, function () {
self.combo.isViewVisible() && self.combo.hideView();
});
this.trigger.on(BI.QuarterTrigger.EVENT_STOP, function(){
this.trigger.on(BI.QuarterTrigger.EVENT_STOP, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.trigger.on(BI.QuarterTrigger.EVENT_CONFIRM, function () {
if(self.combo.isViewVisible()) {
if (self.combo.isViewVisible()) {
return;
}
if(this.getKey() && this.getKey() !== self.storeValue) {
if (this.getKey() && this.getKey() !== self.storeValue) {
self.setValue(this.getKey());
}else if(!this.getKey()){
} else if (!this.getKey()) {
self.setValue();
}
self.fireEvent(BI.QuarterCombo.EVENT_CONFIRM);
});
this.popup = BI.createWidget({
type: "bi.quarter_popup"
type: "bi.quarter_popup",
behaviors: o.behaviors
});
this.popup.on(BI.QuarterPopup.EVENT_CHANGE, function () {
@ -14033,6 +14048,9 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
el: this.popup
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.QuarterCombo.EVENT_BEFORE_POPUPVIEW);
});
},
setValue: function (v) {
@ -14046,6 +14064,7 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
});
BI.QuarterCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.QuarterCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut('bi.quarter_combo', BI.QuarterCombo);/**
* 季度展示面板
*
@ -14057,13 +14076,14 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.QuarterPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-quarter-popup"
baseCls: "bi-quarter-popup",
behaviors: {}
});
},
_init: function () {
BI.QuarterPopup.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
var items = [{
text: Date._QN[01],
@ -14093,6 +14113,7 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
this.quarter = BI.createWidget({
type: "bi.button_group",
element: this,
behaviors: o.behaviors,
items: BI.createItems(items, {}),
layouts: [{
type: "bi.vertical"
@ -16581,6 +16602,7 @@ BI.YearCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.YearCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-year-combo",
behaviors: {},
min: '1900-01-01', //最小日期
max: '2099-12-31', //最大日期
height: 25
@ -16608,7 +16630,7 @@ BI.YearCombo = BI.inherit(BI.Widget, {
self.combo.isViewVisible() && self.combo.hideView();
});
this.trigger.on(BI.YearTrigger.EVENT_CONFIRM, function () {
if(self.combo.isViewVisible()) {
if (self.combo.isViewVisible()) {
return;
}
if (this.getKey() && this.getKey() !== self.storeValue) {
@ -16619,45 +16641,50 @@ BI.YearCombo = BI.inherit(BI.Widget, {
self.fireEvent(BI.YearCombo.EVENT_CONFIRM);
});
this.popup = BI.createWidget({
type: "bi.year_popup",
min: o.min,
max: o.max
});
this.popup.on(BI.YearPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
self.fireEvent(BI.YearCombo.EVENT_CONFIRM);
});
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
destroyWhenHide: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
popup: {
minWidth: 85,
stopPropagation: false,
el: this.popup
el: {
type: "bi.year_popup",
ref: function () {
self.popup = this;
},
listeners: [{
eventName: BI.YearPopup.EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
self.fireEvent(BI.YearCombo.EVENT_CONFIRM);
}
}],
behaviors: o.behaviors,
min: o.min,
max: o.max
}
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
var value = self.trigger.getKey();
if (BI.isNotNull(value)) {
self.popup.setValue(value);
} else if(!value && value !== self.storeValue){
} else if (!value && value !== self.storeValue) {
self.popup.setValue(self.storeValue);
}else {
} else {
self.setValue();
}
self.fireEvent(BI.YearCombo.EVENT_BEFORE_POPUPVIEW);
});
},
setValue: function (v) {
this.trigger.setValue(v);
this.popup.setValue(v);
this.combo.setValue(v);
},
getValue: function () {
@ -16665,6 +16692,7 @@ BI.YearCombo = BI.inherit(BI.Widget, {
}
});
BI.YearCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.YearCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut('bi.year_combo', BI.YearCombo);/**
* 年份展示面板
*
@ -16677,6 +16705,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.YearPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-year-popup",
behaviors: {},
min: '1900-01-01', //最小日期
max: '2099-12-31' //最大日期
});
@ -16687,6 +16716,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
var calendar = BI.createWidget({
type: "bi.year_calendar",
behaviors: o.behaviors,
min: o.min,
max: o.max,
logic: {
@ -16723,11 +16753,12 @@ BI.YearPopup = BI.inherit(BI.Widget, {
this.navigation = BI.createWidget({
type: "bi.navigation",
element: this,
single: true,
logic: {
dynamic: true
},
tab: {
cls: "year-popup-navigation bi-border-top",
cls: "year-popup-navigation bi-high-light bi-border-top",
height: 25,
items: [backBtn, preBtn]
},
@ -16882,6 +16913,8 @@ BI.YearMonthCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.YearMonthCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-year-month-combo",
yearBehaviors: {},
monthBehaviors: {},
height: 25
});
},
@ -16890,20 +16923,28 @@ BI.YearMonthCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.year = BI.createWidget({
type: "bi.year_combo"
type: "bi.year_combo",
behaviors: o.yearBehaviors
});
this.month = BI.createWidget({
type: "bi.month_combo"
type: "bi.month_combo",
behaviors: o.monthBehaviors
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function(){
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {
self.fireEvent(BI.YearMonthCombo.EVENT_CONFIRM);
});
this.year.on(BI.YearCombo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.YearMonthCombo.EVENT_BEFORE_POPUPVIEW);
});
this.month.on(BI.MonthCombo.EVENT_CONFIRM, function(){
this.month.on(BI.MonthCombo.EVENT_CONFIRM, function () {
self.fireEvent(BI.YearMonthCombo.EVENT_CONFIRM);
});
this.month.on(BI.MonthCombo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.YearMonthCombo.EVENT_BEFORE_POPUPVIEW);
});
BI.createWidget({
type: "bi.center",
@ -16928,6 +16969,7 @@ BI.YearMonthCombo = BI.inherit(BI.Widget, {
}
});
BI.YearMonthCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.YearMonthCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut('bi.year_month_combo', BI.YearMonthCombo);/**
* 年份 + 月份下拉框
*
@ -16938,6 +16980,8 @@ BI.YearQuarterCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.YearQuarterCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-year-quarter-combo",
yearBehaviors: {},
quarterBehaviors: {},
height: 25
});
},
@ -16946,20 +16990,28 @@ BI.YearQuarterCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.year = BI.createWidget({
type: "bi.year_combo"
type: "bi.year_combo",
behaviors: o.yearBehaviors
});
this.quarter = BI.createWidget({
type: "bi.quarter_combo"
type: "bi.quarter_combo",
behaviors: o.quarterBehaviors
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function(){
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {
self.fireEvent(BI.YearQuarterCombo.EVENT_CONFIRM);
});
this.year.on(BI.YearCombo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.YearQuarterCombo.EVENT_BEFORE_POPUPVIEW);
});
this.quarter.on(BI.QuarterCombo.EVENT_CONFIRM, function(){
this.quarter.on(BI.QuarterCombo.EVENT_CONFIRM, function () {
self.fireEvent(BI.YearQuarterCombo.EVENT_CONFIRM);
});
this.quarter.on(BI.QuarterCombo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.YearQuarterCombo.EVENT_BEFORE_POPUPVIEW);
});
BI.createWidget({
type: "bi.center",
@ -16984,6 +17036,7 @@ BI.YearQuarterCombo = BI.inherit(BI.Widget, {
}
});
BI.YearQuarterCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.YearQuarterCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut('bi.year_quarter_combo', BI.YearQuarterCombo);/**
* 简单的复选下拉框控件, 适用于数据量少的情况 与valuechooser的区别是allvaluechooser setValue和getValue返回的是所有值
* 封装了字段处理逻辑

5
src/base/combination/combo.js

@ -375,11 +375,6 @@ BI.Combo = BI.inherit(BI.Widget, {
return this.position;
},
doBehavior: function () {
this._assertPopupView();
this.popupView && this.popupView.doBehavior.apply(this.popupView, arguments);
},
toggle: function () {
this._toggle();
},

5
src/base/combination/expander.js

@ -235,11 +235,6 @@ BI.Expander = BI.inherit(BI.Widget, {
return this.popupView;
},
doBehavior: function () {
//this._assertPopupView();
this.popupView && this.popupView.doBehavior.apply(this.popupView, arguments);
},
getAllLeaves: function () {
return this.popupView && this.popupView.getAllLeaves();
},

4
src/base/combination/loader.js

@ -195,10 +195,6 @@ BI.Loader = BI.inherit(BI.Widget, {
this.button_group.populate.apply(this.button_group, arguments);
},
doBehavior: function () {
this.button_group.doBehavior.apply(this.button_group, arguments);
},
setNotSelectedValue: function () {
this.button_group.setNotSelectedValue.apply(this.button_group, arguments);
},

5
src/base/combination/switcher.js

@ -239,11 +239,6 @@ BI.Switcher = BI.inherit(BI.Widget, {
this.isViewVisible() && BI.Maskers.show(this.getName());
},
doBehavior: function () {
this._assertPopupView();
this.popupView && this.popupView.doBehavior.apply(this.popupView, arguments);
},
getAllLeaves: function () {
return this.popupView && this.popupView.getAllLeaves();
},

4
src/base/single/label/label.js

@ -147,7 +147,7 @@ BI.Label = BI.inherit(BI.Single, {
}
if (o.whiteSpace == "normal") {
this.text = BI.createWidget(json);
this.text = BI.createWidget({
BI.createWidget({
type: "bi.center_adapt",
hgap: o.hgap,
vgap: o.vgap,
@ -345,7 +345,7 @@ BI.Label = BI.inherit(BI.Single, {
}
if (o.whiteSpace == "normal") {
this.text = BI.createWidget(json)
this.text = BI.createWidget({
BI.createWidget({
type: "bi.vertical_adapt",
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,

19
src/base/table/table.collection.quick.js

@ -117,8 +117,7 @@ BI.QuickCollectionTable = BI.inherit(BI.CollectionTable, {
_populateTable: function () {
var self = this, o = this.options;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0,
summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var freezeColLength = this._getFreezeColLength();
summaryColumnSizeArray = []
BI.each(o.columnSize, function (i, size) {
if (o.isNeedFreeze === true && o.freezeCols.contains(i)) {
totalLeftColumnSize += size;
@ -134,13 +133,13 @@ BI.QuickCollectionTable = BI.inherit(BI.CollectionTable, {
});
var otlw = regionSize;
var otlh = o.header.length * o.headerRowSize;
var otlh = this._getFreezeHeaderHeight();
var otrw = this._width - regionSize;
var otrh = o.header.length * o.headerRowSize;
var otrh = this._getFreezeHeaderHeight();
var oblw = regionSize;
var oblh = this._height - o.header.length * o.headerRowSize;
var oblh = this._height - otlh;
var obrw = this._width - regionSize;
var obrh = this._height - o.header.length * o.headerRowSize;
var obrh = this._height - otrh;
this.topLeft.setWidth(otlw);
this.topLeft.setHeight(otlh);
@ -162,9 +161,9 @@ BI.QuickCollectionTable = BI.inherit(BI.CollectionTable, {
var items = this.contextLayout.attr("items");
items[1].left = regionSize;
items[2].top = o.header.length * o.headerRowSize;
items[2].top = this._getFreezeHeaderHeight();
items[3].left = regionSize;
items[3].top = o.header.length * o.headerRowSize;
items[3].top = this._getFreezeHeaderHeight();
this.contextLayout.attr("items", items);
this.contextLayout.resize();
@ -180,8 +179,8 @@ BI.QuickCollectionTable = BI.inherit(BI.CollectionTable, {
};
run(this.topLeftItems, o.header, leftHeader);
run(this.topRightItems, o.header, rightHeader);
run(this.bottomLeftItems, o.items, leftItems);
run(this.bottomRightItems, o.items, rightItems);
run(this.bottomLeftItems, this._getActualItems(), leftItems);
run(this.bottomRightItems, this._getActualItems(), rightItems);
this.topLeftCollection.populate(leftHeader);
this.topRightCollection.populate(rightHeader);

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

@ -116,7 +116,7 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
_populateTable: function () {
var self = this, o = this.options;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [], totalRowSize = o.items.length * o.rowSize;
var regionSize = this.getRegionSize(), totalLeftColumnSize = 0, totalRightColumnSize = 0, totalColumnSize = 0, summaryColumnSizeArray = [];
var freezeColLength = this._getFreezeColLength();
BI.each(o.columnSize, function (i, size) {
if (o.isNeedFreeze === true && o.freezeCols.contains(i)) {
@ -133,13 +133,13 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
});
var otlw = regionSize;
var otlh = o.header.length * o.headerRowSize;
var otlh = this._getFreezeHeaderHeight();
var otrw = this._width - regionSize;
var otrh = o.header.length * o.headerRowSize;
var otrh = this._getFreezeHeaderHeight();
var oblw = regionSize;
var oblh = this._height - o.header.length * o.headerRowSize;
var oblh = this._height - otlh;
var obrw = this._width - regionSize;
var obrh = this._height - o.header.length * o.headerRowSize;
var obrh = this._height - otrh;
this.topLeft.setWidth(otlw);
this.topLeft.setHeight(otlh);
@ -170,9 +170,9 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
var items = this.contextLayout.attr("items");
items[1].left = regionSize;
items[2].top = o.header.length * o.headerRowSize;
items[2].top = this._getFreezeHeaderHeight();
items[3].left = regionSize;
items[3].top = o.header.length * o.headerRowSize;
items[3].top = this._getFreezeHeaderHeight();
this.contextLayout.attr("items", items);
this.contextLayout.resize();
@ -192,7 +192,7 @@ BI.QuickGridTable = BI.inherit(BI.GridTable, {
}
});
});
BI.each(o.items, function (i, cols) {
BI.each(this._getActualItems(), function (i, cols) {
leftItems[i] = [];
rightItems[i] = [];
BI.each(cols, function (j, col) {

4
src/base/tree/customtree.js

@ -113,10 +113,6 @@ BI.CustomTree = BI.inherit(BI.Widget, {
this.tree.populate.apply(this.tree, args);
},
doBehavior: function () {
this.tree.doBehavior.apply(this.tree, arguments);
},
setValue: function (v) {
this.tree && this.tree.setValue(v);
},

2
src/case/calendar/calendar.year.js

@ -9,6 +9,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, {
var conf = BI.YearCalendar.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-year-calendar",
behaviors: {},
logic: {
dynamic: false
},
@ -73,6 +74,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, {
this.years = BI.createWidget({
type: "bi.button_group",
behaviors: o.behaviors,
items: BI.createItems(items, {}),
layouts: [BI.LogicFactory.createLogic("table", BI.extend({}, o.logic, {
columns: 2,

4
src/case/layer/pane.list.js

@ -127,10 +127,6 @@ BI.ListPane = BI.inherit(BI.Pane, {
this.button_group.empty();
},
doBehavior: function () {
this.button_group.doBehavior.apply(this.button_group, arguments);
},
setNotSelectedValue: function () {
this.button_group.setNotSelectedValue.apply(this.button_group, arguments);
},

4
src/case/list/list.select.js

@ -164,10 +164,6 @@ BI.SelectList = BI.inherit(BI.Widget, {
this.list.element.css({"max-height": h - toolHeight + "px"})
},
doBehavior: function () {
this.list.doBehavior.apply(this.list, arguments);
},
setNotSelectedValue: function () {
this.list.setNotSelectedValue.apply(this.list, arguments);
this._checkAllSelected();

4
src/case/loader/loader.lazy.js

@ -54,10 +54,6 @@ BI.LazyLoader = BI.inherit(BI.Widget, {
this.loader.empty();
},
doBehavior: function () {
this.loader.doBehavior();
},
setNotSelectedValue: function () {
this.loader.setNotSelectedValue.apply(this.loader, arguments);
},

4
src/case/loader/loader.list.js

@ -148,10 +148,6 @@ BI.ListLoader = BI.inherit(BI.Widget, {
});
},
doBehavior: function () {
this.button_group.doBehavior.apply(this.button_group, arguments);
},
setNotSelectedValue: function () {
this.button_group.setNotSelectedValue.apply(this.button_group, arguments);
},

4
src/case/loader/sort.list.js

@ -121,10 +121,6 @@ BI.SortList = BI.inherit(BI.Widget, {
this.loader.empty();
},
doBehavior: function () {
this.loader.doBehavior.apply(this.loader, arguments);
},
setNotSelectedValue: function () {
this.loader.setNotSelectedValue.apply(this.loader, arguments);
},

4
src/case/tree/tree.level.js

@ -108,10 +108,6 @@ BI.LevelTree = BI.inherit(BI.Widget, {
this.tree.populate(items);
},
doBehavior: function () {
this.tree.doBehavior.apply(this.tree, arguments);
},
setValue: function (v) {
this.tree.setValue(v);
},

1
src/case/trigger/trigger.text.js

@ -31,6 +31,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
});
this.trigerButton = BI.createWidget({
type: "bi.trigger_icon_button",
cls: "bi-border-left",
width: c.triggerWidth
});

2
src/core/alias.js

@ -144,7 +144,7 @@
if (numReg) {
var num = numReg[0];
var orilen = num.length;
var newnum = BI.parseInt(num) + 1 + '';
var newnum = parseInt(num) + 1 + '';
//进位到整数部分
if (newnum.length > orilen) {
newnum = newnum.substr(1);

30
src/core/behavior/behavior.highlight.js

@ -5,26 +5,34 @@
* @extends BI.Behavior
*/
BI.HighlightBehavior = BI.inherit(BI.Behavior, {
_defaultConfig: function() {
return BI.extend(BI.HighlightBehavior.superclass._defaultConfig.apply(this, arguments), {
});
_defaultConfig: function () {
return BI.extend(BI.HighlightBehavior.superclass._defaultConfig.apply(this, arguments), {});
},
_init : function() {
_init: function () {
BI.HighlightBehavior.superclass._init.apply(this, arguments);
},
doBehavior: function(items){
doBehavior: function (items) {
var args = Array.prototype.slice.call(arguments, 1),
o = this.options;
BI.each(items, function(i, item){
if(item instanceof BI.Single) {
if (o.rule(item.getValue(), item)) {
item.doHighLight.apply(item, args);
BI.each(items, function (i, item) {
if (item instanceof BI.Single) {
var rule = o.rule(item.getValue(), item);
function doBe(run) {
if (run === true) {
item.doHighLight.apply(item, args);
} else {
item.unHighLight.apply(item, args);
}
}
if (BI.isFunction(rule)) {
rule(doBe);
} else {
item.unHighLight.apply(item, args);
doBe(rule);
}
} else {
item.doBehavior.apply(item, args);

7
src/core/controller/router.floatbox.js

@ -45,7 +45,10 @@ BI.FloatBoxRouter = BI.inherit(BI.WRouter, {
var view = this.createView(url, data, viewData, context);
isValid && context.model.addChild(modelData, view.model);
view.listenTo(view.model, "destroy", function () {
self.remove(url);
self.remove(url, context);
});
context.on(BI.Events.UNMOUNT, function () {
self.remove(url, context);
});
this.store[url].populate(view);
this.views[url] = view;
@ -84,7 +87,7 @@ BI.FloatBoxRouter = BI.inherit(BI.WRouter, {
remove: function (url, context) {
url = context.rootURL + "/" + url;
if(this.controller){
if (this.controller) {
this.controller.remove(url);
delete this.store[url];
this.views[url] && this.views[url].model.destroy();

6
src/core/events.js

@ -53,6 +53,12 @@ _.extend(BI, {
*/
DESTROY: '_DESTROY',
/**
* @static
* @property 取消挂载事件
*/
UNMOUNT: '_UNMOUNT',
/**
* @static
* @property 清除选择

2
src/core/func/function.js

@ -127,7 +127,7 @@ BI.extend(BI.DOM, {
}
var rgb = this.rgb2json(this.hex2rgb(hex));
var grayLevel = Math.round(rgb.r * 0.299 + rgb.g * 0.587 + rgb.b * 0.114);
if (grayLevel < 140) {
if (grayLevel < 192/**网上给的是140**/) {
return true;
}
return false;

6
src/core/view.js

@ -10,6 +10,8 @@ BI.View = BI.inherit(BI.V, {
created: null,
beforeDestroyed: null,
destroyed: null,
_init: function () {
@ -499,18 +501,22 @@ BI.View = BI.inherit(BI.V, {
},
_unMount: function () {
this.beforeDestroyed && this.beforeDestroyed();
BI.each(this._cardLayouts, function (name, card) {
card && card._unMount();
});
delete this._cardLayouts;
delete this._cards;
this.destroyed && this.destroyed();
this.trigger(BI.Events.UNMOUNT);
this.off();
},
_destroy: function () {
var self = this;
BI.each(this._cardLayouts, function (name, card) {
card && card._unMount();
BI.Layers.remove(name + self.cid);
});
delete this._cardLayouts;
delete this._cards;

16
src/core/widget.js

@ -37,6 +37,8 @@ BI.Widget = BI.inherit(BI.OB, {
update: function () {
},
beforeDestroyed: null,
destroyed: null,
_init: function () {
@ -254,6 +256,14 @@ BI.Widget = BI.inherit(BI.OB, {
}
},
doBehavior: function () {
var args = arguments;
//递归将所有子组件使有效
BI.each(this._children, function (i, child) {
child.doBehavior && child.doBehavior.apply(child, args);
});
},
getWidth: function () {
return this.options.width;
},
@ -388,18 +398,20 @@ BI.Widget = BI.inherit(BI.OB, {
},
__d: function () {
this.beforeDestroyed && this.beforeDestroyed();
BI.each(this._children, function (i, widget) {
widget._unMount && widget._unMount();
});
this._children = {};
this._parent = null;
this._isMounted = false;
this.destroyed && this.destroyed();
},
_unMount: function () {
this.__d();
this.fireEvent(BI.Events.UNMOUNT);
this.purgeListeners();
this.destroyed && this.destroyed();
},
isolate: function () {
@ -419,14 +431,12 @@ BI.Widget = BI.inherit(BI.OB, {
_destroy: function () {
this.__d();
this.destroyed && this.destroyed();
this.element.destroy();
this.purgeListeners();
},
destroy: function () {
this.__d();
this.destroyed && this.destroyed();
this.element.destroy();
this.fireEvent(BI.Events.DESTROY);
this.purgeListeners();

183
src/css/core/utils/common.css

@ -5,12 +5,18 @@
cursor: default !important;
color: #cccccc !important;
}
.base-disabled .bi-input {
color: #cccccc !important;
}
.base-disabled .b-font:before {
color: #cccccc !important;
}
.bi-theme-dark .base-disabled {
color: #666666 !important;
}
.bi-theme-dark .base-disabled .bi-input {
color: #666666 !important;
}
.bi-theme-dark .base-disabled .b-font:before {
color: #666666 !important;
}
@ -33,27 +39,48 @@
background-color: #eff1f4;
color: #666666;
}
.bi-background .bi-input {
color: #666666;
}
.bi-theme-dark .bi-background {
background-color: #191b2b;
color: #cccccc;
}
.bi-theme-dark .bi-background .bi-input {
color: #cccccc;
}
.bi-card {
background-color: #ffffff;
color: #666666;
}
.bi-card .bi-input {
color: #666666;
}
.bi-theme-dark .bi-card {
background-color: #242640;
color: #cccccc;
}
.bi-theme-dark .bi-card .bi-input {
color: #cccccc;
}
.bi-disabled {
color: #cccccc;
}
.bi-disabled .bi-input {
color: #cccccc;
}
.bi-theme-dark .bi-disabled {
color: #666666;
}
.bi-theme-dark .bi-disabled .bi-input {
color: #666666;
}
.bi-tips {
color: #999999;
}
.bi-tips .bi-input {
color: #999999;
}
.bi-border {
border: 1px solid #d4dadd;
}
@ -87,13 +114,22 @@
.bi-keyword-red-mark {
color: #f07d0a;
}
.bi-keyword-red-mark .bi-input {
color: #f07d0a;
}
.bi-high-light {
color: #3f8ce8;
}
.bi-high-light .bi-input {
color: #3f8ce8;
}
.bi-high-light-background {
background-color: #3f8ce8;
color: #ffffff;
}
.bi-high-light-background .bi-input {
color: #ffffff;
}
.bi-high-light-border {
border-color: #178cdf;
}
@ -101,9 +137,15 @@
color: #cccccc;
cursor: text;
}
.bi-water-mark .bi-input {
color: #cccccc;
}
.bi-theme-dark .bi-water-mark {
color: #666666;
}
.bi-theme-dark .bi-water-mark .bi-input {
color: #666666;
}
.bi-resizer {
background: #1a1a1a;
opacity: 0.2;
@ -118,28 +160,46 @@
background-color: rgba(26, 26, 26, 0.2);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#331a1a1a,endColorstr=#331a1a1a);
}
.bi-mask .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-mask {
color: #242640;
background-color: rgba(255, 255, 255, 0.2);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#33ffffff,endColorstr=#33ffffff);
}
.bi-theme-dark .bi-mask .bi-input {
color: #242640;
}
.bi-z-index-mask {
color: #ffffff;
background-color: rgba(26, 26, 26, 0.5);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#801a1a1a,endColorstr=#801a1a1a);
}
.bi-z-index-mask .bi-input {
color: #ffffff;
}
.bi-list-item:hover,
.bi-list-item.hover {
color: #1a1a1a;
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item:hover .bi-input,
.bi-list-item.hover .bi-input {
color: #1a1a1a;
}
.bi-list-item.disabled,
.bi-list-item.disabled:hover,
.bi-list-item.disabled:active {
background-color: transparent !important;
color: #cccccc !important;
}
.bi-list-item.disabled .bi-input,
.bi-list-item.disabled:hover .bi-input,
.bi-list-item.disabled:active .bi-input {
color: #cccccc !important;
}
.bi-list-item.disabled .bi-high-light,
.bi-list-item.disabled:hover .bi-high-light,
.bi-list-item.disabled:active .bi-high-light {
@ -151,12 +211,21 @@
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item:hover .bi-input,
.bi-theme-dark .bi-list-item.hover .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-list-item.disabled,
.bi-theme-dark .bi-list-item.disabled:hover,
.bi-theme-dark .bi-list-item.disabled:active {
background-color: transparent !important;
color: #666666 !important;
}
.bi-theme-dark .bi-list-item.disabled .bi-input,
.bi-theme-dark .bi-list-item.disabled:hover .bi-input,
.bi-theme-dark .bi-list-item.disabled:active .bi-input {
color: #666666 !important;
}
.bi-theme-dark .bi-list-item.disabled .bi-high-light,
.bi-theme-dark .bi-list-item.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item.disabled:active .bi-high-light {
@ -169,15 +238,27 @@
.bi-list-item-simple {
color: #999999;
}
.bi-list-item-simple .bi-input {
color: #999999;
}
.bi-list-item-simple:hover,
.bi-list-item-simple.hover {
color: #3f8ce8;
}
.bi-list-item-simple:hover .bi-input,
.bi-list-item-simple.hover .bi-input {
color: #3f8ce8;
}
.bi-list-item-simple.disabled,
.bi-list-item-simple.disabled:hover,
.bi-list-item-simple.disabled:active {
color: #cccccc !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;
}
.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 {
@ -186,15 +267,27 @@
.bi-list-item-effect:hover {
color: #1a1a1a;
}
.bi-list-item-effect:hover .bi-input {
color: #1a1a1a;
}
.bi-list-item-effect.active,
.bi-list-item-effect:active {
color: #3f8ce8;
}
.bi-list-item-effect.active .bi-input,
.bi-list-item-effect:active .bi-input {
color: #3f8ce8;
}
.bi-list-item-effect.disabled,
.bi-list-item-effect.disabled:hover,
.bi-list-item-effect.disabled:active {
color: #cccccc !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;
}
.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 {
@ -203,16 +296,28 @@
.bi-theme-dark .bi-list-item-effect:hover {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-effect:hover .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-effect.active,
.bi-theme-dark .bi-list-item-effect:active {
color: #3f8ce8;
}
.bi-theme-dark .bi-list-item-effect.active .bi-input,
.bi-theme-dark .bi-list-item-effect:active .bi-input {
color: #3f8ce8;
}
.bi-theme-dark .bi-list-item-effect.disabled,
.bi-theme-dark .bi-list-item-effect.disabled:hover,
.bi-theme-dark .bi-list-item-effect.disabled:active {
background-color: transparent !important;
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-effect.disabled .bi-input,
.bi-theme-dark .bi-list-item-effect.disabled:hover .bi-input,
.bi-theme-dark .bi-list-item-effect.disabled:active .bi-input {
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-effect.disabled .bi-high-light,
.bi-theme-dark .bi-list-item-effect.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item-effect.disabled:active .bi-high-light {
@ -224,18 +329,31 @@
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item-active:hover .bi-input,
.bi-list-item-active.hover .bi-input {
color: #1a1a1a;
}
.bi-list-item-active.active,
.bi-list-item-active:active {
color: #3f8ce8;
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;
}
.bi-list-item-active.disabled,
.bi-list-item-active.disabled:hover,
.bi-list-item-active.disabled:active {
background-color: transparent !important;
color: #cccccc !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;
}
.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 {
@ -247,18 +365,31 @@
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item-active:hover .bi-input,
.bi-theme-dark .bi-list-item-active.hover .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-active.active,
.bi-theme-dark .bi-list-item-active:active {
color: #3f8ce8;
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;
}
.bi-theme-dark .bi-list-item-active.disabled,
.bi-theme-dark .bi-list-item-active.disabled:hover,
.bi-theme-dark .bi-list-item-active.disabled:active {
background-color: transparent !important;
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-active.disabled .bi-input,
.bi-theme-dark .bi-list-item-active.disabled:hover .bi-input,
.bi-theme-dark .bi-list-item-active.disabled:active .bi-input {
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-active.disabled .bi-high-light,
.bi-theme-dark .bi-list-item-active.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item-active.disabled:active .bi-high-light {
@ -269,17 +400,30 @@
color: #1a1a1a;
background-color: #ffffff;
}
.bi-list-item-active2:hover .bi-input,
.bi-list-item-active2.hover .bi-input {
color: #1a1a1a;
}
.bi-list-item-active2.active,
.bi-list-item-active2:active {
color: #3f8ce8;
background-color: #ffffff;
}
.bi-list-item-active2.active .bi-input,
.bi-list-item-active2:active .bi-input {
color: #3f8ce8;
}
.bi-list-item-active2.disabled,
.bi-list-item-active2.disabled:hover,
.bi-list-item-active2.disabled:active {
background-color: transparent !important;
color: #cccccc !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;
}
.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 {
@ -290,17 +434,30 @@
color: #ffffff;
background-color: #242640;
}
.bi-theme-dark .bi-list-item-active2:hover .bi-input,
.bi-theme-dark .bi-list-item-active2.hover .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-active2.active,
.bi-theme-dark .bi-list-item-active2:active {
color: #3f8ce8;
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;
}
.bi-theme-dark .bi-list-item-active2.disabled,
.bi-theme-dark .bi-list-item-active2.disabled:hover,
.bi-theme-dark .bi-list-item-active2.disabled:active {
background-color: transparent !important;
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-active2.disabled .bi-input,
.bi-theme-dark .bi-list-item-active2.disabled:hover .bi-input,
.bi-theme-dark .bi-list-item-active2.disabled:active .bi-input {
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-active2.disabled .bi-high-light,
.bi-theme-dark .bi-list-item-active2.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item-active2.disabled:active .bi-high-light {
@ -312,11 +469,19 @@
background-color: rgba(26, 26, 26, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d1a1a1a,endColorstr=#0d1a1a1a);
}
.bi-list-item-select:hover .bi-input,
.bi-list-item-select.hover .bi-input {
color: #1a1a1a;
}
.bi-list-item-select:active,
.bi-list-item-select.active {
color: #ffffff;
background-color: #3f8ce8;
}
.bi-list-item-select:active .bi-input,
.bi-list-item-select.active .bi-input {
color: #ffffff;
}
.bi-list-item-select:active .bi-high-light,
.bi-list-item-select.active .bi-high-light {
color: #ffffff;
@ -327,6 +492,11 @@
color: #cccccc !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;
}
.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 {
@ -338,11 +508,19 @@
background-color: rgba(255, 255, 255, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff);
}
.bi-theme-dark .bi-list-item-select:hover .bi-input,
.bi-theme-dark .bi-list-item-select.hover .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-select:active,
.bi-theme-dark .bi-list-item-select.active {
color: #ffffff;
background-color: #3f8ce8;
}
.bi-theme-dark .bi-list-item-select:active .bi-input,
.bi-theme-dark .bi-list-item-select.active .bi-input {
color: #ffffff;
}
.bi-theme-dark .bi-list-item-select:active .bi-high-light,
.bi-theme-dark .bi-list-item-select.active .bi-high-light {
color: #ffffff;
@ -353,6 +531,11 @@
background-color: transparent !important;
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-select.disabled .bi-input,
.bi-theme-dark .bi-list-item-select.disabled:hover .bi-input,
.bi-theme-dark .bi-list-item-select.disabled:active .bi-input {
color: #666666 !important;
}
.bi-theme-dark .bi-list-item-select.disabled .bi-high-light,
.bi-theme-dark .bi-list-item-select.disabled:hover .bi-high-light,
.bi-theme-dark .bi-list-item-select.disabled:active .bi-high-light {

1
src/css/widget/year/popup.year.css

@ -3,7 +3,6 @@
/**** custom color(自定义颜色,用于特定场景) ****/
.bi-year-popup .year-popup-navigation {
line-height: 30px;
color: #3f8ce8;
}
.bi-year-popup .year-popup-navigation > .center-element {
border-left: 1px solid #d4dadd;

144
src/less/core/utils/common.less

@ -3,6 +3,9 @@
.base-disabled {
cursor: default !important;
color: @color-bi-text-disabled !important;
& .bi-input {
color: @color-bi-text-disabled !important;
}
& .b-font:before {
color: @color-bi-text-disabled !important;
}
@ -11,6 +14,9 @@
.bi-theme-dark {
.base-disabled {
color: @color-bi-text-disabled-theme-dark !important;
& .bi-input {
color: @color-bi-text-disabled-theme-dark !important;
}
& .b-font:before {
color: @color-bi-text-disabled-theme-dark !important;
}
@ -29,12 +35,18 @@
.bi-background {
background-color: @color-bi-background-normal;
color: @color-bi-text-normal;
& .bi-input {
color: @color-bi-text-normal;
}
}
.bi-theme-dark {
.bi-background {
background-color: @color-bi-background-normal-theme-dark;
color: @color-bi-text-theme-dark;
& .bi-input {
color: @color-bi-text-theme-dark;
}
}
}
@ -42,28 +54,43 @@
.bi-card {
background-color: @color-bi-background-default;
color: @color-bi-text-normal;
& .bi-input {
color: @color-bi-text-normal;
}
}
.bi-theme-dark {
.bi-card {
background-color: @color-bi-background-default-theme-dark;
color: @color-bi-text-theme-dark;
& .bi-input {
color: @color-bi-text-theme-dark;
}
}
}
.bi-disabled {
color: @color-bi-text-disabled;
& .bi-input {
color: @color-bi-text-disabled;
}
}
.bi-theme-dark {
.bi-disabled {
color: @color-bi-text-disabled-theme-dark;
& .bi-input {
color: @color-bi-text-disabled-theme-dark;
}
}
}
//提示区域, 灰色字体
.bi-tips {
color: @color-bi-text-tips;
& .bi-input {
color: @color-bi-text-tips;
}
}
//边框
@ -120,16 +147,25 @@
//标红
.bi-keyword-red-mark {
color: @color-bi-text-redmark;
& .bi-input {
color: @color-bi-text-redmark;
}
}
//高亮
.bi-high-light {
color: @color-bi-text-highlight;
& .bi-input {
color: @color-bi-text-highlight;
}
}
.bi-high-light-background {
background-color: @color-bi-background-highlight;
color: @color-bi-text;
& .bi-input {
color: @color-bi-text;
}
}
.bi-high-light-border {
@ -140,11 +176,17 @@
.bi-water-mark {
color: @water-mark-color;
cursor: text;
& .bi-input {
color: @water-mark-color;
}
}
.bi-theme-dark {
.bi-water-mark {
color: @water-mark-color-theme-dark;
& .bi-input {
color: @water-mark-color-theme-dark;
}
}
}
@ -163,18 +205,27 @@
.bi-mask {
color: @color-bi-background-default;
& .bi-input {
color: @color-bi-background-default;
}
.background-color(@color-bi-background-black, 20%);
}
.bi-theme-dark {
.bi-mask {
color: @color-bi-background-default-theme-dark;
& .bi-input {
color: @color-bi-background-default-theme-dark;
}
.background-color(@color-bi-background-default, 20%);
}
}
.bi-z-index-mask {
color: @color-bi-background-default;
& .bi-input {
color: @color-bi-background-default;
}
.background-color(@color-bi-background-black, 50%);
}
@ -182,12 +233,18 @@
.bi-list-item {
&:hover, &.hover {
color: @color-bi-text-black;
& .bi-input {
color: @color-bi-text-black;
}
.background-color(@color-bi-background-black, 5%);
}
&.disabled {
&, &:hover, &:active {
background-color: transparent !important;
color: @color-bi-text-disabled !important;
& .bi-input {
color: @color-bi-text-disabled !important;
}
& .bi-high-light {
color: @color-bi-text-disabled !important;
}
@ -199,12 +256,18 @@
.bi-list-item {
&:hover, &.hover {
color: @color-bi-text;
& .bi-input {
color: @color-bi-text;
}
.background-color(@color-bi-background-default, 5%);
}
&.disabled {
&, &:hover, &:active {
background-color: transparent !important;
color: @color-bi-text-disabled-theme-dark !important;
& .bi-input {
color: @color-bi-text-disabled-theme-dark !important;
}
& .bi-high-light {
color: @color-bi-text-disabled-theme-dark !important;
}
@ -222,12 +285,21 @@
//极简
.bi-list-item-simple {
color: @color-bi-text-tips;
& .bi-input {
color: @color-bi-text-tips;
}
&:hover, &.hover {
color: @color-bi-text-highlight;
& .bi-input {
color: @color-bi-text-highlight;
}
}
&.disabled {
&, &:hover, &:active {
color: @color-bi-text-disabled !important;
& .bi-input {
color: @color-bi-text-disabled !important;
}
& .bi-high-light {
color: @color-bi-text-disabled !important;
}
@ -239,13 +311,22 @@
.bi-list-item-effect {
&:hover {
color: @color-bi-text-black;
& .bi-input {
color: @color-bi-text-black;
}
}
&.active, &:active {
color: @color-bi-text-highlight;
& .bi-input {
color: @color-bi-text-highlight;
}
}
&.disabled {
&, &:hover, &:active {
color: @color-bi-text-disabled !important;
& .bi-input {
color: @color-bi-text-disabled !important;
}
& .bi-high-light {
color: @color-bi-text-disabled !important;
}
@ -257,14 +338,23 @@
.bi-list-item-effect {
&:hover {
color: @color-bi-text;
& .bi-input {
color: @color-bi-text;
}
}
&.active, &:active {
color: @color-bi-text-highlight;
& .bi-input {
color: @color-bi-text-highlight;
}
}
&.disabled {
&, &:hover, &:active {
background-color: transparent !important;
color: @color-bi-text-disabled-theme-dark !important;
& .bi-input {
color: @color-bi-text-disabled-theme-dark !important;
}
& .bi-high-light {
color: @color-bi-text-disabled-theme-dark !important;
}
@ -277,16 +367,25 @@
.bi-list-item-active {
&:hover, &.hover {
color: @color-bi-text-black;
& .bi-input {
color: @color-bi-text-black;
}
.background-color(@color-bi-background-black, 5%);
}
&.active, &:active {
color: @color-bi-text-highlight;
& .bi-input {
color: @color-bi-text-highlight;
}
.background-color(@color-bi-background-black, 5%);
}
&.disabled {
&, &:hover, &:active {
background-color: transparent !important;
color: @color-bi-text-disabled !important;
& .bi-input {
color: @color-bi-text-disabled !important;
}
& .bi-high-light {
color: @color-bi-text-disabled !important;
}
@ -298,16 +397,25 @@
.bi-list-item-active {
&:hover, &.hover {
color: @color-bi-text;
& .bi-input {
color: @color-bi-text;
}
.background-color(@color-bi-background-default, 5%);
}
&.active, &:active {
color: @color-bi-text-highlight;
& .bi-input {
color: @color-bi-text-highlight;
}
.background-color(@color-bi-background-default, 5%);
}
&.disabled {
&, &:hover, &:active {
background-color: transparent !important;
color: @color-bi-text-disabled-theme-dark !important;
& .bi-input {
color: @color-bi-text-disabled-theme-dark !important;
}
& .bi-high-light {
color: @color-bi-text-disabled-theme-dark !important;
}
@ -320,16 +428,25 @@
.bi-list-item-active2 {
&:hover, &.hover {
color: @color-bi-text-black;
& .bi-input {
color: @color-bi-text-black;
}
background-color: @color-bi-background-default;
}
&.active, &:active {
color: @color-bi-text-highlight;
& .bi-input {
color: @color-bi-text-highlight;
}
background-color: @color-bi-background-default;
}
&.disabled {
&, &:hover, &:active {
background-color: transparent !important;
color: @color-bi-text-disabled !important;
& .bi-input {
color: @color-bi-text-disabled !important;
}
& .bi-high-light {
color: @color-bi-text-disabled !important;
}
@ -341,16 +458,25 @@
.bi-list-item-active2 {
&:hover, &.hover {
color: @color-bi-text;
& .bi-input {
color: @color-bi-text;
}
background-color: @color-bi-background-default-theme-dark;
}
&.active, &:active {
color: @color-bi-text-highlight;
& .bi-input {
color: @color-bi-text-highlight;
}
background-color: @color-bi-background-default-theme-dark;
}
&.disabled {
&, &:hover, &:active {
background-color: transparent !important;
color: @color-bi-text-disabled-theme-dark !important;
& .bi-input {
color: @color-bi-text-disabled-theme-dark !important;
}
& .bi-high-light {
color: @color-bi-text-disabled-theme-dark !important;
}
@ -363,10 +489,16 @@
.bi-list-item-select {
&:hover, &.hover {
color: @color-bi-text-black;
& .bi-input {
color: @color-bi-text-black;
}
.background-color(@color-bi-background-black, 5%);
}
&:active, &.active {
color: @color-bi-text;
& .bi-input {
color: @color-bi-text;
}
background-color: @color-bi-background-highlight;
& .bi-high-light {
color: @color-bi-text;
@ -375,6 +507,9 @@
&.disabled {
&, &:hover, &:active {
color: @color-bi-text-disabled !important;
& .bi-input {
color: @color-bi-text-disabled !important;
}
background-color: transparent !important;
& .bi-high-light {
color: @color-bi-text-disabled !important;
@ -387,10 +522,16 @@
.bi-list-item-select {
&:hover, &.hover {
color: @color-bi-text;
& .bi-input {
color: @color-bi-text;
}
.background-color(@color-bi-background-default, 5%);
}
&:active, &.active {
color: @color-bi-text;
& .bi-input {
color: @color-bi-text;
}
background-color: @color-bi-background-highlight;
& .bi-high-light {
color: @color-bi-text;
@ -400,6 +541,9 @@
&, &:hover, &:active {
background-color: transparent !important;
color: @color-bi-text-disabled-theme-dark !important;
& .bi-input {
color: @color-bi-text-disabled-theme-dark !important;
}
& .bi-high-light {
color: @color-bi-text-disabled-theme-dark !important;
}

4
src/less/lib/colors.less

@ -17,7 +17,7 @@
@color-bi-text: @font-color-white;
//灰化字体颜色
@color-bi-text-disabled: @font-color-disabled;
//色主题灰化字体颜色
//色主题灰化字体颜色
@color-bi-text-disabled-theme-dark: @font-color-disabled-theme-dark;
//提示字体颜色
@color-bi-text-tips: @font-color-tips;
@ -41,6 +41,8 @@
@color-bi-background-black: @background-color-black;
//深灰色背景
@color-bi-background-dark: @background-color-dark;
//灰色背景
@color-bi-background-gray: @background-color-gray;
//灰化背景
@color-bi-background-disabled: @background-color-disabled;
//成功背景色

1
src/less/lib/constant.less

@ -38,6 +38,7 @@
@background-color-normal-theme-dark: #191B2B;//
@background-color-highlight: #3f8ce8;
@background-color-dark: #d4dadd;
@background-color-gray: #999999;
@background-color-disabled: #cccccc;
@background-color-orange: #fef6de;

1
src/less/widget/year/popup.year.less

@ -3,7 +3,6 @@
.bi-year-popup {
& .year-popup-navigation {
line-height: 30px;
color: @color-bi-text-highlight;
& > .center-element {
border-left: 1px solid @color-bi-border-line;
}

8
src/widget/adaptivearrangement/adaptivearrangement.js

@ -56,8 +56,8 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, {
width: ui.size.width,
height: height
});
self.arrangement.scrollTo(height);
}, 500);
self.arrangement.scrollTo({top: height});
}, 300);
};
this.arrangement.container.element.resizable({
handles: "s",
@ -460,6 +460,10 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, {
return this.arrangement.setRegionPosition(name, position);
},
scrollTo: function (scroll) {
this.arrangement.scrollTo(scroll);
},
zoom: function (ratio) {
this.arrangement.zoom(ratio);
},

14
src/widget/arrangement/arrangement.js

@ -214,7 +214,8 @@ BI.Arrangement = BI.inherit(BI.Widget, {
findBottomRegions.push(region);
}
});
var topValid = isRegionsValid(findTopRegions, "top"), bottomValid = isRegionsValid(findBottomRegions, "bottom");
var topValid = isRegionsValid(findTopRegions, "top"),
bottomValid = isRegionsValid(findBottomRegions, "bottom");
if (topValid && bottomValid) {
BI.each(findTopRegions, function (i, region) {
var clone = BI.clone(region);
@ -257,7 +258,8 @@ BI.Arrangement = BI.inherit(BI.Widget, {
findRightRegions.push(region);
}
});
var leftValid = isRegionsValid(findLeftRegions, "left"), rightValid = isRegionsValid(findRightRegions, "right");
var leftValid = isRegionsValid(findLeftRegions, "left"),
rightValid = isRegionsValid(findRightRegions, "right");
if (leftValid && rightValid) {
BI.each(findLeftRegions, function (i, region) {
var clone = BI.clone(region);
@ -2688,8 +2690,9 @@ BI.Arrangement = BI.inherit(BI.Widget, {
this.resize();
},
scrollTo: function (top) {
this.scrollContainer.element.scrollTop(top);
scrollTo: function (scroll) {
this.scrollContainer.element.scrollTop(scroll.top);
this.scrollContainer.element.scrollLeft(scroll.left);
},
zoom: function (ratio) {
@ -2700,6 +2703,7 @@ BI.Arrangement = BI.inherit(BI.Widget, {
var occupied = this._applyContainer();
switch (this.getLayoutType()) {
case BI.Arrangement.LAYOUT_TYPE.ADAPTIVE:
case BI.Arrangement.LAYOUT_TYPE.FREE:
if (this._isArrangeFine()) {
var width = this.getClientWidth();
var xRatio = (ratio.x || 1) * width / (occupied.left + occupied.width);
@ -2720,8 +2724,6 @@ BI.Arrangement = BI.inherit(BI.Widget, {
this.relayout();
}
break;
case BI.Arrangement.LAYOUT_TYPE.FREE:
break;
case BI.Arrangement.LAYOUT_TYPE.GRID:
if (this._isArrangeFine()) {
var width = this.getClientWidth();

8
src/widget/branchrelation/branchrelation.js

@ -284,7 +284,7 @@ BI.BranchRelation = BI.inherit(BI.Widget, {
if (end.length > 0) {
path += "M" + BI.first(end).x + "," + split + "L" + BI.last(end).x + "," + split;
}
self.svg.path(path).attr("stroke", "gray");
self.svg.path(path).attr("stroke", "#d4dadd");
}
})
});
@ -305,7 +305,7 @@ BI.BranchRelation = BI.inherit(BI.Widget, {
if (end.length > 0) {
path += "M" + BI.first(end).x + "," + split + "L" + BI.last(end).x + "," + split;
}
self.svg.path(path).attr("stroke", "gray");
self.svg.path(path).attr("stroke", "#d4dadd");
}
})
});
@ -326,7 +326,7 @@ BI.BranchRelation = BI.inherit(BI.Widget, {
if (end.length > 0) {
path += "M" + split + "," + BI.first(end).x + "L" + split + "," + BI.last(end).x;
}
self.svg.path(path).attr("stroke", "gray");
self.svg.path(path).attr("stroke", "#d4dadd");
}
})
});
@ -347,7 +347,7 @@ BI.BranchRelation = BI.inherit(BI.Widget, {
if (end.length > 0) {
path += "M" + split + "," + BI.first(end).x + "L" + split + "," + BI.last(end).x;
}
self.svg.path(path).attr("stroke", "gray");
self.svg.path(path).attr("stroke", "#d4dadd");
}
})
});

4
src/widget/interactivearrangement/interactivearrangement.js

@ -525,6 +525,10 @@ BI.InteractiveArrangement = BI.inherit(BI.Widget, {
return this.arrangement.setRegionPosition(name, position);
},
scrollTo: function (scroll) {
this.arrangement.scrollTo(scroll);
},
zoom: function (ratio) {
this.arrangement.zoom(ratio);
},

14
src/widget/month/combo.month.js

@ -9,6 +9,7 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MonthCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-month-combo",
behaviors: {},
height: 25
});
},
@ -21,9 +22,9 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
});
this.trigger.on(BI.MonthTrigger.EVENT_CONFIRM, function (v) {
if(this.getKey() && this.getKey() !== self.storeValue) {
if (this.getKey() && this.getKey() !== self.storeValue) {
self.setValue(this.getValue());
}else if(!this.getKey()){
} else if (!this.getKey()) {
self.setValue();
}
self.fireEvent(BI.MonthCombo.EVENT_CONFIRM);
@ -44,7 +45,8 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
});
this.popup = BI.createWidget({
type: "bi.month_popup"
type: "bi.month_popup",
behaviors: o.behaviors
});
this.popup.on(BI.MonthPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
@ -62,7 +64,10 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
minWidth: 85,
el: this.popup
}
})
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.MonthCombo.EVENT_BEFORE_POPUPVIEW);
});
},
setValue: function (v) {
@ -76,4 +81,5 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
});
BI.MonthCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.MonthCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut('bi.month_combo', BI.MonthCombo);

6
src/widget/month/popup.month.js

@ -9,13 +9,14 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MonthPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-month-popup"
baseCls: "bi-month-popup",
behaviors: {}
});
},
_init: function () {
BI.MonthPopup.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
//纵向排列月
var month = [0, 6, 1, 7, 2, 8, 3, 9, 4, 10, 5, 11];
@ -46,6 +47,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
this.month = BI.createWidget({
type: "bi.button_group",
element: this,
behaviors: o.behaviors,
items: BI.createItems(items, {}),
layouts: [BI.LogicFactory.createLogic("table", BI.extend({
dynamic: true

4
src/widget/multilayerselecttree/multilayerselecttree.leveltree.js

@ -103,10 +103,6 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, {
this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0));
},
doBehavior: function () {
this.tree.doBehavior.apply(this.tree, arguments);
},
setValue: function (v) {
this.tree.setValue(v);
},

4
src/widget/multilayersingletree/multilayersingletree.leveltree.js

@ -106,10 +106,6 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, {
this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0));
},
doBehavior: function () {
this.tree.doBehavior.apply(this.tree, arguments);
},
setValue: function (v) {
this.tree.setValue(v);
},

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

@ -101,7 +101,7 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
setValue: function (v) {
v || (v = {});
this.display.setValue(v.value);
this.display.setSelectedValue(v.value);
},
getValue: function () {

3
src/widget/multitree/multi.tree.combo.js

@ -105,6 +105,9 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
self.trigger.getSearcher().adjustView();
});
}
},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
});

7
src/widget/numericalinterval/numericalinterval.js

@ -23,8 +23,8 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
var conf = BI.NumericalInterval.superclass._defaultConfig.apply(this, arguments)
return BI.extend(conf, {
extraCls: "bi-numerical-interval",
height: 25
height: 25,
validation: "valid"
})
},
_init: function () {
@ -425,8 +425,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
})
},
isValid: function () {
isStateValid: function () {
return this.options.validation === "valid";
},

4
src/widget/pathchooser/pathchooser.js

@ -8,8 +8,8 @@
BI.PathChooser = BI.inherit(BI.Widget, {
_const: {
lineColor: "#c4c6c6",
selectLineColor: "#009de3"
lineColor: "#d4dadd",
selectLineColor: "#3f8ce8"
},
_defaultConfig: function () {

16
src/widget/quarter/combo.quarter.js

@ -9,6 +9,7 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.QuarterCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-quarter-combo",
behaviors: {},
height: 25
});
},
@ -29,24 +30,25 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
this.trigger.on(BI.QuarterTrigger.EVENT_START, function () {
self.combo.isViewVisible() && self.combo.hideView();
});
this.trigger.on(BI.QuarterTrigger.EVENT_STOP, function(){
this.trigger.on(BI.QuarterTrigger.EVENT_STOP, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.trigger.on(BI.QuarterTrigger.EVENT_CONFIRM, function () {
if(self.combo.isViewVisible()) {
if (self.combo.isViewVisible()) {
return;
}
if(this.getKey() && this.getKey() !== self.storeValue) {
if (this.getKey() && this.getKey() !== self.storeValue) {
self.setValue(this.getKey());
}else if(!this.getKey()){
} else if (!this.getKey()) {
self.setValue();
}
self.fireEvent(BI.QuarterCombo.EVENT_CONFIRM);
});
this.popup = BI.createWidget({
type: "bi.quarter_popup"
type: "bi.quarter_popup",
behaviors: o.behaviors
});
this.popup.on(BI.QuarterPopup.EVENT_CHANGE, function () {
@ -66,6 +68,9 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
el: this.popup
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.QuarterCombo.EVENT_BEFORE_POPUPVIEW);
});
},
setValue: function (v) {
@ -79,4 +84,5 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
});
BI.QuarterCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.QuarterCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut('bi.quarter_combo', BI.QuarterCombo);

6
src/widget/quarter/popup.quarter.js

@ -9,13 +9,14 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.QuarterPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-quarter-popup"
baseCls: "bi-quarter-popup",
behaviors: {}
});
},
_init: function () {
BI.QuarterPopup.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
var items = [{
text: Date._QN[01],
@ -45,6 +46,7 @@ BI.QuarterPopup = BI.inherit(BI.Widget, {
this.quarter = BI.createWidget({
type: "bi.button_group",
element: this,
behaviors: o.behaviors,
items: BI.createItems(items, {}),
layouts: [{
type: "bi.vertical"

5
src/widget/sequencetable/treenumber.sequencetable.js

@ -103,12 +103,13 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
_getStart: function (nodes) {
var self = this;
var start = this.start;
BI.each(nodes, function (i, node) {
BI.some(nodes, function (i, node) {
if (BI.isNotEmptyArray(node.children)) {
BI.each(node.children, function (index, child) {
return BI.some(node.children, function (index, child) {
if (index === 0) {
if (self.cache[child.text || child.value]) {
start = self.cache[child.text || child.value];
return true;
}
}
});

43
src/widget/year/combo.year.js

@ -9,6 +9,7 @@ BI.YearCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.YearCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-year-combo",
behaviors: {},
min: '1900-01-01', //最小日期
max: '2099-12-31', //最大日期
height: 25
@ -36,7 +37,7 @@ BI.YearCombo = BI.inherit(BI.Widget, {
self.combo.isViewVisible() && self.combo.hideView();
});
this.trigger.on(BI.YearTrigger.EVENT_CONFIRM, function () {
if(self.combo.isViewVisible()) {
if (self.combo.isViewVisible()) {
return;
}
if (this.getKey() && this.getKey() !== self.storeValue) {
@ -47,45 +48,50 @@ BI.YearCombo = BI.inherit(BI.Widget, {
self.fireEvent(BI.YearCombo.EVENT_CONFIRM);
});
this.popup = BI.createWidget({
type: "bi.year_popup",
min: o.min,
max: o.max
});
this.popup.on(BI.YearPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
self.fireEvent(BI.YearCombo.EVENT_CONFIRM);
});
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
destroyWhenHide: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
popup: {
minWidth: 85,
stopPropagation: false,
el: this.popup
el: {
type: "bi.year_popup",
ref: function () {
self.popup = this;
},
listeners: [{
eventName: BI.YearPopup.EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
self.fireEvent(BI.YearCombo.EVENT_CONFIRM);
}
}],
behaviors: o.behaviors,
min: o.min,
max: o.max
}
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
var value = self.trigger.getKey();
if (BI.isNotNull(value)) {
self.popup.setValue(value);
} else if(!value && value !== self.storeValue){
} else if (!value && value !== self.storeValue) {
self.popup.setValue(self.storeValue);
}else {
} else {
self.setValue();
}
self.fireEvent(BI.YearCombo.EVENT_BEFORE_POPUPVIEW);
});
},
setValue: function (v) {
this.trigger.setValue(v);
this.popup.setValue(v);
this.combo.setValue(v);
},
getValue: function () {
@ -93,4 +99,5 @@ BI.YearCombo = BI.inherit(BI.Widget, {
}
});
BI.YearCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.YearCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut('bi.year_combo', BI.YearCombo);

5
src/widget/year/popup.year.js

@ -10,6 +10,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.YearPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-year-popup",
behaviors: {},
min: '1900-01-01', //最小日期
max: '2099-12-31' //最大日期
});
@ -20,6 +21,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
var calendar = BI.createWidget({
type: "bi.year_calendar",
behaviors: o.behaviors,
min: o.min,
max: o.max,
logic: {
@ -56,11 +58,12 @@ BI.YearPopup = BI.inherit(BI.Widget, {
this.navigation = BI.createWidget({
type: "bi.navigation",
element: this,
single: true,
logic: {
dynamic: true
},
tab: {
cls: "year-popup-navigation bi-border-top",
cls: "year-popup-navigation bi-high-light bi-border-top",
height: 25,
items: [backBtn, preBtn]
},

19
src/widget/yearmonth/combo.yearmonth.js

@ -8,6 +8,8 @@ BI.YearMonthCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.YearMonthCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-year-month-combo",
yearBehaviors: {},
monthBehaviors: {},
height: 25
});
},
@ -16,20 +18,28 @@ BI.YearMonthCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.year = BI.createWidget({
type: "bi.year_combo"
type: "bi.year_combo",
behaviors: o.yearBehaviors
});
this.month = BI.createWidget({
type: "bi.month_combo"
type: "bi.month_combo",
behaviors: o.monthBehaviors
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function(){
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {
self.fireEvent(BI.YearMonthCombo.EVENT_CONFIRM);
});
this.year.on(BI.YearCombo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.YearMonthCombo.EVENT_BEFORE_POPUPVIEW);
});
this.month.on(BI.MonthCombo.EVENT_CONFIRM, function(){
this.month.on(BI.MonthCombo.EVENT_CONFIRM, function () {
self.fireEvent(BI.YearMonthCombo.EVENT_CONFIRM);
});
this.month.on(BI.MonthCombo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.YearMonthCombo.EVENT_BEFORE_POPUPVIEW);
});
BI.createWidget({
type: "bi.center",
@ -54,4 +64,5 @@ BI.YearMonthCombo = BI.inherit(BI.Widget, {
}
});
BI.YearMonthCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.YearMonthCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut('bi.year_month_combo', BI.YearMonthCombo);

19
src/widget/yearquarter/combo.yearquarter.js

@ -8,6 +8,8 @@ BI.YearQuarterCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.YearQuarterCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-year-quarter-combo",
yearBehaviors: {},
quarterBehaviors: {},
height: 25
});
},
@ -16,20 +18,28 @@ BI.YearQuarterCombo = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.year = BI.createWidget({
type: "bi.year_combo"
type: "bi.year_combo",
behaviors: o.yearBehaviors
});
this.quarter = BI.createWidget({
type: "bi.quarter_combo"
type: "bi.quarter_combo",
behaviors: o.quarterBehaviors
});
this.year.on(BI.YearCombo.EVENT_CONFIRM, function(){
this.year.on(BI.YearCombo.EVENT_CONFIRM, function () {
self.fireEvent(BI.YearQuarterCombo.EVENT_CONFIRM);
});
this.year.on(BI.YearCombo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.YearQuarterCombo.EVENT_BEFORE_POPUPVIEW);
});
this.quarter.on(BI.QuarterCombo.EVENT_CONFIRM, function(){
this.quarter.on(BI.QuarterCombo.EVENT_CONFIRM, function () {
self.fireEvent(BI.YearQuarterCombo.EVENT_CONFIRM);
});
this.quarter.on(BI.QuarterCombo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.YearQuarterCombo.EVENT_BEFORE_POPUPVIEW);
});
BI.createWidget({
type: "bi.center",
@ -54,4 +64,5 @@ BI.YearQuarterCombo = BI.inherit(BI.Widget, {
}
});
BI.YearQuarterCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.YearQuarterCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut('bi.year_quarter_combo', BI.YearQuarterCombo);
Loading…
Cancel
Save