From bddb0b09aff33d66bb7eaf99d3ab6646c83b4729 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 6 Aug 2018 09:39:33 +0800 Subject: [PATCH] BI-28696 && BI-19821 --- demo/js/case/editor/demo.sign_editor.js | 2 +- dist/base.css | 14 ++++ dist/base.js | 6 +- dist/bundle.css | 30 +++++++ dist/bundle.js | 78 +++++++++++++++---- dist/case.js | 66 ++++++++++++++-- dist/core.css | 8 ++ dist/core_without_normalize.css | 8 ++ dist/demo.js | 2 +- dist/fineui.css | 30 +++++++ dist/fineui.js | 78 +++++++++++++++---- dist/widget.css | 8 ++ dist/widget.js | 6 +- .../button/listitem/icontexticonitem.js | 6 +- src/case/calendar/calendar.date.item.js | 53 +++++++++++++ src/case/calendar/calendar.js | 10 +-- .../trigger.searchtextvalue.js | 2 +- src/case/trigger/trigger.text.select.js | 2 +- src/css/base/combo/combo.css | 14 ++++ src/css/core/utils/common.css | 8 ++ src/css/widget/multiselect/multiselect.css | 4 + .../singletreecombo/singletreecombo.css | 4 + src/less/base/combo/combo.less | 6 +- .../base/combo/combo.searchtextvalue.less | 16 ++-- src/less/base/combo/combo.textvalue.less | 16 ++-- src/less/core/utils/common.less | 7 ++ .../widget/multiselect/multiselect.combo.less | 14 ++-- .../singletreecombo/singletreecombo.less | 14 ++-- .../date/calendar/popup.calendar.date.js | 2 +- src/widget/editor/editor.search.js | 2 +- src/widget/numbereditor/number.editor.js | 2 +- 31 files changed, 429 insertions(+), 89 deletions(-) create mode 100644 src/case/calendar/calendar.date.item.js diff --git a/demo/js/case/editor/demo.sign_editor.js b/demo/js/case/editor/demo.sign_editor.js index 9c65fb31d..4850394f7 100644 --- a/demo/js/case/editor/demo.sign_editor.js +++ b/demo/js/case/editor/demo.sign_editor.js @@ -8,7 +8,7 @@ Demo.SignEditor = BI.inherit(BI.Widget, { render: function () { var editor = BI.createWidget({ type: "bi.sign_editor", - cls: "bi-border", + cls: "bi-border bi-focus-shadow", validationChecker: function (v) { return v != "abc"; }, diff --git a/dist/base.css b/dist/base.css index ac868ba16..76552a710 100644 --- a/dist/base.css +++ b/dist/base.css @@ -422,6 +422,12 @@ display: block !important; visibility: visible !important; } +.bi-combo.bi-combo-popup:focus, +.bi-combo.bi-combo-popup:hover { + -webkit-box-shadow: 0 0 5px 2px #d7e7fc; + -moz-box-shadow: 0 0 5px 2px #d7e7fc; + box-shadow: 0 0 5px 2px #d7e7fc; +} .bi-search-text-value-combo .trigger-icon-button { font-size: 16px; @@ -441,6 +447,10 @@ .bi-search-text-value-combo.combo-show .trigger-down { display: none; } +.bi-combo.bi-combo-popup .bi-search-text-value-trigger, +.bi-combo:hover .bi-search-text-value-trigger { + border-color: #3685f2; +} .bi-icon-text-value-combo.combo-error .bi-text-trigger .select-text-label { color: #ff4949; @@ -449,6 +459,10 @@ .bi-text-value-combo.combo-error .bi-select-text-trigger .select-text-label { color: #ff4949; } +.bi-combo.bi-combo-popup .bi-select-text-trigger, +.bi-combo:hover .bi-select-text-trigger { + border-color: #3685f2; +} /*************BI.SearchEditor******************/ .bi-search-editor { -webkit-border-radius: 2px; diff --git a/dist/base.js b/dist/base.js index 66ad3174f..4e0e78ad4 100644 --- a/dist/base.js +++ b/dist/base.js @@ -17353,14 +17353,14 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, { var icon1 = BI.createWidget({ type: "bi.icon_label", cls: o.iconCls1, - width: o.height, + width: o.leftIconWrapperWidth, height: o.height, iconWidth: o.iconWidth, iconHeight: o.iconHeight }); var blank = BI.createWidget({ type: "bi.layout", - width: o.height, + width: o.height }); BI.createWidget({ type: "bi.absolute", @@ -17369,7 +17369,7 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, { el: { type: "bi.icon_label", cls: o.iconCls2, - width: o.height, + width: o.rightIconWrapperWidth, height: o.height, iconWidth: o.iconWidth, iconHeight: o.iconHeight diff --git a/dist/bundle.css b/dist/bundle.css index c8c39c0d4..09e7f2216 100644 --- a/dist/bundle.css +++ b/dist/bundle.css @@ -312,6 +312,14 @@ textarea { .bi-theme-dark .base-disabled .b-font:before { color: #606479 !important; } +.bi-focus-shadow:focus-within, +.bi-focus-shadow:hover, +.bi-focus-shadow:focus { + border-color: #3685f2; + -webkit-box-shadow: 0 0 5px 2px #d7e7fc; + -moz-box-shadow: 0 0 5px 2px #d7e7fc; + box-shadow: 0 0 5px 2px #d7e7fc; +} .base-invalid { cursor: default !important; } @@ -2274,6 +2282,12 @@ textarea { display: block !important; visibility: visible !important; } +.bi-combo.bi-combo-popup:focus, +.bi-combo.bi-combo-popup:hover { + -webkit-box-shadow: 0 0 5px 2px #d7e7fc; + -moz-box-shadow: 0 0 5px 2px #d7e7fc; + box-shadow: 0 0 5px 2px #d7e7fc; +} .bi-search-text-value-combo .trigger-icon-button { font-size: 16px; @@ -2293,6 +2307,10 @@ textarea { .bi-search-text-value-combo.combo-show .trigger-down { display: none; } +.bi-combo.bi-combo-popup .bi-search-text-value-trigger, +.bi-combo:hover .bi-search-text-value-trigger { + border-color: #3685f2; +} .bi-icon-text-value-combo.combo-error .bi-text-trigger .select-text-label { color: #ff4949; @@ -2301,6 +2319,10 @@ textarea { .bi-text-value-combo.combo-error .bi-select-text-trigger .select-text-label { color: #ff4949; } +.bi-combo.bi-combo-popup .bi-select-text-trigger, +.bi-combo:hover .bi-select-text-trigger { + border-color: #3685f2; +} /*************BI.SearchEditor******************/ .bi-search-editor { -webkit-border-radius: 2px; @@ -4231,6 +4253,10 @@ ul.ztree.zTreeDragUL { .bi-multi-select-combo.combo-show .trigger-down { display: none; } +.bi-combo.bi-combo-popup:focus .bi-multi-select-trigger, +.bi-combo.bi-combo-popup:hover .bi-multi-select-trigger { + border-color: #3685f2; +} .bi-multi-select-insert-combo .multi-select-trigger-icon-button { font-size: 16px; @@ -4545,6 +4571,10 @@ ul.ztree.zTreeDragUL { -moz-border-radius: 3px; border-radius: 3px; } +.bi-combo.bi-combo-popup:focus .bi-single-tree-trigger, +.bi-combo.bi-combo-popup:hover .bi-single-tree-trigger { + border-color: #3685f2; +} .bi-date-interval.time-error .bi-input { color: #ff4949; } diff --git a/dist/bundle.js b/dist/bundle.js index 03fc6d332..540f4093a 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -53275,14 +53275,14 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, { var icon1 = BI.createWidget({ type: "bi.icon_label", cls: o.iconCls1, - width: o.height, + width: o.leftIconWrapperWidth, height: o.height, iconWidth: o.iconWidth, iconHeight: o.iconHeight }); var blank = BI.createWidget({ type: "bi.layout", - width: o.height, + width: o.height }); BI.createWidget({ type: "bi.absolute", @@ -53291,7 +53291,7 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, { el: { type: "bi.icon_label", cls: o.iconCls2, - width: o.height, + width: o.rightIconWrapperWidth, height: o.height, iconWidth: o.iconWidth, iconHeight: o.iconHeight @@ -74283,6 +74283,58 @@ BI.TreeTextLeafItem = BI.inherit(BI.BasicButton, { }); BI.shortcut("bi.tree_text_leaf_item", BI.TreeTextLeafItem);/** + * 专门为calendar的视觉加的button,作为私有button,不能配置任何属性,也不要用这个玩意 + */ +BI.CalendarDateItem = BI.inherit(BI.BasicButton, { + + render: function () { + var self = this, o = this.options; + return { + type: "bi.absolute", + items: [{ + el: { + type: "bi.text_item", + cls: "bi-list-item-select", + textAlign: "center", + whiteSpace: "normal", + text: o.text, + value: o.value, + ref: function () { + self.text = this; + } + }, + left: o.lgap, + right: o.rgap, + top: 0, + bottom: 0 + }] + }; + }, + + doHighLight: function () { + this.text.doHighLight.apply(this.text, arguments); + }, + + unHighLight: function () { + this.text.unHighLight.apply(this.text, arguments); + }, + + setValue: function () { + if (!this.isReadOnly()) { + this.text.setValue.apply(this.text, arguments); + } + }, + + setSelected: function (b) { + BI.CalendarDateItem.superclass.setSelected.apply(this, arguments); + this.text.setSelected(b); + }, + + getValue: function () { + return this.text.getValue(); + } +}); +BI.shortcut("bi.calendar_date_item", BI.CalendarDateItem);/** * Created by GUY on 2015/8/28. * @class BI.Calendar * @extends BI.Widget @@ -74371,7 +74423,7 @@ BI.Calendar = BI.inherit(BI.Widget, { items: items, layouts: [{ type: "bi.center", - hgap: 10, + lgap: 10, vgap: 10 }] }); @@ -74388,15 +74440,16 @@ BI.Calendar = BI.inherit(BI.Widget, { return BI.map(item, function (j, td) { var month = td.lastMonth ? o.month - 1 : (td.nextMonth ? o.month + 1 : o.month); return BI.extend(td, { - type: "bi.text_item", - cls: "bi-list-item-select", + type: "bi.calendar_date_item", textAlign: "center", whiteSpace: "normal", once: false, forceSelected: true, height: 24, value: o.year + "-" + month + "-" + td.text, - disabled: td.lastMonth || td.nextMonth || td.disabled + disabled: td.lastMonth || td.nextMonth || td.disabled, + lgap: 10, + rgap: 0 // selected: td.currentDay }); }); @@ -74410,7 +74463,6 @@ BI.Calendar = BI.inherit(BI.Widget, { rows: 6, columnSize: [1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7], rowSize: 24, - hgap: 10, vgap: 10 }))] }); @@ -78995,7 +79047,7 @@ BI.shortcut("bi.search_text_value_combo_popup", BI.SearchTextValueComboPopup);/* BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, { props: { - baseCls: "bi-search-text-value-trigger bi-border", + baseCls: "bi-search-text-value-trigger bi-border bi-focus-shadow", height: 24 }, @@ -88040,7 +88092,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { _defaultConfig: function () { return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-select-text-trigger bi-border", + baseCls: "bi-select-text-trigger bi-border bi-focus-shadow", height: 24 }); }, @@ -89122,7 +89174,7 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, { element: this, items: [{ el: this.calendar, - left: 10, + left: 0, right: 10 }, { el: { @@ -93352,7 +93404,7 @@ BI.SearchEditor = BI.inherit(BI.Widget, { _defaultConfig: function () { var conf = BI.SearchEditor.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { - baseCls: "bi-search-editor bi-border", + baseCls: "bi-search-editor bi-border bi-focus-shadow", height: 24, errorText: "", watermark: BI.i18nText("BI-Basic_Search"), @@ -102439,7 +102491,7 @@ BI.shortcut("bi.multi_tree_searcher", BI.MultiTreeSearcher);/** BI.NumberEditor = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.NumberEditor.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-number-editor bi-border", + baseCls: "bi-number-editor bi-border bi-focus-shadow", validationChecker: function () { return true; }, diff --git a/dist/case.js b/dist/case.js index fabdcc6f9..cdd5e9c47 100644 --- a/dist/case.js +++ b/dist/case.js @@ -1599,6 +1599,58 @@ BI.TreeTextLeafItem = BI.inherit(BI.BasicButton, { }); BI.shortcut("bi.tree_text_leaf_item", BI.TreeTextLeafItem);/** + * 专门为calendar的视觉加的button,作为私有button,不能配置任何属性,也不要用这个玩意 + */ +BI.CalendarDateItem = BI.inherit(BI.BasicButton, { + + render: function () { + var self = this, o = this.options; + return { + type: "bi.absolute", + items: [{ + el: { + type: "bi.text_item", + cls: "bi-list-item-select", + textAlign: "center", + whiteSpace: "normal", + text: o.text, + value: o.value, + ref: function () { + self.text = this; + } + }, + left: o.lgap, + right: o.rgap, + top: 0, + bottom: 0 + }] + }; + }, + + doHighLight: function () { + this.text.doHighLight.apply(this.text, arguments); + }, + + unHighLight: function () { + this.text.unHighLight.apply(this.text, arguments); + }, + + setValue: function () { + if (!this.isReadOnly()) { + this.text.setValue.apply(this.text, arguments); + } + }, + + setSelected: function (b) { + BI.CalendarDateItem.superclass.setSelected.apply(this, arguments); + this.text.setSelected(b); + }, + + getValue: function () { + return this.text.getValue(); + } +}); +BI.shortcut("bi.calendar_date_item", BI.CalendarDateItem);/** * Created by GUY on 2015/8/28. * @class BI.Calendar * @extends BI.Widget @@ -1687,7 +1739,7 @@ BI.Calendar = BI.inherit(BI.Widget, { items: items, layouts: [{ type: "bi.center", - hgap: 10, + lgap: 10, vgap: 10 }] }); @@ -1704,15 +1756,16 @@ BI.Calendar = BI.inherit(BI.Widget, { return BI.map(item, function (j, td) { var month = td.lastMonth ? o.month - 1 : (td.nextMonth ? o.month + 1 : o.month); return BI.extend(td, { - type: "bi.text_item", - cls: "bi-list-item-select", + type: "bi.calendar_date_item", textAlign: "center", whiteSpace: "normal", once: false, forceSelected: true, height: 24, value: o.year + "-" + month + "-" + td.text, - disabled: td.lastMonth || td.nextMonth || td.disabled + disabled: td.lastMonth || td.nextMonth || td.disabled, + lgap: 10, + rgap: 0 // selected: td.currentDay }); }); @@ -1726,7 +1779,6 @@ BI.Calendar = BI.inherit(BI.Widget, { rows: 6, columnSize: [1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7], rowSize: 24, - hgap: 10, vgap: 10 }))] }); @@ -6311,7 +6363,7 @@ BI.shortcut("bi.search_text_value_combo_popup", BI.SearchTextValueComboPopup);/* BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, { props: { - baseCls: "bi-search-text-value-trigger bi-border", + baseCls: "bi-search-text-value-trigger bi-border bi-focus-shadow", height: 24 }, @@ -15356,7 +15408,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { _defaultConfig: function () { return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-select-text-trigger bi-border", + baseCls: "bi-select-text-trigger bi-border bi-focus-shadow", height: 24 }); }, diff --git a/dist/core.css b/dist/core.css index 06928a039..b792c3b26 100644 --- a/dist/core.css +++ b/dist/core.css @@ -312,6 +312,14 @@ textarea { .bi-theme-dark .base-disabled .b-font:before { color: #606479 !important; } +.bi-focus-shadow:focus-within, +.bi-focus-shadow:hover, +.bi-focus-shadow:focus { + border-color: #3685f2; + -webkit-box-shadow: 0 0 5px 2px #d7e7fc; + -moz-box-shadow: 0 0 5px 2px #d7e7fc; + box-shadow: 0 0 5px 2px #d7e7fc; +} .base-invalid { cursor: default !important; } diff --git a/dist/core_without_normalize.css b/dist/core_without_normalize.css index dc5cc36c5..3c4fdf98f 100644 --- a/dist/core_without_normalize.css +++ b/dist/core_without_normalize.css @@ -31,6 +31,14 @@ textarea { .bi-theme-dark .base-disabled .b-font:before { color: #606479 !important; } +.bi-focus-shadow:focus-within, +.bi-focus-shadow:hover, +.bi-focus-shadow:focus { + border-color: #3685f2; + -webkit-box-shadow: 0 0 5px 2px #d7e7fc; + -moz-box-shadow: 0 0 5px 2px #d7e7fc; + box-shadow: 0 0 5px 2px #d7e7fc; +} .base-invalid { cursor: default !important; } diff --git a/dist/demo.js b/dist/demo.js index e944c763f..df79b596e 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -2696,7 +2696,7 @@ Demo.SignEditor = BI.inherit(BI.Widget, { render: function () { var editor = BI.createWidget({ type: "bi.sign_editor", - cls: "bi-border", + cls: "bi-border bi-focus-shadow", validationChecker: function (v) { return v != "abc"; }, diff --git a/dist/fineui.css b/dist/fineui.css index aac71bd0e..64dc5734a 100644 --- a/dist/fineui.css +++ b/dist/fineui.css @@ -312,6 +312,14 @@ textarea { .bi-theme-dark .base-disabled .b-font:before { color: #606479 !important; } +.bi-focus-shadow:focus-within, +.bi-focus-shadow:hover, +.bi-focus-shadow:focus { + border-color: #3685f2; + -webkit-box-shadow: 0 0 5px 2px #d7e7fc; + -moz-box-shadow: 0 0 5px 2px #d7e7fc; + box-shadow: 0 0 5px 2px #d7e7fc; +} .base-invalid { cursor: default !important; } @@ -2274,6 +2282,12 @@ textarea { display: block !important; visibility: visible !important; } +.bi-combo.bi-combo-popup:focus, +.bi-combo.bi-combo-popup:hover { + -webkit-box-shadow: 0 0 5px 2px #d7e7fc; + -moz-box-shadow: 0 0 5px 2px #d7e7fc; + box-shadow: 0 0 5px 2px #d7e7fc; +} .bi-search-text-value-combo .trigger-icon-button { font-size: 16px; @@ -2293,6 +2307,10 @@ textarea { .bi-search-text-value-combo.combo-show .trigger-down { display: none; } +.bi-combo.bi-combo-popup .bi-search-text-value-trigger, +.bi-combo:hover .bi-search-text-value-trigger { + border-color: #3685f2; +} .bi-icon-text-value-combo.combo-error .bi-text-trigger .select-text-label { color: #ff4949; @@ -2301,6 +2319,10 @@ textarea { .bi-text-value-combo.combo-error .bi-select-text-trigger .select-text-label { color: #ff4949; } +.bi-combo.bi-combo-popup .bi-select-text-trigger, +.bi-combo:hover .bi-select-text-trigger { + border-color: #3685f2; +} /*************BI.SearchEditor******************/ .bi-search-editor { -webkit-border-radius: 2px; @@ -4231,6 +4253,10 @@ ul.ztree.zTreeDragUL { .bi-multi-select-combo.combo-show .trigger-down { display: none; } +.bi-combo.bi-combo-popup:focus .bi-multi-select-trigger, +.bi-combo.bi-combo-popup:hover .bi-multi-select-trigger { + border-color: #3685f2; +} .bi-multi-select-insert-combo .multi-select-trigger-icon-button { font-size: 16px; @@ -4545,6 +4571,10 @@ ul.ztree.zTreeDragUL { -moz-border-radius: 3px; border-radius: 3px; } +.bi-combo.bi-combo-popup:focus .bi-single-tree-trigger, +.bi-combo.bi-combo-popup:hover .bi-single-tree-trigger { + border-color: #3685f2; +} .bi-date-interval.time-error .bi-input { color: #ff4949; } diff --git a/dist/fineui.js b/dist/fineui.js index 1a86c025d..89f79267e 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -53496,14 +53496,14 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, { var icon1 = BI.createWidget({ type: "bi.icon_label", cls: o.iconCls1, - width: o.height, + width: o.leftIconWrapperWidth, height: o.height, iconWidth: o.iconWidth, iconHeight: o.iconHeight }); var blank = BI.createWidget({ type: "bi.layout", - width: o.height, + width: o.height }); BI.createWidget({ type: "bi.absolute", @@ -53512,7 +53512,7 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, { el: { type: "bi.icon_label", cls: o.iconCls2, - width: o.height, + width: o.rightIconWrapperWidth, height: o.height, iconWidth: o.iconWidth, iconHeight: o.iconHeight @@ -74504,6 +74504,58 @@ BI.TreeTextLeafItem = BI.inherit(BI.BasicButton, { }); BI.shortcut("bi.tree_text_leaf_item", BI.TreeTextLeafItem);/** + * 专门为calendar的视觉加的button,作为私有button,不能配置任何属性,也不要用这个玩意 + */ +BI.CalendarDateItem = BI.inherit(BI.BasicButton, { + + render: function () { + var self = this, o = this.options; + return { + type: "bi.absolute", + items: [{ + el: { + type: "bi.text_item", + cls: "bi-list-item-select", + textAlign: "center", + whiteSpace: "normal", + text: o.text, + value: o.value, + ref: function () { + self.text = this; + } + }, + left: o.lgap, + right: o.rgap, + top: 0, + bottom: 0 + }] + }; + }, + + doHighLight: function () { + this.text.doHighLight.apply(this.text, arguments); + }, + + unHighLight: function () { + this.text.unHighLight.apply(this.text, arguments); + }, + + setValue: function () { + if (!this.isReadOnly()) { + this.text.setValue.apply(this.text, arguments); + } + }, + + setSelected: function (b) { + BI.CalendarDateItem.superclass.setSelected.apply(this, arguments); + this.text.setSelected(b); + }, + + getValue: function () { + return this.text.getValue(); + } +}); +BI.shortcut("bi.calendar_date_item", BI.CalendarDateItem);/** * Created by GUY on 2015/8/28. * @class BI.Calendar * @extends BI.Widget @@ -74592,7 +74644,7 @@ BI.Calendar = BI.inherit(BI.Widget, { items: items, layouts: [{ type: "bi.center", - hgap: 10, + lgap: 10, vgap: 10 }] }); @@ -74609,15 +74661,16 @@ BI.Calendar = BI.inherit(BI.Widget, { return BI.map(item, function (j, td) { var month = td.lastMonth ? o.month - 1 : (td.nextMonth ? o.month + 1 : o.month); return BI.extend(td, { - type: "bi.text_item", - cls: "bi-list-item-select", + type: "bi.calendar_date_item", textAlign: "center", whiteSpace: "normal", once: false, forceSelected: true, height: 24, value: o.year + "-" + month + "-" + td.text, - disabled: td.lastMonth || td.nextMonth || td.disabled + disabled: td.lastMonth || td.nextMonth || td.disabled, + lgap: 10, + rgap: 0 // selected: td.currentDay }); }); @@ -74631,7 +74684,6 @@ BI.Calendar = BI.inherit(BI.Widget, { rows: 6, columnSize: [1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7], rowSize: 24, - hgap: 10, vgap: 10 }))] }); @@ -79216,7 +79268,7 @@ BI.shortcut("bi.search_text_value_combo_popup", BI.SearchTextValueComboPopup);/* BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, { props: { - baseCls: "bi-search-text-value-trigger bi-border", + baseCls: "bi-search-text-value-trigger bi-border bi-focus-shadow", height: 24 }, @@ -88261,7 +88313,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { _defaultConfig: function () { return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-select-text-trigger bi-border", + baseCls: "bi-select-text-trigger bi-border bi-focus-shadow", height: 24 }); }, @@ -89343,7 +89395,7 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, { element: this, items: [{ el: this.calendar, - left: 10, + left: 0, right: 10 }, { el: { @@ -93573,7 +93625,7 @@ BI.SearchEditor = BI.inherit(BI.Widget, { _defaultConfig: function () { var conf = BI.SearchEditor.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { - baseCls: "bi-search-editor bi-border", + baseCls: "bi-search-editor bi-border bi-focus-shadow", height: 24, errorText: "", watermark: BI.i18nText("BI-Basic_Search"), @@ -102660,7 +102712,7 @@ BI.shortcut("bi.multi_tree_searcher", BI.MultiTreeSearcher);/** BI.NumberEditor = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.NumberEditor.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-number-editor bi-border", + baseCls: "bi-number-editor bi-border bi-focus-shadow", validationChecker: function () { return true; }, diff --git a/dist/widget.css b/dist/widget.css index 991e684de..00d00e297 100644 --- a/dist/widget.css +++ b/dist/widget.css @@ -117,6 +117,10 @@ .bi-multi-select-combo.combo-show .trigger-down { display: none; } +.bi-combo.bi-combo-popup:focus .bi-multi-select-trigger, +.bi-combo.bi-combo-popup:hover .bi-multi-select-trigger { + border-color: #3685f2; +} .bi-multi-select-insert-combo .multi-select-trigger-icon-button { font-size: 16px; @@ -431,6 +435,10 @@ -moz-border-radius: 3px; border-radius: 3px; } +.bi-combo.bi-combo-popup:focus .bi-single-tree-trigger, +.bi-combo.bi-combo-popup:hover .bi-single-tree-trigger { + border-color: #3685f2; +} .bi-date-interval.time-error .bi-input { color: #ff4949; } diff --git a/dist/widget.js b/dist/widget.js index 80d70ecf3..d9b42c0eb 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -917,7 +917,7 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, { element: this, items: [{ el: this.calendar, - left: 10, + left: 0, right: 10 }, { el: { @@ -5147,7 +5147,7 @@ BI.SearchEditor = BI.inherit(BI.Widget, { _defaultConfig: function () { var conf = BI.SearchEditor.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { - baseCls: "bi-search-editor bi-border", + baseCls: "bi-search-editor bi-border bi-focus-shadow", height: 24, errorText: "", watermark: BI.i18nText("BI-Basic_Search"), @@ -14234,7 +14234,7 @@ BI.shortcut("bi.multi_tree_searcher", BI.MultiTreeSearcher);/** BI.NumberEditor = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.NumberEditor.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-number-editor bi-border", + baseCls: "bi-number-editor bi-border bi-focus-shadow", validationChecker: function () { return true; }, diff --git a/src/base/single/button/listitem/icontexticonitem.js b/src/base/single/button/listitem/icontexticonitem.js index 77401b8bf..429e07db2 100644 --- a/src/base/single/button/listitem/icontexticonitem.js +++ b/src/base/single/button/listitem/icontexticonitem.js @@ -44,14 +44,14 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, { var icon1 = BI.createWidget({ type: "bi.icon_label", cls: o.iconCls1, - width: o.height, + width: o.leftIconWrapperWidth, height: o.height, iconWidth: o.iconWidth, iconHeight: o.iconHeight }); var blank = BI.createWidget({ type: "bi.layout", - width: o.height, + width: o.height }); BI.createWidget({ type: "bi.absolute", @@ -60,7 +60,7 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, { el: { type: "bi.icon_label", cls: o.iconCls2, - width: o.height, + width: o.rightIconWrapperWidth, height: o.height, iconWidth: o.iconWidth, iconHeight: o.iconHeight diff --git a/src/case/calendar/calendar.date.item.js b/src/case/calendar/calendar.date.item.js new file mode 100644 index 000000000..b8ee105c6 --- /dev/null +++ b/src/case/calendar/calendar.date.item.js @@ -0,0 +1,53 @@ +/** + * 专门为calendar的视觉加的button,作为私有button,不能配置任何属性,也不要用这个玩意 + */ +BI.CalendarDateItem = BI.inherit(BI.BasicButton, { + + render: function () { + var self = this, o = this.options; + return { + type: "bi.absolute", + items: [{ + el: { + type: "bi.text_item", + cls: "bi-list-item-select", + textAlign: "center", + whiteSpace: "normal", + text: o.text, + value: o.value, + ref: function () { + self.text = this; + } + }, + left: o.lgap, + right: o.rgap, + top: 0, + bottom: 0 + }] + }; + }, + + doHighLight: function () { + this.text.doHighLight.apply(this.text, arguments); + }, + + unHighLight: function () { + this.text.unHighLight.apply(this.text, arguments); + }, + + setValue: function () { + if (!this.isReadOnly()) { + this.text.setValue.apply(this.text, arguments); + } + }, + + setSelected: function (b) { + BI.CalendarDateItem.superclass.setSelected.apply(this, arguments); + this.text.setSelected(b); + }, + + getValue: function () { + return this.text.getValue(); + } +}); +BI.shortcut("bi.calendar_date_item", BI.CalendarDateItem); \ No newline at end of file diff --git a/src/case/calendar/calendar.js b/src/case/calendar/calendar.js index 35b391b38..fd2761e13 100644 --- a/src/case/calendar/calendar.js +++ b/src/case/calendar/calendar.js @@ -87,7 +87,7 @@ BI.Calendar = BI.inherit(BI.Widget, { items: items, layouts: [{ type: "bi.center", - hgap: 10, + lgap: 10, vgap: 10 }] }); @@ -104,15 +104,16 @@ BI.Calendar = BI.inherit(BI.Widget, { return BI.map(item, function (j, td) { var month = td.lastMonth ? o.month - 1 : (td.nextMonth ? o.month + 1 : o.month); return BI.extend(td, { - type: "bi.text_item", - cls: "bi-list-item-select", + type: "bi.calendar_date_item", textAlign: "center", whiteSpace: "normal", once: false, forceSelected: true, height: 24, value: o.year + "-" + month + "-" + td.text, - disabled: td.lastMonth || td.nextMonth || td.disabled + disabled: td.lastMonth || td.nextMonth || td.disabled, + lgap: 10, + rgap: 0 // selected: td.currentDay }); }); @@ -126,7 +127,6 @@ BI.Calendar = BI.inherit(BI.Widget, { rows: 6, columnSize: [1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7], rowSize: 24, - hgap: 10, vgap: 10 }))] }); diff --git a/src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js b/src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js index 098296dd1..c0bd85d2e 100644 --- a/src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js +++ b/src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js @@ -4,7 +4,7 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, { props: { - baseCls: "bi-search-text-value-trigger bi-border", + baseCls: "bi-search-text-value-trigger bi-border bi-focus-shadow", height: 24 }, diff --git a/src/case/trigger/trigger.text.select.js b/src/case/trigger/trigger.text.select.js index a83f51003..c0d24de4f 100644 --- a/src/case/trigger/trigger.text.select.js +++ b/src/case/trigger/trigger.text.select.js @@ -9,7 +9,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { _defaultConfig: function () { return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-select-text-trigger bi-border", + baseCls: "bi-select-text-trigger bi-border bi-focus-shadow", height: 24 }); }, diff --git a/src/css/base/combo/combo.css b/src/css/base/combo/combo.css index 89b7c66fb..76fb4532b 100644 --- a/src/css/base/combo/combo.css +++ b/src/css/base/combo/combo.css @@ -89,6 +89,12 @@ display: block !important; visibility: visible !important; } +.bi-combo.bi-combo-popup:focus, +.bi-combo.bi-combo-popup:hover { + -webkit-box-shadow: 0 0 5px 2px #d7e7fc; + -moz-box-shadow: 0 0 5px 2px #d7e7fc; + box-shadow: 0 0 5px 2px #d7e7fc; +} .bi-search-text-value-combo .trigger-icon-button { font-size: 16px; @@ -108,6 +114,10 @@ .bi-search-text-value-combo.combo-show .trigger-down { display: none; } +.bi-combo.bi-combo-popup .bi-search-text-value-trigger, +.bi-combo:hover .bi-search-text-value-trigger { + border-color: #3685f2; +} .bi-icon-text-value-combo.combo-error .bi-text-trigger .select-text-label { color: #ff4949; @@ -116,3 +126,7 @@ .bi-text-value-combo.combo-error .bi-select-text-trigger .select-text-label { color: #ff4949; } +.bi-combo.bi-combo-popup .bi-select-text-trigger, +.bi-combo:hover .bi-select-text-trigger { + border-color: #3685f2; +} diff --git a/src/css/core/utils/common.css b/src/css/core/utils/common.css index fb5feab70..3d15fbcda 100644 --- a/src/css/core/utils/common.css +++ b/src/css/core/utils/common.css @@ -31,6 +31,14 @@ textarea { .bi-theme-dark .base-disabled .b-font:before { color: #606479 !important; } +.bi-focus-shadow:focus-within, +.bi-focus-shadow:hover, +.bi-focus-shadow:focus { + border-color: #3685f2; + -webkit-box-shadow: 0 0 5px 2px #d7e7fc; + -moz-box-shadow: 0 0 5px 2px #d7e7fc; + box-shadow: 0 0 5px 2px #d7e7fc; +} .base-invalid { cursor: default !important; } diff --git a/src/css/widget/multiselect/multiselect.css b/src/css/widget/multiselect/multiselect.css index 8c0b0adf2..e473c0dfa 100644 --- a/src/css/widget/multiselect/multiselect.css +++ b/src/css/widget/multiselect/multiselect.css @@ -13,6 +13,10 @@ .bi-multi-select-combo.combo-show .trigger-down { display: none; } +.bi-combo.bi-combo-popup:focus .bi-multi-select-trigger, +.bi-combo.bi-combo-popup:hover .bi-multi-select-trigger { + border-color: #3685f2; +} .bi-multi-select-insert-combo .multi-select-trigger-icon-button { font-size: 16px; diff --git a/src/css/widget/singletreecombo/singletreecombo.css b/src/css/widget/singletreecombo/singletreecombo.css index e69de29bb..120f8a220 100644 --- a/src/css/widget/singletreecombo/singletreecombo.css +++ b/src/css/widget/singletreecombo/singletreecombo.css @@ -0,0 +1,4 @@ +.bi-combo.bi-combo-popup:focus .bi-single-tree-trigger, +.bi-combo.bi-combo-popup:hover .bi-single-tree-trigger { + border-color: #3685f2; +} diff --git a/src/less/base/combo/combo.less b/src/less/base/combo/combo.less index 27d29d54f..c6503361d 100644 --- a/src/less/base/combo/combo.less +++ b/src/less/base/combo/combo.less @@ -3,8 +3,8 @@ &.bi-combo-popup { display: block !important; visibility: visible !important; - //&:focus { - // .box-shadow(0 0 5px 2px, @color-bi-blue-20); - //} + &:focus, &:hover { + .box-shadow(0 0 5px 2px, @color-bi-blue-20); + } } } diff --git a/src/less/base/combo/combo.searchtextvalue.less b/src/less/base/combo/combo.searchtextvalue.less index 8984a0060..e251ce954 100644 --- a/src/less/base/combo/combo.searchtextvalue.less +++ b/src/less/base/combo/combo.searchtextvalue.less @@ -27,12 +27,10 @@ } } -//.bi-combo { -// &.bi-combo-popup { -// &:focus { -// & .bi-search-text-value-trigger { -// border-color: @color-bi-border-highlight; -// } -// } -// } -//} \ No newline at end of file +.bi-combo { + &.bi-combo-popup, &:hover{ + & .bi-search-text-value-trigger { + border-color: @color-bi-border-highlight; + } + } +} \ No newline at end of file diff --git a/src/less/base/combo/combo.textvalue.less b/src/less/base/combo/combo.textvalue.less index 208448892..7dff6b2a2 100644 --- a/src/less/base/combo/combo.textvalue.less +++ b/src/less/base/combo/combo.textvalue.less @@ -10,12 +10,10 @@ } } -//.bi-combo { -// &.bi-combo-popup { -// &:focus { -// & .bi-select-text-trigger { -// border-color: @color-bi-border-highlight; -// } -// } -// } -//} \ No newline at end of file +.bi-combo { + &.bi-combo-popup, &:hover{ + & .bi-select-text-trigger { + border-color: @color-bi-border-highlight; + } + } +} \ No newline at end of file diff --git a/src/less/core/utils/common.less b/src/less/core/utils/common.less index 3d855e744..2619488d7 100644 --- a/src/less/core/utils/common.less +++ b/src/less/core/utils/common.less @@ -41,6 +41,13 @@ textarea { } } +.bi-focus-shadow { + &:focus-within, &:hover, &:focus { + border-color: @color-bi-border-highlight; + .box-shadow(0 0 5px 2px, @color-bi-blue-20); + } +} + .base-invalid { cursor: default !important; } diff --git a/src/less/widget/multiselect/multiselect.combo.less b/src/less/widget/multiselect/multiselect.combo.less index 5b3cd37c1..4a97ff6e5 100644 --- a/src/less/widget/multiselect/multiselect.combo.less +++ b/src/less/widget/multiselect/multiselect.combo.less @@ -21,11 +21,11 @@ } .bi-combo { - //&.bi-combo-popup { - // &:focus { - // & .bi-multi-select-trigger { - // border-color: @color-bi-border-highlight; - // } - // } - //} + &.bi-combo-popup { + &:focus, &:hover { + & .bi-multi-select-trigger { + border-color: @color-bi-border-highlight; + } + } + } } \ No newline at end of file diff --git a/src/less/widget/singletreecombo/singletreecombo.less b/src/less/widget/singletreecombo/singletreecombo.less index b8debbf94..d8c2334d7 100644 --- a/src/less/widget/singletreecombo/singletreecombo.less +++ b/src/less/widget/singletreecombo/singletreecombo.less @@ -1,11 +1,11 @@ @import "../../index"; .bi-combo { - //&.bi-combo-popup { - // &:focus { - // & .bi-single-tree-trigger { - // border-color: @color-bi-border-highlight; - // } - // } - //} + &.bi-combo-popup { + &:focus, &:hover { + & .bi-single-tree-trigger { + border-color: @color-bi-border-highlight; + } + } + } } \ No newline at end of file diff --git a/src/widget/date/calendar/popup.calendar.date.js b/src/widget/date/calendar/popup.calendar.date.js index 73fc55c26..96c53c453 100644 --- a/src/widget/date/calendar/popup.calendar.date.js +++ b/src/widget/date/calendar/popup.calendar.date.js @@ -86,7 +86,7 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, { element: this, items: [{ el: this.calendar, - left: 10, + left: 0, right: 10 }, { el: { diff --git a/src/widget/editor/editor.search.js b/src/widget/editor/editor.search.js index 473859311..7777f7246 100644 --- a/src/widget/editor/editor.search.js +++ b/src/widget/editor/editor.search.js @@ -5,7 +5,7 @@ BI.SearchEditor = BI.inherit(BI.Widget, { _defaultConfig: function () { var conf = BI.SearchEditor.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { - baseCls: "bi-search-editor bi-border", + baseCls: "bi-search-editor bi-border bi-focus-shadow", height: 24, errorText: "", watermark: BI.i18nText("BI-Basic_Search"), diff --git a/src/widget/numbereditor/number.editor.js b/src/widget/numbereditor/number.editor.js index 7f3d88095..58a8a0527 100644 --- a/src/widget/numbereditor/number.editor.js +++ b/src/widget/numbereditor/number.editor.js @@ -5,7 +5,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.NumberEditor.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-number-editor bi-border", + baseCls: "bi-number-editor bi-border bi-focus-shadow", validationChecker: function () { return true; },