diff --git a/bi/base.js b/bi/base.js index 16c2d1714..e0f5a101f 100644 --- a/bi/base.js +++ b/bi/base.js @@ -17715,7 +17715,8 @@ BI.CodeEditor = BI.inherit(BI.Single, { baseCls: 'bi-code-editor bi-card', value: '', watermark: "", - lineHeight: 2 + lineHeight: 2, + readOnly: false }); }, _init: function () { @@ -17724,7 +17725,8 @@ BI.CodeEditor = BI.inherit(BI.Single, { this.editor = CodeMirror(this.element[0], { textWrapping: true, lineWrapping: true, - lineNumbers: false + lineNumbers: false, + readOnly: o.readOnly }); o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height"); this.editor.on("change", function (cm, change) { diff --git a/bi/core.css b/bi/core.css index c4a24a3ec..5bf17a0d2 100644 --- a/bi/core.css +++ b/bi/core.css @@ -3484,6 +3484,82 @@ i { .bi-theme-dark .bi-list-item-select.disabled:active .bi-high-light { color: #666666 !important; } +.bi-list-item-none:hover, +.bi-list-item-none.hover { + color: inherit; + background-color: inherit; +} +.bi-list-item-none:hover .bi-input, +.bi-list-item-none.hover .bi-input { + color: inherit; +} +.bi-list-item-none:active, +.bi-list-item-none.active { + color: inherit; + background-color: inherit; +} +.bi-list-item-none:active .bi-input, +.bi-list-item-none.active .bi-input { + color: inherit; +} +.bi-list-item-none:active .bi-high-light, +.bi-list-item-none.active .bi-high-light { + color: inherit; +} +.bi-list-item-none.disabled, +.bi-list-item-none.disabled:hover, +.bi-list-item-none.disabled:active { + color: #cccccc !important; + background-color: transparent !important; +} +.bi-list-item-none.disabled .bi-input, +.bi-list-item-none.disabled:hover .bi-input, +.bi-list-item-none.disabled:active .bi-input { + color: #cccccc !important; +} +.bi-list-item-none.disabled .bi-high-light, +.bi-list-item-none.disabled:hover .bi-high-light, +.bi-list-item-none.disabled:active .bi-high-light { + color: #cccccc !important; +} +.bi-theme-dark .bi-list-item-none:hover, +.bi-theme-dark .bi-list-item-none.hover { + color: inherit; + background-color: inherit; +} +.bi-theme-dark .bi-list-item-none:hover .bi-input, +.bi-theme-dark .bi-list-item-none.hover .bi-input { + color: inherit; +} +.bi-theme-dark .bi-list-item-none:active, +.bi-theme-dark .bi-list-item-none.active { + color: inherit; + background-color: inherit; +} +.bi-theme-dark .bi-list-item-none:active .bi-input, +.bi-theme-dark .bi-list-item-none.active .bi-input { + color: inherit; +} +.bi-theme-dark .bi-list-item-none:active .bi-high-light, +.bi-theme-dark .bi-list-item-none.active .bi-high-light { + color: inherit; +} +.bi-theme-dark .bi-list-item-none.disabled, +.bi-theme-dark .bi-list-item-none.disabled:hover, +.bi-theme-dark .bi-list-item-none.disabled:active { + background-color: transparent !important; + color: #666666 !important; +} +.bi-theme-dark .bi-list-item-none.disabled .bi-input, +.bi-theme-dark .bi-list-item-none.disabled:hover .bi-input, +.bi-theme-dark .bi-list-item-none.disabled:active .bi-input { + color: #666666 !important; +} +.bi-theme-dark .bi-list-item-none.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-none.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-none.disabled:active .bi-high-light { + color: #666666 !important; +} /*****************cursor*****************/ .cursor-pointer { cursor: pointer; diff --git a/bi/widget.js b/bi/widget.js index 638fea28d..5e6df6377 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -2998,13 +2998,17 @@ BI.Arrangement = BI.inherit(BI.Widget, { _getOneWidthPortion: function () { return this.getClientWidth() / BI.Arrangement.PORTION; }, + _getOneHeightPortion: function () { + return this.getClientHeight() / BI.Arrangement.H_PORTION; + }, _getGridPositionAndSize: function (position) { var perWidth = this._getOneWidthPortion(); + var perHeight = this._getOneHeightPortion(); var widthPortion = Math.round(position.width / perWidth); var leftPortion = Math.round(position.left / perWidth); - var topPortion = Math.round(position.top / BI.Arrangement.GRID_HEIGHT); - var heightPortion = Math.round(position.height / BI.Arrangement.GRID_HEIGHT); + var topPortion = Math.round(position.top / perHeight); + var heightPortion = Math.round(position.height / perHeight); // if (leftPortion > BI.Arrangement.PORTION) { // leftPortion = BI.Arrangement.PORTION; // } @@ -3030,11 +3034,12 @@ BI.Arrangement = BI.inherit(BI.Widget, { _getBlockPositionAndSize: function (position) { var perWidth = this._getOneWidthPortion(); + var perHeight = this._getOneHeightPortion(); return { left: position.x * perWidth, - top: position.y * BI.Arrangement.GRID_HEIGHT, + top: position.y * perHeight, width: position.w * perWidth, - height: position.h * BI.Arrangement.GRID_HEIGHT + height: position.h * perHeight }; }, @@ -3721,12 +3726,15 @@ BI.Arrangement = BI.inherit(BI.Widget, { break; case BI.Arrangement.LAYOUT_TYPE.GRID: if (this._isArrangeFine()) { - var width = this.getClientWidth(); + var width = this.getClientWidth(), height = this.getClientHeight(); var xRatio = (ratio.x || 1) * width / (occupied.left + occupied.width); + var yRatio = (ratio.y || 1) * height / (occupied.top + occupied.height); var regions = this._cloneRegion(); BI.each(regions, function (i, region) { region.left = region.left * xRatio; region.width = region.width * xRatio; + region.top = region.top * yRatio; + region.height = region.height * yRatio; }); if (this._test(regions)) { var layout = this._getLayoutsByRegions(regions); @@ -3861,6 +3869,7 @@ BI.Arrangement = BI.inherit(BI.Widget, { case BI.Arrangement.LAYOUT_TYPE.FREE: break; case BI.Arrangement.LAYOUT_TYPE.GRID: + var perHeight = this._getOneHeightPortion(); var width = this.getClientWidth(), height = this.getClientHeight(); var regions = this._cloneRegion(); var clone = BI.toArray(regions); @@ -3877,10 +3886,10 @@ BI.Arrangement = BI.inherit(BI.Widget, { BI.each(clone, function (i, region) { var row = Math.floor(i / 3), col = i % 3; BI.extend(region, { - top: row * 380, + top: row * perHeight * 6, left: col * w, width: w, - height: 380 + height: perHeight * 6 }); if (!store[row]) { store[row] = {}; @@ -3930,8 +3939,8 @@ BI.Arrangement = BI.inherit(BI.Widget, { }); BI.Arrangement.EVENT_SCROLL = "EVENT_SCROLL"; BI.extend(BI.Arrangement, { - PORTION: 24, - GRID_HEIGHT: 60, + PORTION: 32, + H_PORTION: 18, LAYOUT_TYPE: { ADAPTIVE: 0, FREE: 1, @@ -8302,6 +8311,7 @@ BI.MultiLayerSelectTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.node = BI.createWidget({ type: "bi.select_tree_first_plus_group_node", + cls: "bi-list-item-none", stopPropagation: true, logic: { dynamic: true @@ -8395,6 +8405,7 @@ BI.MultiLayerSelectTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.node = BI.createWidget({ type: "bi.select_tree_last_plus_group_node", + cls: "bi-list-item-none", stopPropagation: true, logic: { dynamic: true @@ -8484,6 +8495,7 @@ BI.MultiLayerSelectTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.node = BI.createWidget({ type: "bi.select_tree_mid_plus_group_node", + cls: "bi-list-item-none", stopPropagation: true, logic: { dynamic: true @@ -8843,6 +8855,7 @@ BI.MultiLayerSingleTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.node = BI.createWidget({ type: "bi.first_plus_group_node", + cls: "bi-list-item-none", logic: { dynamic: true }, @@ -8925,6 +8938,7 @@ BI.MultiLayerSingleTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.node = BI.createWidget({ type: "bi.last_plus_group_node", + cls: "bi-list-item-none", logic: { dynamic: true }, @@ -9007,6 +9021,7 @@ BI.MultiLayerSingleTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.node = BI.createWidget({ type: "bi.mid_plus_group_node", + cls: "bi-list-item-none", logic: { dynamic: true }, @@ -9089,6 +9104,7 @@ BI.MultiLayerSingleTreeFirstTreeLeafItem = BI.inherit(BI.BasicButton, { var self = this, o = this.options; this.item = BI.createWidget({ type: "bi.first_tree_leaf_item", + cls: "bi-list-item-none", logic: { dynamic: true }, @@ -9184,6 +9200,7 @@ BI.MultiLayerSingleTreeLastTreeLeafItem = BI.inherit(BI.BasicButton, { var self = this, o = this.options; this.item = BI.createWidget({ type: "bi.last_tree_leaf_item", + cls: "bi-list-item-none", logic: { dynamic: true }, @@ -9279,6 +9296,7 @@ BI.MultiLayerSingleTreeMidTreeLeafItem = BI.inherit(BI.BasicButton, { var self = this, o = this.options; this.item = BI.createWidget({ type: "bi.mid_tree_leaf_item", + cls: "bi-list-item-none", logic: { dynamic: true }, @@ -15018,7 +15036,8 @@ BI.ResponisveTable = BI.inherit(BI.Widget, { } }); //因为有边框,所以加上数组长度的参数调整 - var sumLeft = BI.sum(columnSizeLeft) + columnSizeLeft.length, sumRight = BI.sum(columnSizeRight) + columnSizeRight.length; + var sumLeft = BI.sum(columnSizeLeft) + columnSizeLeft.length, + sumRight = BI.sum(columnSizeRight) + columnSizeRight.length; return { sumLeft: sumLeft, sumRight: sumRight, @@ -15222,11 +15241,9 @@ BI.ResponisveTable = BI.inherit(BI.Widget, { this.table.populate.apply(this.table, arguments); if (o.isNeedFreeze === true) { BI.nextTick(function () { - if (self.element.is(":visible")) { - self._initRegionSize(); - self.table.resize(); - self._resizeHeader(); - } + self._initRegionSize(); + self.table.resize(); + self._resizeHeader(); }); } } diff --git a/docs/base.js b/docs/base.js index 16c2d1714..e0f5a101f 100644 --- a/docs/base.js +++ b/docs/base.js @@ -17715,7 +17715,8 @@ BI.CodeEditor = BI.inherit(BI.Single, { baseCls: 'bi-code-editor bi-card', value: '', watermark: "", - lineHeight: 2 + lineHeight: 2, + readOnly: false }); }, _init: function () { @@ -17724,7 +17725,8 @@ BI.CodeEditor = BI.inherit(BI.Single, { this.editor = CodeMirror(this.element[0], { textWrapping: true, lineWrapping: true, - lineNumbers: false + lineNumbers: false, + readOnly: o.readOnly }); o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height"); this.editor.on("change", function (cm, change) { diff --git a/docs/core.css b/docs/core.css index c4a24a3ec..5bf17a0d2 100644 --- a/docs/core.css +++ b/docs/core.css @@ -3484,6 +3484,82 @@ i { .bi-theme-dark .bi-list-item-select.disabled:active .bi-high-light { color: #666666 !important; } +.bi-list-item-none:hover, +.bi-list-item-none.hover { + color: inherit; + background-color: inherit; +} +.bi-list-item-none:hover .bi-input, +.bi-list-item-none.hover .bi-input { + color: inherit; +} +.bi-list-item-none:active, +.bi-list-item-none.active { + color: inherit; + background-color: inherit; +} +.bi-list-item-none:active .bi-input, +.bi-list-item-none.active .bi-input { + color: inherit; +} +.bi-list-item-none:active .bi-high-light, +.bi-list-item-none.active .bi-high-light { + color: inherit; +} +.bi-list-item-none.disabled, +.bi-list-item-none.disabled:hover, +.bi-list-item-none.disabled:active { + color: #cccccc !important; + background-color: transparent !important; +} +.bi-list-item-none.disabled .bi-input, +.bi-list-item-none.disabled:hover .bi-input, +.bi-list-item-none.disabled:active .bi-input { + color: #cccccc !important; +} +.bi-list-item-none.disabled .bi-high-light, +.bi-list-item-none.disabled:hover .bi-high-light, +.bi-list-item-none.disabled:active .bi-high-light { + color: #cccccc !important; +} +.bi-theme-dark .bi-list-item-none:hover, +.bi-theme-dark .bi-list-item-none.hover { + color: inherit; + background-color: inherit; +} +.bi-theme-dark .bi-list-item-none:hover .bi-input, +.bi-theme-dark .bi-list-item-none.hover .bi-input { + color: inherit; +} +.bi-theme-dark .bi-list-item-none:active, +.bi-theme-dark .bi-list-item-none.active { + color: inherit; + background-color: inherit; +} +.bi-theme-dark .bi-list-item-none:active .bi-input, +.bi-theme-dark .bi-list-item-none.active .bi-input { + color: inherit; +} +.bi-theme-dark .bi-list-item-none:active .bi-high-light, +.bi-theme-dark .bi-list-item-none.active .bi-high-light { + color: inherit; +} +.bi-theme-dark .bi-list-item-none.disabled, +.bi-theme-dark .bi-list-item-none.disabled:hover, +.bi-theme-dark .bi-list-item-none.disabled:active { + background-color: transparent !important; + color: #666666 !important; +} +.bi-theme-dark .bi-list-item-none.disabled .bi-input, +.bi-theme-dark .bi-list-item-none.disabled:hover .bi-input, +.bi-theme-dark .bi-list-item-none.disabled:active .bi-input { + color: #666666 !important; +} +.bi-theme-dark .bi-list-item-none.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-none.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-none.disabled:active .bi-high-light { + color: #666666 !important; +} /*****************cursor*****************/ .cursor-pointer { cursor: pointer; diff --git a/docs/widget.js b/docs/widget.js index 638fea28d..5e6df6377 100644 --- a/docs/widget.js +++ b/docs/widget.js @@ -2998,13 +2998,17 @@ BI.Arrangement = BI.inherit(BI.Widget, { _getOneWidthPortion: function () { return this.getClientWidth() / BI.Arrangement.PORTION; }, + _getOneHeightPortion: function () { + return this.getClientHeight() / BI.Arrangement.H_PORTION; + }, _getGridPositionAndSize: function (position) { var perWidth = this._getOneWidthPortion(); + var perHeight = this._getOneHeightPortion(); var widthPortion = Math.round(position.width / perWidth); var leftPortion = Math.round(position.left / perWidth); - var topPortion = Math.round(position.top / BI.Arrangement.GRID_HEIGHT); - var heightPortion = Math.round(position.height / BI.Arrangement.GRID_HEIGHT); + var topPortion = Math.round(position.top / perHeight); + var heightPortion = Math.round(position.height / perHeight); // if (leftPortion > BI.Arrangement.PORTION) { // leftPortion = BI.Arrangement.PORTION; // } @@ -3030,11 +3034,12 @@ BI.Arrangement = BI.inherit(BI.Widget, { _getBlockPositionAndSize: function (position) { var perWidth = this._getOneWidthPortion(); + var perHeight = this._getOneHeightPortion(); return { left: position.x * perWidth, - top: position.y * BI.Arrangement.GRID_HEIGHT, + top: position.y * perHeight, width: position.w * perWidth, - height: position.h * BI.Arrangement.GRID_HEIGHT + height: position.h * perHeight }; }, @@ -3721,12 +3726,15 @@ BI.Arrangement = BI.inherit(BI.Widget, { break; case BI.Arrangement.LAYOUT_TYPE.GRID: if (this._isArrangeFine()) { - var width = this.getClientWidth(); + var width = this.getClientWidth(), height = this.getClientHeight(); var xRatio = (ratio.x || 1) * width / (occupied.left + occupied.width); + var yRatio = (ratio.y || 1) * height / (occupied.top + occupied.height); var regions = this._cloneRegion(); BI.each(regions, function (i, region) { region.left = region.left * xRatio; region.width = region.width * xRatio; + region.top = region.top * yRatio; + region.height = region.height * yRatio; }); if (this._test(regions)) { var layout = this._getLayoutsByRegions(regions); @@ -3861,6 +3869,7 @@ BI.Arrangement = BI.inherit(BI.Widget, { case BI.Arrangement.LAYOUT_TYPE.FREE: break; case BI.Arrangement.LAYOUT_TYPE.GRID: + var perHeight = this._getOneHeightPortion(); var width = this.getClientWidth(), height = this.getClientHeight(); var regions = this._cloneRegion(); var clone = BI.toArray(regions); @@ -3877,10 +3886,10 @@ BI.Arrangement = BI.inherit(BI.Widget, { BI.each(clone, function (i, region) { var row = Math.floor(i / 3), col = i % 3; BI.extend(region, { - top: row * 380, + top: row * perHeight * 6, left: col * w, width: w, - height: 380 + height: perHeight * 6 }); if (!store[row]) { store[row] = {}; @@ -3930,8 +3939,8 @@ BI.Arrangement = BI.inherit(BI.Widget, { }); BI.Arrangement.EVENT_SCROLL = "EVENT_SCROLL"; BI.extend(BI.Arrangement, { - PORTION: 24, - GRID_HEIGHT: 60, + PORTION: 32, + H_PORTION: 18, LAYOUT_TYPE: { ADAPTIVE: 0, FREE: 1, @@ -8302,6 +8311,7 @@ BI.MultiLayerSelectTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.node = BI.createWidget({ type: "bi.select_tree_first_plus_group_node", + cls: "bi-list-item-none", stopPropagation: true, logic: { dynamic: true @@ -8395,6 +8405,7 @@ BI.MultiLayerSelectTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.node = BI.createWidget({ type: "bi.select_tree_last_plus_group_node", + cls: "bi-list-item-none", stopPropagation: true, logic: { dynamic: true @@ -8484,6 +8495,7 @@ BI.MultiLayerSelectTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.node = BI.createWidget({ type: "bi.select_tree_mid_plus_group_node", + cls: "bi-list-item-none", stopPropagation: true, logic: { dynamic: true @@ -8843,6 +8855,7 @@ BI.MultiLayerSingleTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.node = BI.createWidget({ type: "bi.first_plus_group_node", + cls: "bi-list-item-none", logic: { dynamic: true }, @@ -8925,6 +8938,7 @@ BI.MultiLayerSingleTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.node = BI.createWidget({ type: "bi.last_plus_group_node", + cls: "bi-list-item-none", logic: { dynamic: true }, @@ -9007,6 +9021,7 @@ BI.MultiLayerSingleTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.node = BI.createWidget({ type: "bi.mid_plus_group_node", + cls: "bi-list-item-none", logic: { dynamic: true }, @@ -9089,6 +9104,7 @@ BI.MultiLayerSingleTreeFirstTreeLeafItem = BI.inherit(BI.BasicButton, { var self = this, o = this.options; this.item = BI.createWidget({ type: "bi.first_tree_leaf_item", + cls: "bi-list-item-none", logic: { dynamic: true }, @@ -9184,6 +9200,7 @@ BI.MultiLayerSingleTreeLastTreeLeafItem = BI.inherit(BI.BasicButton, { var self = this, o = this.options; this.item = BI.createWidget({ type: "bi.last_tree_leaf_item", + cls: "bi-list-item-none", logic: { dynamic: true }, @@ -9279,6 +9296,7 @@ BI.MultiLayerSingleTreeMidTreeLeafItem = BI.inherit(BI.BasicButton, { var self = this, o = this.options; this.item = BI.createWidget({ type: "bi.mid_tree_leaf_item", + cls: "bi-list-item-none", logic: { dynamic: true }, @@ -15018,7 +15036,8 @@ BI.ResponisveTable = BI.inherit(BI.Widget, { } }); //因为有边框,所以加上数组长度的参数调整 - var sumLeft = BI.sum(columnSizeLeft) + columnSizeLeft.length, sumRight = BI.sum(columnSizeRight) + columnSizeRight.length; + var sumLeft = BI.sum(columnSizeLeft) + columnSizeLeft.length, + sumRight = BI.sum(columnSizeRight) + columnSizeRight.length; return { sumLeft: sumLeft, sumRight: sumRight, @@ -15222,11 +15241,9 @@ BI.ResponisveTable = BI.inherit(BI.Widget, { this.table.populate.apply(this.table, arguments); if (o.isNeedFreeze === true) { BI.nextTick(function () { - if (self.element.is(":visible")) { - self._initRegionSize(); - self.table.resize(); - self._resizeHeader(); - } + self._initRegionSize(); + self.table.resize(); + self._resizeHeader(); }); } } diff --git a/src/base/single/editor/editor.code.js b/src/base/single/editor/editor.code.js index f97564f62..b82b0d29e 100644 --- a/src/base/single/editor/editor.code.js +++ b/src/base/single/editor/editor.code.js @@ -10,7 +10,8 @@ BI.CodeEditor = BI.inherit(BI.Single, { baseCls: 'bi-code-editor bi-card', value: '', watermark: "", - lineHeight: 2 + lineHeight: 2, + readOnly: false }); }, _init: function () { @@ -19,7 +20,8 @@ BI.CodeEditor = BI.inherit(BI.Single, { this.editor = CodeMirror(this.element[0], { textWrapping: true, lineWrapping: true, - lineNumbers: false + lineNumbers: false, + readOnly: o.readOnly }); o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height"); this.editor.on("change", function (cm, change) { diff --git a/src/css/core/utils/common.css b/src/css/core/utils/common.css index c94dd5a88..0d10234d9 100644 --- a/src/css/core/utils/common.css +++ b/src/css/core/utils/common.css @@ -538,3 +538,79 @@ .bi-theme-dark .bi-list-item-select.disabled:active .bi-high-light { color: #666666 !important; } +.bi-list-item-none:hover, +.bi-list-item-none.hover { + color: inherit; + background-color: inherit; +} +.bi-list-item-none:hover .bi-input, +.bi-list-item-none.hover .bi-input { + color: inherit; +} +.bi-list-item-none:active, +.bi-list-item-none.active { + color: inherit; + background-color: inherit; +} +.bi-list-item-none:active .bi-input, +.bi-list-item-none.active .bi-input { + color: inherit; +} +.bi-list-item-none:active .bi-high-light, +.bi-list-item-none.active .bi-high-light { + color: inherit; +} +.bi-list-item-none.disabled, +.bi-list-item-none.disabled:hover, +.bi-list-item-none.disabled:active { + color: #cccccc !important; + background-color: transparent !important; +} +.bi-list-item-none.disabled .bi-input, +.bi-list-item-none.disabled:hover .bi-input, +.bi-list-item-none.disabled:active .bi-input { + color: #cccccc !important; +} +.bi-list-item-none.disabled .bi-high-light, +.bi-list-item-none.disabled:hover .bi-high-light, +.bi-list-item-none.disabled:active .bi-high-light { + color: #cccccc !important; +} +.bi-theme-dark .bi-list-item-none:hover, +.bi-theme-dark .bi-list-item-none.hover { + color: inherit; + background-color: inherit; +} +.bi-theme-dark .bi-list-item-none:hover .bi-input, +.bi-theme-dark .bi-list-item-none.hover .bi-input { + color: inherit; +} +.bi-theme-dark .bi-list-item-none:active, +.bi-theme-dark .bi-list-item-none.active { + color: inherit; + background-color: inherit; +} +.bi-theme-dark .bi-list-item-none:active .bi-input, +.bi-theme-dark .bi-list-item-none.active .bi-input { + color: inherit; +} +.bi-theme-dark .bi-list-item-none:active .bi-high-light, +.bi-theme-dark .bi-list-item-none.active .bi-high-light { + color: inherit; +} +.bi-theme-dark .bi-list-item-none.disabled, +.bi-theme-dark .bi-list-item-none.disabled:hover, +.bi-theme-dark .bi-list-item-none.disabled:active { + background-color: transparent !important; + color: #666666 !important; +} +.bi-theme-dark .bi-list-item-none.disabled .bi-input, +.bi-theme-dark .bi-list-item-none.disabled:hover .bi-input, +.bi-theme-dark .bi-list-item-none.disabled:active .bi-input { + color: #666666 !important; +} +.bi-theme-dark .bi-list-item-none.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-none.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-none.disabled:active .bi-high-light { + color: #666666 !important; +} diff --git a/src/less/core/utils/common.less b/src/less/core/utils/common.less index 7a8d6dc54..2dd6dcc1a 100644 --- a/src/less/core/utils/common.less +++ b/src/less/core/utils/common.less @@ -551,3 +551,70 @@ } } } + +//去掉list-item效果 +.bi-list-item-none { + &:hover, &.hover { + color: inherit; + & .bi-input { + color: inherit; + } + background-color: inherit; + } + &:active, &.active { + color: inherit; + & .bi-input { + color: inherit; + } + background-color: inherit; + & .bi-high-light { + color: inherit; + } + } + &.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; + } + } + } +} + +.bi-theme-dark { + .bi-list-item-none { + &:hover, &.hover { + color: inherit; + & .bi-input { + color: inherit; + } + background-color: inherit; + } + &:active, &.active { + color: inherit; + & .bi-input { + color: inherit; + } + background-color: inherit; + & .bi-high-light { + color: inherit; + } + } + &.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; + } + } + } + } +} diff --git a/src/widget/arrangement/arrangement.js b/src/widget/arrangement/arrangement.js index 75e597cc5..858acdb4b 100644 --- a/src/widget/arrangement/arrangement.js +++ b/src/widget/arrangement/arrangement.js @@ -2003,13 +2003,17 @@ BI.Arrangement = BI.inherit(BI.Widget, { _getOneWidthPortion: function () { return this.getClientWidth() / BI.Arrangement.PORTION; }, + _getOneHeightPortion: function () { + return this.getClientHeight() / BI.Arrangement.H_PORTION; + }, _getGridPositionAndSize: function (position) { var perWidth = this._getOneWidthPortion(); + var perHeight = this._getOneHeightPortion(); var widthPortion = Math.round(position.width / perWidth); var leftPortion = Math.round(position.left / perWidth); - var topPortion = Math.round(position.top / BI.Arrangement.GRID_HEIGHT); - var heightPortion = Math.round(position.height / BI.Arrangement.GRID_HEIGHT); + var topPortion = Math.round(position.top / perHeight); + var heightPortion = Math.round(position.height / perHeight); // if (leftPortion > BI.Arrangement.PORTION) { // leftPortion = BI.Arrangement.PORTION; // } @@ -2035,11 +2039,12 @@ BI.Arrangement = BI.inherit(BI.Widget, { _getBlockPositionAndSize: function (position) { var perWidth = this._getOneWidthPortion(); + var perHeight = this._getOneHeightPortion(); return { left: position.x * perWidth, - top: position.y * BI.Arrangement.GRID_HEIGHT, + top: position.y * perHeight, width: position.w * perWidth, - height: position.h * BI.Arrangement.GRID_HEIGHT + height: position.h * perHeight }; }, @@ -2726,12 +2731,15 @@ BI.Arrangement = BI.inherit(BI.Widget, { break; case BI.Arrangement.LAYOUT_TYPE.GRID: if (this._isArrangeFine()) { - var width = this.getClientWidth(); + var width = this.getClientWidth(), height = this.getClientHeight(); var xRatio = (ratio.x || 1) * width / (occupied.left + occupied.width); + var yRatio = (ratio.y || 1) * height / (occupied.top + occupied.height); var regions = this._cloneRegion(); BI.each(regions, function (i, region) { region.left = region.left * xRatio; region.width = region.width * xRatio; + region.top = region.top * yRatio; + region.height = region.height * yRatio; }); if (this._test(regions)) { var layout = this._getLayoutsByRegions(regions); @@ -2866,6 +2874,7 @@ BI.Arrangement = BI.inherit(BI.Widget, { case BI.Arrangement.LAYOUT_TYPE.FREE: break; case BI.Arrangement.LAYOUT_TYPE.GRID: + var perHeight = this._getOneHeightPortion(); var width = this.getClientWidth(), height = this.getClientHeight(); var regions = this._cloneRegion(); var clone = BI.toArray(regions); @@ -2882,10 +2891,10 @@ BI.Arrangement = BI.inherit(BI.Widget, { BI.each(clone, function (i, region) { var row = Math.floor(i / 3), col = i % 3; BI.extend(region, { - top: row * 380, + top: row * perHeight * 6, left: col * w, width: w, - height: 380 + height: perHeight * 6 }); if (!store[row]) { store[row] = {}; @@ -2935,8 +2944,8 @@ BI.Arrangement = BI.inherit(BI.Widget, { }); BI.Arrangement.EVENT_SCROLL = "EVENT_SCROLL"; BI.extend(BI.Arrangement, { - PORTION: 24, - GRID_HEIGHT: 60, + PORTION: 32, + H_PORTION: 18, LAYOUT_TYPE: { ADAPTIVE: 0, FREE: 1, diff --git a/src/widget/multilayerselecttree/node/node.first.plus.js b/src/widget/multilayerselecttree/node/node.first.plus.js index aba0af277..467290106 100644 --- a/src/widget/multilayerselecttree/node/node.first.plus.js +++ b/src/widget/multilayerselecttree/node/node.first.plus.js @@ -23,6 +23,7 @@ BI.MultiLayerSelectTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.node = BI.createWidget({ type: "bi.select_tree_first_plus_group_node", + cls: "bi-list-item-none", stopPropagation: true, logic: { dynamic: true diff --git a/src/widget/multilayerselecttree/node/node.last.plus.js b/src/widget/multilayerselecttree/node/node.last.plus.js index 4ae2c9dbd..035ddd5e4 100644 --- a/src/widget/multilayerselecttree/node/node.last.plus.js +++ b/src/widget/multilayerselecttree/node/node.last.plus.js @@ -23,6 +23,7 @@ BI.MultiLayerSelectTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.node = BI.createWidget({ type: "bi.select_tree_last_plus_group_node", + cls: "bi-list-item-none", stopPropagation: true, logic: { dynamic: true diff --git a/src/widget/multilayerselecttree/node/node.mid.plus.js b/src/widget/multilayerselecttree/node/node.mid.plus.js index 4cda2a994..2dcde5142 100644 --- a/src/widget/multilayerselecttree/node/node.mid.plus.js +++ b/src/widget/multilayerselecttree/node/node.mid.plus.js @@ -23,6 +23,7 @@ BI.MultiLayerSelectTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.node = BI.createWidget({ type: "bi.select_tree_mid_plus_group_node", + cls: "bi-list-item-none", stopPropagation: true, logic: { dynamic: true diff --git a/src/widget/multilayersingletree/node/node.first.plus.js b/src/widget/multilayersingletree/node/node.first.plus.js index 21e9d24b6..4e6255a50 100644 --- a/src/widget/multilayersingletree/node/node.first.plus.js +++ b/src/widget/multilayersingletree/node/node.first.plus.js @@ -22,6 +22,7 @@ BI.MultiLayerSingleTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.node = BI.createWidget({ type: "bi.first_plus_group_node", + cls: "bi-list-item-none", logic: { dynamic: true }, diff --git a/src/widget/multilayersingletree/node/node.last.plus.js b/src/widget/multilayersingletree/node/node.last.plus.js index 7785ce8dc..085254a61 100644 --- a/src/widget/multilayersingletree/node/node.last.plus.js +++ b/src/widget/multilayersingletree/node/node.last.plus.js @@ -22,6 +22,7 @@ BI.MultiLayerSingleTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.node = BI.createWidget({ type: "bi.last_plus_group_node", + cls: "bi-list-item-none", logic: { dynamic: true }, diff --git a/src/widget/multilayersingletree/node/node.mid.plus.js b/src/widget/multilayersingletree/node/node.mid.plus.js index 726e10a9a..a540a0e26 100644 --- a/src/widget/multilayersingletree/node/node.mid.plus.js +++ b/src/widget/multilayersingletree/node/node.mid.plus.js @@ -22,6 +22,7 @@ BI.MultiLayerSingleTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, { var self = this, o = this.options; this.node = BI.createWidget({ type: "bi.mid_plus_group_node", + cls: "bi-list-item-none", logic: { dynamic: true }, diff --git a/src/widget/multilayersingletree/treeitem/item.first.treeleaf.js b/src/widget/multilayersingletree/treeitem/item.first.treeleaf.js index f7c11ea1b..82c6915d4 100644 --- a/src/widget/multilayersingletree/treeitem/item.first.treeleaf.js +++ b/src/widget/multilayersingletree/treeitem/item.first.treeleaf.js @@ -22,6 +22,7 @@ BI.MultiLayerSingleTreeFirstTreeLeafItem = BI.inherit(BI.BasicButton, { var self = this, o = this.options; this.item = BI.createWidget({ type: "bi.first_tree_leaf_item", + cls: "bi-list-item-none", logic: { dynamic: true }, diff --git a/src/widget/multilayersingletree/treeitem/item.last.treeleaf.js b/src/widget/multilayersingletree/treeitem/item.last.treeleaf.js index 5c7bb730a..bece33468 100644 --- a/src/widget/multilayersingletree/treeitem/item.last.treeleaf.js +++ b/src/widget/multilayersingletree/treeitem/item.last.treeleaf.js @@ -22,6 +22,7 @@ BI.MultiLayerSingleTreeLastTreeLeafItem = BI.inherit(BI.BasicButton, { var self = this, o = this.options; this.item = BI.createWidget({ type: "bi.last_tree_leaf_item", + cls: "bi-list-item-none", logic: { dynamic: true }, diff --git a/src/widget/multilayersingletree/treeitem/item.mid.treeleaf.js b/src/widget/multilayersingletree/treeitem/item.mid.treeleaf.js index 4a23ab947..b6ec9bf9b 100644 --- a/src/widget/multilayersingletree/treeitem/item.mid.treeleaf.js +++ b/src/widget/multilayersingletree/treeitem/item.mid.treeleaf.js @@ -22,6 +22,7 @@ BI.MultiLayerSingleTreeMidTreeLeafItem = BI.inherit(BI.BasicButton, { var self = this, o = this.options; this.item = BI.createWidget({ type: "bi.mid_tree_leaf_item", + cls: "bi-list-item-none", logic: { dynamic: true }, diff --git a/src/widget/responsivetable/responsivetable.js b/src/widget/responsivetable/responsivetable.js index 17b9f1616..c6817113d 100644 --- a/src/widget/responsivetable/responsivetable.js +++ b/src/widget/responsivetable/responsivetable.js @@ -147,7 +147,8 @@ BI.ResponisveTable = BI.inherit(BI.Widget, { } }); //因为有边框,所以加上数组长度的参数调整 - var sumLeft = BI.sum(columnSizeLeft) + columnSizeLeft.length, sumRight = BI.sum(columnSizeRight) + columnSizeRight.length; + var sumLeft = BI.sum(columnSizeLeft) + columnSizeLeft.length, + sumRight = BI.sum(columnSizeRight) + columnSizeRight.length; return { sumLeft: sumLeft, sumRight: sumRight, @@ -351,11 +352,9 @@ BI.ResponisveTable = BI.inherit(BI.Widget, { this.table.populate.apply(this.table, arguments); if (o.isNeedFreeze === true) { BI.nextTick(function () { - if (self.element.is(":visible")) { - self._initRegionSize(); - self.table.resize(); - self._resizeHeader(); - } + self._initRegionSize(); + self.table.resize(); + self._resizeHeader(); }); } }