diff --git a/Gruntfile.js b/Gruntfile.js index 31730ad34c..f905d60cf0 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -103,7 +103,7 @@ module.exports = function (grunt) { dest: "dist/widget.js" }, coreCss: { - src: ['src/css/core/**/*.css'], + src: ['src/css/core/**/*.css', 'src/css/theme/**/*.css'], dest: 'dist/core.css' }, baseCss: { @@ -202,7 +202,7 @@ module.exports = function (grunt) { dest: "bi/widget.js" }, bi_coreCss: { - src: ['src/css/core/**/*.css'], + src: ['src/css/core/**/*.css', 'src/css/theme/**/*.css'], dest: 'bi/core.css' }, bi_baseCss: { diff --git a/bi/base.css b/bi/base.css index d9a49fee4a..7589322336 100644 --- a/bi/base.css +++ b/bi/base.css @@ -4,17 +4,6 @@ /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ -.bi-combine-chart .bi-linkage-list { - background-color: #ffffff; - border: 1px solid #eaeaea; - z-index: 1000000000; -} -.bi-combine-chart .bi-linkage-list .bi-linkage-list-item:hover { - background-color: #f4f4f4; -} -/****添加计算宽度的--运算符直接需要space****/ -/****** common color(常用颜色,可用于普遍场景) *****/ -/**** custom color(自定义颜色,用于特定场景) ****/ .bi-color-chooser-popup .color-chooser-popup-title { background: #f4f4f4; border-bottom: 1px solid #d4dadd; @@ -949,13 +938,6 @@ li.CodeMirror-hint-active { /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ -.bi-record-editor .record-editor-text { - font-size: 12px; - background: #f4f4f4; -} -/****添加计算宽度的--运算符直接需要space****/ -/****** common color(常用颜色,可用于普遍场景) *****/ -/**** custom color(自定义颜色,用于特定场景) ****/ .bi-shelter-editor .shelter-editor-text { font-size: 12px; } @@ -1021,9 +1003,6 @@ li.CodeMirror-hint-active { border: none; color: #e85050 !important; } -.bi-input.disabled { - background-color: white; -} /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ @@ -1279,11 +1258,19 @@ li.CodeMirror-hint-active { .public-scrollbar-face:after { background-color: #c2c2c2; } +.bi-theme-dark .public-scrollbar-face:after { + background-color: #7d7d7d; +} .public-scrollbar-main:hover .public-scrollbar-face:after, .public-scrollbar-main-active .public-scrollbar-face:after, .public-scrollbar-faceActive:after { background-color: #7d7d7d; } +.bi-theme-dark .public-scrollbar-main:hover .public-scrollbar-face:after, +.bi-theme-dark .public-scrollbar-main-active .public-scrollbar-face:after, +.bi-theme-dark .public-scrollbar-faceActive:after { + background-color: #c2c2c2; +} .horizontal-scrollbar { bottom: 0; position: absolute; @@ -1437,3 +1424,7 @@ li.CodeMirror-hint-active { .bi-list-view .list-view-toolbar > .first-element { border-left: none; } +.bi-theme-dark .bi-list-view .list-view-outer { + color: #b2b2b2; + background: #191a2c; +} diff --git a/bi/case.js b/bi/case.js index ee23e1ba8b..7ce7b74c82 100644 --- a/bi/case.js +++ b/bi/case.js @@ -5225,232 +5225,6 @@ BI.ClearEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; BI.ClearEditor.EVENT_REMOVE = "EVENT_REMOVE"; BI.ClearEditor.EVENT_EMPTY = "EVENT_EMPTY"; BI.shortcut("bi.clear_editor", BI.ClearEditor);/** - * guy - * 记录内容的输入框 - * @class BI.RecordEditor - * @extends BI.Single - */ -BI.RecordEditor = BI.inherit(BI.Single, { - _defaultConfig: function () { - var conf = BI.RecordEditor.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-record-editor", - hgap: 4, - vgap: 2, - lgap: 0, - rgap: 0, - tgap: 0, - bgap: 0, - validationChecker: BI.emptyFn, - quitChecker: BI.emptyFn, - allowBlank: true, - watermark: "", - errorText: "", - height: 30 - }) - }, - - _init: function () { - BI.RecordEditor.superclass._init.apply(this, arguments); - this.contents = []; - var self = this, o = this.options; - - this.editor = BI.createWidget({ - type: "bi.editor", - height: o.height, - hgap: o.hgap, - vgap: o.vgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap, - value: o.value, - validationChecker: o.validationChecker, - quitChecker: o.quitChecker, - mouseOut: o.mouseOut, - allowBlank: o.allowBlank, - watermark: o.watermark, - errorText: o.errorText - }); - this.textContainer = BI.createWidget({ - type: "bi.vertical_adapt", - hgap: 2, - height: o.height - }); - this.editor.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - this.editor.on(BI.Editor.EVENT_FOCUS, function () { - self._checkInputState(); - self.fireEvent(BI.RecordEditor.EVENT_FOCUS, arguments); - }); - this.editor.on(BI.Editor.EVENT_BLUR, function () { - self._checkInputState(); - self.fireEvent(BI.RecordEditor.EVENT_BLUR, arguments); - }); - this.editor.on(BI.Editor.EVENT_CLICK, function () { - self.fireEvent(BI.RecordEditor.EVENT_CLICK, arguments); - }); - this.editor.on(BI.Editor.EVENT_CHANGE, function () { - self.fireEvent(BI.RecordEditor.EVENT_CHANGE, arguments); - }); - this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) { - self.fireEvent(BI.RecordEditor.EVENT_KEY_DOWN, arguments); - }); - - this.editor.on(BI.Editor.EVENT_VALID, function () { - self.fireEvent(BI.RecordEditor.EVENT_VALID, arguments); - }); - this.editor.on(BI.Editor.EVENT_SPACE, function () { - self.fireEvent(BI.RecordEditor.EVENT_SPACE, arguments); - }); - this.editor.on(BI.Editor.EVENT_CONFIRM, function () { - self.setState(self.getValue()); - self.editor.isValid() && self.editor.setValue(""); - self.fireEvent(BI.RecordEditor.EVENT_CONFIRM, arguments); - }); - this.editor.on(BI.Editor.EVENT_START, function () { - self.fireEvent(BI.RecordEditor.EVENT_START, arguments); - }); - this.editor.on(BI.Editor.EVENT_PAUSE, function () { - self.fireEvent(BI.RecordEditor.EVENT_PAUSE, arguments); - }); - this.editor.on(BI.Editor.EVENT_STOP, function () { - self.fireEvent(BI.RecordEditor.EVENT_STOP, arguments); - }); - this.editor.on(BI.Editor.EVENT_ENTER, function () { - self.fireEvent(BI.RecordEditor.EVENT_ENTER, arguments); - }); - this.editor.on(BI.Editor.EVENT_BACKSPACE, function () { - self._checkInputState(); - }); - this.editor.on(BI.Editor.EVENT_REMOVE, function () { - if (!BI.isEmpty(self.contents)) { - self.contents.pop().destroy(); - self.setValue(self.getValue()); - self._adjustInputWidth(); - } - }); - this.editor.on(BI.Editor.EVENT_ERROR, function () { - self.fireEvent(BI.RecordEditor.EVENT_ERROR, arguments); - }); - this.editor.on(BI.Editor.EVENT_RESTRICT, function () { - self.fireEvent(BI.RecordEditor.EVENT_RESTRICT, arguments); - }); - this.editor.on(BI.Editor.EVENT_EMPTY, function () { - self.fireEvent(BI.RecordEditor.EVENT_EMPTY, arguments); - }); - BI.createWidget({ - type: "bi.inline", - element: this, - items: [this.textContainer, this.editor] - }); - BI.ResizeDetector.addResizeListener(this, BI.bind(this._adjustInputWidth, this)); - this._adjustInputWidth(); - }, - - _adjustInputWidth: function () { - BI.nextTick(BI.bind(function () { - this.editor.element.css("width", this.element.width() - this.textContainer.element.outerWidth() - 10); - }, this)); - }, - - _checkInputState: function () { - if (BI.isEmpty(this.contents)) { - this.editor.enableWarterMark(); - } else { - this.editor.disableWarterMark(); - } - }, - - focus: function () { - this.editor.focus(); - }, - - blur: function () { - this.editor.blur(); - }, - - isValid: function () { - return this.editor.isValid(); - }, - - setErrorText: function (text) { - this.editor.setErrorText(text); - }, - - getErrorText: function () { - return this.editor.getErrorText(); - }, - - isEditing: function () { - return this.editor.isEditing(); - }, - - getLastValidValue: function () { - return this.editor.getLastValidValue(); - }, - - setValue: function (k) { - this.editor.setValue(k); - }, - - getValue: function () { - return this.editor.getValue(); - }, - - getState: function () { - var values = BI.map(this.contents, function (i, lb) { - return lb.getText(); - }); - if (BI.isNotEmptyString(this.editor.getValue())) { - return values.concat([this.editor.getValue()]); - } - return values; - }, - - setState: function (v) { - BI.RecordEditor.superclass.setValue.apply(this, arguments); - v = BI.isArray(v) ? v : (v == "" ? [] : [v]); - var contents = this.contents = []; - BI.each(v, function (i, lb) { - contents.push(BI.createWidget({ - type: "bi.label", - height: 25, - cls: "record-editor-text", - text: lb - })) - }); - this.textContainer.empty(); - this.textContainer.populate(contents); - this.editor.isValid() && this.editor.setValue(""); - this._checkInputState(); - this._adjustInputWidth(); - }, - - destroy: function () { - BI.Resizers.remove(this.getName()); - BI.RecordEditor.superclass.destroy.apply(this, arguments); - } -}); -BI.RecordEditor.EVENT_CHANGE = "EVENT_CHANGE"; -BI.RecordEditor.EVENT_FOCUS = "EVENT_FOCUS"; -BI.RecordEditor.EVENT_BLUR = "EVENT_BLUR"; -BI.RecordEditor.EVENT_CLICK = "EVENT_CLICK"; -BI.RecordEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; - -BI.RecordEditor.EVENT_START = "EVENT_START"; -BI.RecordEditor.EVENT_PAUSE = "EVENT_PAUSE"; -BI.RecordEditor.EVENT_STOP = "EVENT_STOP"; -BI.RecordEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; -BI.RecordEditor.EVENT_VALID = "EVENT_VALID"; -BI.RecordEditor.EVENT_ERROR = "EVENT_ERROR"; -BI.RecordEditor.EVENT_ENTER = "EVENT_ENTER"; -BI.RecordEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; -BI.RecordEditor.EVENT_SPACE = "EVENT_SPACE"; -BI.RecordEditor.EVENT_EMPTY = "EVENT_EMPTY"; - -BI.shortcut("bi.record_editor", BI.RecordEditor);/** * Created by roy on 15/9/14. */ BI.SearchEditor = BI.inherit(BI.Widget, { diff --git a/bi/core.css b/bi/core.css index c94ea5fe62..42772d827c 100644 --- a/bi/core.css +++ b/bi/core.css @@ -2958,6 +2958,16 @@ .bi-list-item.disabled:active { background-color: #ffffff; } +.bi-theme-dark .bi-list-item:hover, +.bi-theme-dark .bi-list-item.hover { + background-color: #04070d; + 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; +} .bi-list-item-effect.active, .bi-list-item-effect:active { color: #009de3; @@ -2965,7 +2975,16 @@ .bi-list-item-effect.disabled, .bi-list-item-effect.disabled:hover, .bi-list-item-effect.disabled:active { - color: #1a1a1a; + color: #c4c6c6; +} +.bi-theme-dark .bi-list-item-effect.active, +.bi-theme-dark .bi-list-item-effect:active { + color: #009de3; +} +.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 { + color: #c4c6c6; } .bi-list-item-hover:hover, .bi-list-item-hover.hover { @@ -2975,9 +2994,20 @@ .bi-list-item-hover.disabled, .bi-list-item-hover.disabled:hover, .bi-list-item-hover.disabled:active { - color: #1a1a1a; + color: #c4c6c6; background-color: #ffffff; } +.bi-theme-dark .bi-list-item-hover:hover, +.bi-theme-dark .bi-list-item-hover.hover { + color: #009de3; + background-color: #04070d; +} +.bi-theme-dark .bi-list-item-hover.disabled, +.bi-theme-dark .bi-list-item-hover.disabled:hover, +.bi-theme-dark .bi-list-item-hover.disabled:active { + color: #c4c6c6; + background-color: transparent; +} .bi-list-item-active:hover, .bi-list-item-active.hover { background-color: #f4f4f4; @@ -2992,6 +3022,21 @@ .bi-list-item-active.disabled:active { background-color: #ffffff; } +.bi-theme-dark .bi-list-item-active:hover, +.bi-theme-dark .bi-list-item-active.hover { + background-color: #04070d; + color: #ffffff; +} +.bi-theme-dark .bi-list-item-active.active, +.bi-theme-dark .bi-list-item-active:active { + color: #009de3; + background-color: #04070d; +} +.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; +} .bi-list-item-select:hover, .bi-list-item-select.hover { color: #009de3; @@ -3017,6 +3062,31 @@ .bi-list-item-select.disabled:active .bi-high-light { color: #c4c6c6 !important; } +.bi-theme-dark .list-item-select:hover, +.bi-theme-dark .list-item-select.hover { + color: #009de3; + background-color: #04070d; +} +.bi-theme-dark .list-item-select:active, +.bi-theme-dark .list-item-select.active { + color: #ffffff; + background-color: #009de3; +} +.bi-theme-dark .list-item-select:active .bi-high-light, +.bi-theme-dark .list-item-select.active .bi-high-light { + color: #ffffff; +} +.bi-theme-dark .list-item-select.disabled, +.bi-theme-dark .list-item-select.disabled:hover, +.bi-theme-dark .list-item-select.disabled:active { + color: #c4c6c6 !important; + background-color: transparent !important; +} +.bi-theme-dark .list-item-select.disabled .bi-high-light, +.bi-theme-dark .list-item-select.disabled:hover .bi-high-light, +.bi-theme-dark .list-item-select.disabled:active .bi-high-light { + color: #c4c6c6 !important; +} /*****************cursor*****************/ .cursor-pointer { cursor: pointer; @@ -3447,3 +3517,19 @@ vertical-align: middle; content: ' '; } +/****添加计算宽度的--运算符直接需要space****/ +/****** common color(常用颜色,可用于普遍场景) *****/ +/**** custom color(自定义颜色,用于特定场景) ****/ +.bi-theme-dark { + background-color: #191a2c; + color: #b2b2b2; +} +.bi-theme-dark .bi-input { + color: #ffffff; +} +/****添加计算宽度的--运算符直接需要space****/ +/****** common color(常用颜色,可用于普遍场景) *****/ +/**** custom color(自定义颜色,用于特定场景) ****/ +/****添加计算宽度的--运算符直接需要space****/ +/****** common color(常用颜色,可用于普遍场景) *****/ +/**** custom color(自定义颜色,用于特定场景) ****/ diff --git a/bi/core.js b/bi/core.js index a176df9ba3..d9b383c5d4 100644 --- a/bi/core.js +++ b/bi/core.js @@ -15830,7 +15830,8 @@ BI.LayerController = BI.inherit(BI.Controller, { return this.get(name); } var widget = BI.createWidget((op.render || {}), { - type: "bi.layout" + type: "bi.layout", + cls: op.cls }); var layout = BI.createWidget({ type: "bi.absolute", @@ -17046,6 +17047,14 @@ $(function () { return false; }, + //获取对比颜色 + getContrastColor: function (color) { + if (this.isDarkColor(color)) { + return "#ffffff"; + } + return "#1a1a1a"; + }, + rgb2hex: function (rgbColour) { if (!rgbColour || rgbColour.substr(0, 3) != "rgb") { return ""; diff --git a/bi/widget.css b/bi/widget.css index 8b7bfd0aa9..0d9edf19be 100644 --- a/bi/widget.css +++ b/bi/widget.css @@ -139,35 +139,12 @@ /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ -.bi-down-list-combo .down-list-group.bi-combo-hover .bi-down-list-group-item, -.bi-down-list-combo .down-list-group.bi-combo-hover .bi-down-list-group-item .b-font:before { - background-color: #f4f4f4; -} -.bi-down-list-combo .down-list-group.bi-combo-hover .bi-down-list-group-item:disabled, -.bi-down-list-combo .down-list-group.bi-combo-hover .bi-down-list-group-item.disabled, -.bi-down-list-combo .down-list-group.bi-combo-hover .bi-down-list-group-item:disabled .b-font:before, -.bi-down-list-combo .down-list-group.bi-combo-hover .bi-down-list-group-item.disabled .b-font:before { - background-color: #ffffff; -} .bi-down-list-combo .bi-down-list-spliter { border-top: 1px solid #eaeaea; } /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ -.bi-down-list-popup .bi-down-list-item:hover, -.bi-down-list-popup .bi-down-list-item.hover { - background-color: #f4f4f4; -} -.bi-down-list-popup .bi-down-list-item.disabled, -.bi-down-list-popup .bi-down-list-item.disabled:hover, -.bi-down-list-popup .bi-down-list-item.disabled:active { - background-color: #ffffff; -} -.bi-down-list-popup .bi-down-list-item:active { - color: #009de3; - background-color: #f4f4f4; -} .bi-down-list-popup .bi-down-list-item .list-item-text { max-width: 203px; } @@ -359,6 +336,9 @@ background-color: #ffffff; z-index: 1; } +.bi-theme-dark .bi-multi-select-check-selected-button { + background-color: #191a2c; +} /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ diff --git a/bi/widget.js b/bi/widget.js index 41393c75ad..99ffd64b57 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -5670,7 +5670,7 @@ BI.shortcut("bi.down_list_group", BI.DownListGroup);BI.DownListItem = BI.inherit _defaultConfig: function () { var conf = BI.DownListItem.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { - baseCls: "bi-down-list-item", + baseCls: "bi-down-list-item bi-list-item-active", cls: "", height: 25, logic: { diff --git a/demo.html b/demo.html index 53decbadcf..6908f599d5 100644 --- a/demo.html +++ b/demo.html @@ -22,7 +22,7 @@
- +