From a6e143bdd723330730f6093bfe80632723fa5084 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 7 Jun 2017 16:57:59 +0800 Subject: [PATCH 01/14] setSelectedValue --- bi/widget.js | 2 +- docs/widget.js | 2 +- src/widget/multitree/check/multi.tree.check.pane.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bi/widget.js b/bi/widget.js index dd99f936f..1414c0252 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -11614,7 +11614,7 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, { setValue: function (v) { v || (v = {}); - this.display.setValue(v.value); + this.display.setSelectedValue(v.value); }, getValue: function () { diff --git a/docs/widget.js b/docs/widget.js index dd99f936f..1414c0252 100644 --- a/docs/widget.js +++ b/docs/widget.js @@ -11614,7 +11614,7 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, { setValue: function (v) { v || (v = {}); - this.display.setValue(v.value); + this.display.setSelectedValue(v.value); }, getValue: function () { diff --git a/src/widget/multitree/check/multi.tree.check.pane.js b/src/widget/multitree/check/multi.tree.check.pane.js index a23a7985d..cd85c949c 100644 --- a/src/widget/multitree/check/multi.tree.check.pane.js +++ b/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 () { From eee2958b5561b425e0421bd6e9cad31ba8668b68 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 7 Jun 2017 19:39:43 +0800 Subject: [PATCH 02/14] add --- bi/base.js | 27 +--- bi/case.js | 26 +--- bi/core.js | 38 +++-- bi/widget.css | 1 - bi/widget.js | 136 +++++++++++------- docs/base.js | 27 +--- docs/case.js | 26 +--- docs/core.js | 38 +++-- docs/widget.css | 1 - docs/widget.js | 136 +++++++++++------- src/base/combination/combo.js | 5 - src/base/combination/expander.js | 5 - src/base/combination/loader.js | 4 - src/base/combination/switcher.js | 5 - src/base/single/label/label.js | 4 +- src/base/tree/customtree.js | 4 - src/case/calendar/calendar.year.js | 2 + src/case/layer/pane.list.js | 4 - src/case/list/list.select.js | 4 - src/case/loader/loader.lazy.js | 4 - src/case/loader/loader.list.js | 4 - src/case/loader/sort.list.js | 4 - src/case/tree/tree.level.js | 4 - src/core/behavior/behavior.highlight.js | 30 ++-- src/core/widget.js | 8 ++ src/css/widget/year/popup.year.css | 1 - src/less/widget/year/popup.year.less | 1 - src/widget/month/combo.month.js | 14 +- src/widget/month/popup.month.js | 6 +- .../multilayerselecttree.leveltree.js | 4 - .../multilayersingletree.leveltree.js | 4 - src/widget/quarter/combo.quarter.js | 16 ++- src/widget/quarter/popup.quarter.js | 6 +- src/widget/year/combo.year.js | 43 +++--- src/widget/year/popup.year.js | 5 +- src/widget/yearmonth/combo.yearmonth.js | 19 ++- src/widget/yearquarter/combo.yearquarter.js | 19 ++- 37 files changed, 357 insertions(+), 328 deletions(-) diff --git a/bi/base.js b/bi/base.js index c5c7353c3..460bfb704 100644 --- a/bi/base.js +++ b/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, @@ -33019,10 +33000,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); }, diff --git a/bi/case.js b/bi/case.js index 7090b6ee8..060b96bfe 100644 --- a/bi/case.js +++ b/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); }, diff --git a/bi/core.js b/bi/core.js index 87cdaf46e..dd9d00130 100644 --- a/bi/core.js +++ b/bi/core.js @@ -4577,6 +4577,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; }, @@ -10973,26 +10981,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); diff --git a/bi/widget.css b/bi/widget.css index 474396fdf..85b1f4c3e 100644 --- a/bi/widget.css +++ b/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; diff --git a/bi/widget.js b/bi/widget.js index dd99f936f..899371cdd 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -7739,6 +7739,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 +7752,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 +7775,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 +7794,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 +7811,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 +7823,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 +7861,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 +8178,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 +8719,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); }, @@ -13976,6 +13976,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 +13997,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 +14035,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 +14051,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 +14063,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 +14100,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 +16589,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 +16617,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 +16628,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 +16679,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 +16692,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 +16703,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 +16740,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 +16900,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 +16910,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 +16956,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 +16967,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 +16977,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 +17023,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返回的是所有值 * 封装了字段处理逻辑 diff --git a/docs/base.js b/docs/base.js index c5c7353c3..460bfb704 100644 --- a/docs/base.js +++ b/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, @@ -33019,10 +33000,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); }, diff --git a/docs/case.js b/docs/case.js index 7090b6ee8..060b96bfe 100644 --- a/docs/case.js +++ b/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); }, diff --git a/docs/core.js b/docs/core.js index b89a7f08d..44cbced69 100644 --- a/docs/core.js +++ b/docs/core.js @@ -14579,6 +14579,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; }, @@ -20620,26 +20628,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); diff --git a/docs/widget.css b/docs/widget.css index 474396fdf..85b1f4c3e 100644 --- a/docs/widget.css +++ b/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; diff --git a/docs/widget.js b/docs/widget.js index dd99f936f..899371cdd 100644 --- a/docs/widget.js +++ b/docs/widget.js @@ -7739,6 +7739,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 +7752,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 +7775,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 +7794,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 +7811,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 +7823,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 +7861,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 +8178,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 +8719,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); }, @@ -13976,6 +13976,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 +13997,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 +14035,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 +14051,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 +14063,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 +14100,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 +16589,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 +16617,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 +16628,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 +16679,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 +16692,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 +16703,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 +16740,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 +16900,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 +16910,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 +16956,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 +16967,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 +16977,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 +17023,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返回的是所有值 * 封装了字段处理逻辑 diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index 2f79b2930..4b20149d7 100644 --- a/src/base/combination/combo.js +++ b/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(); }, diff --git a/src/base/combination/expander.js b/src/base/combination/expander.js index 8c57326af..55b9c2b61 100644 --- a/src/base/combination/expander.js +++ b/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(); }, diff --git a/src/base/combination/loader.js b/src/base/combination/loader.js index ee25cd4ae..9b6acbb9f 100644 --- a/src/base/combination/loader.js +++ b/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); }, diff --git a/src/base/combination/switcher.js b/src/base/combination/switcher.js index a4edaec70..650d91943 100644 --- a/src/base/combination/switcher.js +++ b/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(); }, diff --git a/src/base/single/label/label.js b/src/base/single/label/label.js index 458ac5a11..bbb0deb48 100644 --- a/src/base/single/label/label.js +++ b/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, diff --git a/src/base/tree/customtree.js b/src/base/tree/customtree.js index 1d5342ae8..96a692fe0 100644 --- a/src/base/tree/customtree.js +++ b/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); }, diff --git a/src/case/calendar/calendar.year.js b/src/case/calendar/calendar.year.js index 1d9467a86..b9ca8a14f 100644 --- a/src/case/calendar/calendar.year.js +++ b/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, diff --git a/src/case/layer/pane.list.js b/src/case/layer/pane.list.js index fcedfc8b3..2e1782635 100644 --- a/src/case/layer/pane.list.js +++ b/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); }, diff --git a/src/case/list/list.select.js b/src/case/list/list.select.js index 4c3ad99d4..26d1297b8 100644 --- a/src/case/list/list.select.js +++ b/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(); diff --git a/src/case/loader/loader.lazy.js b/src/case/loader/loader.lazy.js index 76fa3ea99..2f3d6859c 100644 --- a/src/case/loader/loader.lazy.js +++ b/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); }, diff --git a/src/case/loader/loader.list.js b/src/case/loader/loader.list.js index 22c81eb1f..b855c34a2 100644 --- a/src/case/loader/loader.list.js +++ b/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); }, diff --git a/src/case/loader/sort.list.js b/src/case/loader/sort.list.js index 776434140..c452307ff 100644 --- a/src/case/loader/sort.list.js +++ b/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); }, diff --git a/src/case/tree/tree.level.js b/src/case/tree/tree.level.js index 290dc1462..3ca6a75dc 100644 --- a/src/case/tree/tree.level.js +++ b/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); }, diff --git a/src/core/behavior/behavior.highlight.js b/src/core/behavior/behavior.highlight.js index e91c2af2f..2dfe3f10e 100644 --- a/src/core/behavior/behavior.highlight.js +++ b/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); diff --git a/src/core/widget.js b/src/core/widget.js index 610b38492..cd4ae58be 100644 --- a/src/core/widget.js +++ b/src/core/widget.js @@ -254,6 +254,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; }, diff --git a/src/css/widget/year/popup.year.css b/src/css/widget/year/popup.year.css index fa13c362d..f68a42e69 100644 --- a/src/css/widget/year/popup.year.css +++ b/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; diff --git a/src/less/widget/year/popup.year.less b/src/less/widget/year/popup.year.less index 949f7c516..5ef0f5bc0 100644 --- a/src/less/widget/year/popup.year.less +++ b/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; } diff --git a/src/widget/month/combo.month.js b/src/widget/month/combo.month.js index 6e2e719e6..db44f7953 100644 --- a/src/widget/month/combo.month.js +++ b/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); \ No newline at end of file diff --git a/src/widget/month/popup.month.js b/src/widget/month/popup.month.js index 1ad5e7743..16373e113 100644 --- a/src/widget/month/popup.month.js +++ b/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 diff --git a/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js b/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js index edcbb12e3..30a5ec2de 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js +++ b/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); }, diff --git a/src/widget/multilayersingletree/multilayersingletree.leveltree.js b/src/widget/multilayersingletree/multilayersingletree.leveltree.js index ad02ec40f..057b41d2f 100644 --- a/src/widget/multilayersingletree/multilayersingletree.leveltree.js +++ b/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); }, diff --git a/src/widget/quarter/combo.quarter.js b/src/widget/quarter/combo.quarter.js index 0d31ba6aa..662f72267 100644 --- a/src/widget/quarter/combo.quarter.js +++ b/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); \ No newline at end of file diff --git a/src/widget/quarter/popup.quarter.js b/src/widget/quarter/popup.quarter.js index 1deeb8e1d..4fedb4e6a 100644 --- a/src/widget/quarter/popup.quarter.js +++ b/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" diff --git a/src/widget/year/combo.year.js b/src/widget/year/combo.year.js index d789c84a1..ad7bdedb4 100644 --- a/src/widget/year/combo.year.js +++ b/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); \ No newline at end of file diff --git a/src/widget/year/popup.year.js b/src/widget/year/popup.year.js index cda353b12..bbee27655 100644 --- a/src/widget/year/popup.year.js +++ b/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] }, diff --git a/src/widget/yearmonth/combo.yearmonth.js b/src/widget/yearmonth/combo.yearmonth.js index 169c96862..5780cc57d 100644 --- a/src/widget/yearmonth/combo.yearmonth.js +++ b/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); \ No newline at end of file diff --git a/src/widget/yearquarter/combo.yearquarter.js b/src/widget/yearquarter/combo.yearquarter.js index 3cb47364c..4671edb1c 100644 --- a/src/widget/yearquarter/combo.yearquarter.js +++ b/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); \ No newline at end of file From 91e0ae0cea405538a1c119bfe216a74c35a39ca0 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 8 Jun 2017 13:52:23 +0800 Subject: [PATCH 03/14] =?UTF-8?q?floatbox=E5=B7=A6=E5=8F=B3=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/layer/layer.floatbox.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/layer/layer.floatbox.js b/src/base/layer/layer.floatbox.js index 8f4b7002a..df059528c 100644 --- a/src/base/layer/layer.floatbox.js +++ b/src/base/layer/layer.floatbox.js @@ -79,9 +79,9 @@ BI.FloatBox = BI.inherit(BI.Widget, { type: "bi.absolute", items: [{ el: this._center, - left: 10, + left: 20, top: 10, - right: 10, + right: 20, bottom: 10 }] } From eb8d967a22dd09bb0877e488106dae5a9a07e21b Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 8 Jun 2017 14:07:45 +0800 Subject: [PATCH 04/14] update --- src/case/trigger/trigger.text.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/case/trigger/trigger.text.js b/src/case/trigger/trigger.text.js index 46681eba9..426451d56 100644 --- a/src/case/trigger/trigger.text.js +++ b/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 }); From 6a400bf32a882d8be4c2576059a799758207e1e5 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 8 Jun 2017 15:24:47 +0800 Subject: [PATCH 05/14] =?UTF-8?q?numericinterval=E5=88=9D=E5=A7=8Bvalid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/numericalinterval/numericalinterval.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widget/numericalinterval/numericalinterval.js b/src/widget/numericalinterval/numericalinterval.js index f7231708d..58140077b 100644 --- a/src/widget/numericalinterval/numericalinterval.js +++ b/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 () { From 3f3de99732441133c1c4914daf009711fa700c6e Mon Sep 17 00:00:00 2001 From: fay Date: Thu, 8 Jun 2017 16:34:45 +0800 Subject: [PATCH 06/14] update --- src/core/alias.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/alias.js b/src/core/alias.js index 59f7c5542..cc3aa3a9b 100644 --- a/src/core/alias.js +++ b/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); From fae985cf48a4d037d1afa33ab5226ca780026c2d Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 8 Jun 2017 20:22:10 +0800 Subject: [PATCH 07/14] add --- bi/base.js | 35 ++-- bi/core.css | 183 ++++++++++++++++++++ bi/core.js | 2 +- bi/widget.js | 12 +- docs/base.js | 35 ++-- docs/core.css | 183 ++++++++++++++++++++ docs/core.js | 2 +- docs/widget.js | 12 +- src/base/table/table.collection.quick.js | 19 +- src/base/table/table.grid.quick.js | 16 +- src/core/func/function.js | 2 +- src/css/core/utils/common.css | 183 ++++++++++++++++++++ src/less/core/utils/common.less | 144 +++++++++++++++ src/less/lib/colors.less | 4 +- src/less/lib/constant.less | 1 + src/widget/branchrelation/branchrelation.js | 8 +- src/widget/pathchooser/pathchooser.js | 4 +- 17 files changed, 769 insertions(+), 76 deletions(-) diff --git a/bi/base.js b/bi/base.js index 460bfb704..23c9a67c6 100644 --- a/bi/base.js +++ b/bi/base.js @@ -29535,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; @@ -29552,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); @@ -29580,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(); @@ -29598,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); @@ -30255,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)) { @@ -30272,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); @@ -30309,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(); @@ -30331,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) { diff --git a/bi/core.css b/bi/core.css index ed35e8965..47b33cda3 100644 --- a/bi/core.css +++ b/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 { diff --git a/bi/core.js b/bi/core.js index dd9d00130..9c696303d 100644 --- a/bi/core.js +++ b/bi/core.js @@ -16828,7 +16828,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; diff --git a/bi/widget.js b/bi/widget.js index 5d35f613b..425380278 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -4217,7 +4217,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 +4238,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 +4259,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 +4280,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"); } }) }); @@ -13106,8 +13106,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 () { diff --git a/docs/base.js b/docs/base.js index 460bfb704..23c9a67c6 100644 --- a/docs/base.js +++ b/docs/base.js @@ -29535,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; @@ -29552,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); @@ -29580,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(); @@ -29598,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); @@ -30255,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)) { @@ -30272,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); @@ -30309,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(); @@ -30331,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) { diff --git a/docs/core.css b/docs/core.css index ed35e8965..47b33cda3 100644 --- a/docs/core.css +++ b/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 { diff --git a/docs/core.js b/docs/core.js index 44cbced69..0136a2c07 100644 --- a/docs/core.js +++ b/docs/core.js @@ -22846,7 +22846,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; diff --git a/docs/widget.js b/docs/widget.js index 5d35f613b..425380278 100644 --- a/docs/widget.js +++ b/docs/widget.js @@ -4217,7 +4217,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 +4238,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 +4259,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 +4280,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"); } }) }); @@ -13106,8 +13106,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 () { diff --git a/src/base/table/table.collection.quick.js b/src/base/table/table.collection.quick.js index 1e9565860..ad8c014bd 100644 --- a/src/base/table/table.collection.quick.js +++ b/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); diff --git a/src/base/table/table.grid.quick.js b/src/base/table/table.grid.quick.js index 8bd73149d..878f1bcd2 100644 --- a/src/base/table/table.grid.quick.js +++ b/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) { diff --git a/src/core/func/function.js b/src/core/func/function.js index 78a005ec4..dee83d9db 100644 --- a/src/core/func/function.js +++ b/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; diff --git a/src/css/core/utils/common.css b/src/css/core/utils/common.css index 23ca02db3..db1d0a753 100644 --- a/src/css/core/utils/common.css +++ b/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 { diff --git a/src/less/core/utils/common.less b/src/less/core/utils/common.less index 6537c9d8e..7a8d6dc54 100644 --- a/src/less/core/utils/common.less +++ b/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; } diff --git a/src/less/lib/colors.less b/src/less/lib/colors.less index f69816112..4e7cd0b9e 100644 --- a/src/less/lib/colors.less +++ b/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; //成功背景色 diff --git a/src/less/lib/constant.less b/src/less/lib/constant.less index 77b403fb1..bcfec0866 100644 --- a/src/less/lib/constant.less +++ b/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; diff --git a/src/widget/branchrelation/branchrelation.js b/src/widget/branchrelation/branchrelation.js index c390e3ea7..535f68802 100644 --- a/src/widget/branchrelation/branchrelation.js +++ b/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"); } }) }); diff --git a/src/widget/pathchooser/pathchooser.js b/src/widget/pathchooser/pathchooser.js index bd8c78311..59cab0020 100644 --- a/src/widget/pathchooser/pathchooser.js +++ b/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 () { From 9e0851442c2eecbd66f5154b97c8dba74b2c6fab Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 8 Jun 2017 20:22:51 +0800 Subject: [PATCH 08/14] add --- bi/base.js | 4 ++-- bi/case.js | 1 + bi/widget.js | 4 ++-- docs/base.js | 4 ++-- docs/case.js | 1 + docs/widget.js | 4 ++-- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/bi/base.js b/bi/base.js index 23c9a67c6..34f5c5729 100644 --- a/bi/base.js +++ b/bi/base.js @@ -15079,9 +15079,9 @@ BI.FloatBox = BI.inherit(BI.Widget, { type: "bi.absolute", items: [{ el: this._center, - left: 10, + left: 20, top: 10, - right: 10, + right: 20, bottom: 10 }] } diff --git a/bi/case.js b/bi/case.js index 060b96bfe..974f1f22a 100644 --- a/bi/case.js +++ b/bi/case.js @@ -12389,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 }); diff --git a/bi/widget.js b/bi/widget.js index 425380278..aab2005f3 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -12279,8 +12279,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 () { diff --git a/docs/base.js b/docs/base.js index 23c9a67c6..34f5c5729 100644 --- a/docs/base.js +++ b/docs/base.js @@ -15079,9 +15079,9 @@ BI.FloatBox = BI.inherit(BI.Widget, { type: "bi.absolute", items: [{ el: this._center, - left: 10, + left: 20, top: 10, - right: 10, + right: 20, bottom: 10 }] } diff --git a/docs/case.js b/docs/case.js index 060b96bfe..974f1f22a 100644 --- a/docs/case.js +++ b/docs/case.js @@ -12389,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 }); diff --git a/docs/widget.js b/docs/widget.js index 425380278..aab2005f3 100644 --- a/docs/widget.js +++ b/docs/widget.js @@ -12279,8 +12279,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 () { From f68d979987dc1207cdb1cc50c8e24cbd7b30d11b Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 9 Jun 2017 10:28:17 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/layer/layer.floatbox.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/layer/layer.floatbox.js b/src/base/layer/layer.floatbox.js index df059528c..8f4b7002a 100644 --- a/src/base/layer/layer.floatbox.js +++ b/src/base/layer/layer.floatbox.js @@ -79,9 +79,9 @@ BI.FloatBox = BI.inherit(BI.Widget, { type: "bi.absolute", items: [{ el: this._center, - left: 20, + left: 10, top: 10, - right: 20, + right: 10, bottom: 10 }] } From a8f3b9e436f15b399b23a2e18b3fcc6116f75497 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 9 Jun 2017 10:56:12 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E6=94=B9=E4=B8=80=E4=B8=8BisValid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/numericalinterval/numericalinterval.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/widget/numericalinterval/numericalinterval.js b/src/widget/numericalinterval/numericalinterval.js index 58140077b..f5badc6d0 100644 --- a/src/widget/numericalinterval/numericalinterval.js +++ b/src/widget/numericalinterval/numericalinterval.js @@ -425,8 +425,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, { }) }, - - isValid: function () { + isStateValid: function () { return this.options.validation === "valid"; }, From 9d7628fc0c057f64a557ac79de0b0c2867c1e545 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 12 Jun 2017 10:14:06 +0800 Subject: [PATCH 11/14] update --- bi/base.js | 4 +-- bi/core.js | 29 +++++++++++++++---- bi/widget.js | 8 ++--- docs/base.js | 4 +-- docs/core.js | 29 +++++++++++++++---- docs/widget.js | 8 ++--- src/core/controller/router.floatbox.js | 7 +++-- src/core/events.js | 6 ++++ src/core/view.js | 6 ++++ src/core/widget.js | 8 +++-- .../sequencetable/treenumber.sequencetable.js | 5 ++-- 11 files changed, 83 insertions(+), 31 deletions(-) diff --git a/bi/base.js b/bi/base.js index 34f5c5729..23c9a67c6 100644 --- a/bi/base.js +++ b/bi/base.js @@ -15079,9 +15079,9 @@ BI.FloatBox = BI.inherit(BI.Widget, { type: "bi.absolute", items: [{ el: this._center, - left: 20, + left: 10, top: 10, - right: 20, + right: 10, bottom: 10 }] } diff --git a/bi/core.js b/bi/core.js index 9c696303d..ece344eed 100644 --- a/bi/core.js +++ b/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 () { @@ -4719,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 () { @@ -4750,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(); @@ -5253,6 +5261,8 @@ BI.View = BI.inherit(BI.V, { created: null, + beforeDestroyed: null, + destroyed: null, _init: function () { @@ -5742,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; @@ -15959,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; @@ -15998,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(); diff --git a/bi/widget.js b/bi/widget.js index aab2005f3..05cbb17a1 100644 --- a/bi/widget.js +++ b/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; } } }); @@ -12681,8 +12682,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, { }) }, - - isValid: function () { + isStateValid: function () { return this.options.validation === "valid"; }, diff --git a/docs/base.js b/docs/base.js index 34f5c5729..23c9a67c6 100644 --- a/docs/base.js +++ b/docs/base.js @@ -15079,9 +15079,9 @@ BI.FloatBox = BI.inherit(BI.Widget, { type: "bi.absolute", items: [{ el: this._center, - left: 20, + left: 10, top: 10, - right: 20, + right: 10, bottom: 10 }] } diff --git a/docs/core.js b/docs/core.js index 0136a2c07..be104363d 100644 --- a/docs/core.js +++ b/docs/core.js @@ -14362,6 +14362,8 @@ BI.Widget = BI.inherit(BI.OB, { update: function () { }, + beforeDestroyed: null, + destroyed: null, _init: function () { @@ -14721,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 () { @@ -14752,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(); @@ -15255,6 +15257,8 @@ BI.View = BI.inherit(BI.V, { created: null, + beforeDestroyed: null, + destroyed: null, _init: function () { @@ -15744,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; @@ -20132,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); @@ -21552,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; @@ -21591,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(); @@ -21758,6 +21769,12 @@ _.extend(BI, { */ DESTROY: '_DESTROY', + /** + * @static + * @property 取消挂载事件 + */ + UNMOUNT: '_UNMOUNT', + /** * @static * @property 清除选择 diff --git a/docs/widget.js b/docs/widget.js index aab2005f3..05cbb17a1 100644 --- a/docs/widget.js +++ b/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; } } }); @@ -12681,8 +12682,7 @@ BI.NumericalInterval = BI.inherit(BI.Single, { }) }, - - isValid: function () { + isStateValid: function () { return this.options.validation === "valid"; }, diff --git a/src/core/controller/router.floatbox.js b/src/core/controller/router.floatbox.js index 1076b0424..5707f34fc 100644 --- a/src/core/controller/router.floatbox.js +++ b/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(); diff --git a/src/core/events.js b/src/core/events.js index 91d0aa1a9..cbaf9f4af 100644 --- a/src/core/events.js +++ b/src/core/events.js @@ -53,6 +53,12 @@ _.extend(BI, { */ DESTROY: '_DESTROY', + /** + * @static + * @property 取消挂载事件 + */ + UNMOUNT: '_UNMOUNT', + /** * @static * @property 清除选择 diff --git a/src/core/view.js b/src/core/view.js index 5912819cd..21e9efb2e 100644 --- a/src/core/view.js +++ b/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; diff --git a/src/core/widget.js b/src/core/widget.js index cd4ae58be..62775547e 100644 --- a/src/core/widget.js +++ b/src/core/widget.js @@ -37,6 +37,8 @@ BI.Widget = BI.inherit(BI.OB, { update: function () { }, + beforeDestroyed: null, + destroyed: null, _init: function () { @@ -396,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 () { @@ -427,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(); diff --git a/src/widget/sequencetable/treenumber.sequencetable.js b/src/widget/sequencetable/treenumber.sequencetable.js index 6a1fff133..057a5e6c2 100644 --- a/src/widget/sequencetable/treenumber.sequencetable.js +++ b/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; } } }); From 26b3daab12794f0a534cc604968150d3881d820c Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 12 Jun 2017 12:57:45 +0800 Subject: [PATCH 12/14] update --- bi/widget.js | 23 ++++++++++++++----- docs/widget.js | 23 ++++++++++++++----- .../adaptivearrangement.js | 8 +++++-- src/widget/arrangement/arrangement.js | 11 +++++---- .../interactivearrangement.js | 4 ++++ 5 files changed, 51 insertions(+), 18 deletions(-) diff --git a/bi/widget.js b/bi/widget.js index 05cbb17a1..e8c2ae9ac 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -475,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", @@ -879,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); }, @@ -1205,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); @@ -1248,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); @@ -3679,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) { @@ -7682,6 +7689,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); }, diff --git a/docs/widget.js b/docs/widget.js index 05cbb17a1..e8c2ae9ac 100644 --- a/docs/widget.js +++ b/docs/widget.js @@ -475,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", @@ -879,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); }, @@ -1205,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); @@ -1248,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); @@ -3679,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) { @@ -7682,6 +7689,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); }, diff --git a/src/widget/adaptivearrangement/adaptivearrangement.js b/src/widget/adaptivearrangement/adaptivearrangement.js index 4f168791a..e446c4ed0 100644 --- a/src/widget/adaptivearrangement/adaptivearrangement.js +++ b/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); }, diff --git a/src/widget/arrangement/arrangement.js b/src/widget/arrangement/arrangement.js index 96514ce62..d56a878b1 100644 --- a/src/widget/arrangement/arrangement.js +++ b/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) { diff --git a/src/widget/interactivearrangement/interactivearrangement.js b/src/widget/interactivearrangement/interactivearrangement.js index 6ed67fa2d..f6d815d82 100644 --- a/src/widget/interactivearrangement/interactivearrangement.js +++ b/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); }, From f6c255b8345272297c6bc027dc6c3a22a795dfcb Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 12 Jun 2017 13:17:53 +0800 Subject: [PATCH 13/14] update --- bi/widget.js | 3 +++ docs/widget.js | 3 +++ src/widget/multitree/multi.tree.combo.js | 3 +++ 3 files changed, 9 insertions(+) diff --git a/bi/widget.js b/bi/widget.js index e8c2ae9ac..a3e3971cd 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -11744,6 +11744,9 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { self.trigger.getSearcher().adjustView(); }); } + }, + hideChecker: function (e) { + return triggerBtn.element.find(e.target).length === 0; } }); diff --git a/docs/widget.js b/docs/widget.js index e8c2ae9ac..a3e3971cd 100644 --- a/docs/widget.js +++ b/docs/widget.js @@ -11744,6 +11744,9 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { self.trigger.getSearcher().adjustView(); }); } + }, + hideChecker: function (e) { + return triggerBtn.element.find(e.target).length === 0; } }); diff --git a/src/widget/multitree/multi.tree.combo.js b/src/widget/multitree/multi.tree.combo.js index 3c98f2c52..fb5234f4c 100644 --- a/src/widget/multitree/multi.tree.combo.js +++ b/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; } }); From 813f0d1451d0b8d9dd84c150e1cb094b413c1860 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 12 Jun 2017 14:37:09 +0800 Subject: [PATCH 14/14] update --- bi/widget.js | 3 +-- docs/widget.js | 3 +-- src/widget/arrangement/arrangement.js | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/bi/widget.js b/bi/widget.js index a3e3971cd..7e8266319 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -3698,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); @@ -3718,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(); diff --git a/docs/widget.js b/docs/widget.js index a3e3971cd..7e8266319 100644 --- a/docs/widget.js +++ b/docs/widget.js @@ -3698,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); @@ -3718,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(); diff --git a/src/widget/arrangement/arrangement.js b/src/widget/arrangement/arrangement.js index d56a878b1..75e597cc5 100644 --- a/src/widget/arrangement/arrangement.js +++ b/src/widget/arrangement/arrangement.js @@ -2703,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); @@ -2723,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();