Browse Source

Pull request #2434: feature: 气泡支持品牌色

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit '93cf114da5a37798ed5372674b02e352152d9dc0':
  feature: 气泡支持品牌色
es6
guy 3 years ago
parent
commit
5ea5e9cbd1
  1. 4
      src/base/layer/layer.popup.js
  2. 6
      src/case/combo/bubblecombo/combo.bubble.js
  3. 17
      src/case/combo/bubblecombo/popup.bubble.js
  4. 3
      src/less/base/combo/combo.bubble.less
  5. 4
      src/less/core/utils/common.less
  6. 2
      src/less/lib/constant.less

4
src/base/layer/layer.popup.js

@ -7,6 +7,8 @@ BI.PopupView = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.PopupView.superclass._defaultConfig.apply(this, arguments), {
_baseCls: "bi-popup-view",
// 品牌色
primary: false,
maxWidth: "auto",
minWidth: 100,
// maxHeight: 200,
@ -84,7 +86,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
hgap: o.hgap,
items: BI.LogicFactory.createLogicItemsByDirection(o.direction,
BI.extend({
cls: "list-view-outer bi-card list-view-shadow"
cls: "list-view-outer bi-card list-view-shadow" + (o.primary ? " bi-primary" : "")
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.tool, this.tab, this.view, this.toolbar)
})))

6
src/case/combo/bubblecombo/combo.bubble.js

@ -13,6 +13,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
baseCls: "bi-bubble-combo",
trigger: "click",
toggle: true,
primary: false,
direction: "bottom,left", // top||bottom||left||right||top,left||top,right||bottom,left||bottom,right
isDefaultInit: false,
destroyWhenHide: false,
@ -57,6 +58,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
type: "bi.bubble_popup_view",
animation: "bi-zoom-big",
animationDuring: 200,
primary: o.primary
}, o.popup)
});
this.combo.on(BI.Combo.EVENT_TRIGGER_CHANGE, function () {
@ -95,7 +97,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
},
_createTriangle: function (direction) {
var pos = {}, op = {};
var o = this.options, pos = {}, op = {};
var adjustLength = this.options.adjustLength;
var offset = this.element.offset();
var left = offset.left, right = offset.left + this.element.outerWidth();
@ -143,7 +145,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
cls: "button-combo-triangle-wrapper",
items: [{
type: "bi.layout",
cls: "bubble-combo-triangle-" + direction
cls: "bubble-combo-triangle-" + direction + (o.primary ? " bi-primary": "")
}]
});
pos.el = this.triangle;

17
src/case/combo/bubblecombo/popup.bubble.js

@ -9,9 +9,9 @@ BI.BubblePopupView = BI.inherit(BI.PopupView, {
var config = BI.BubblePopupView.superclass._defaultConfig.apply(this, arguments);
return BI.extend(config, {
baseCls: config.baseCls + " bi-bubble-popup-view",
minWidth: 220,
minWidth: 70,
maxWidth: 300,
minHeight: 90
minHeight: 50
});
},
});
@ -60,11 +60,11 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
});
return BI.createWidget({
type: "bi.center",
height: 48,
rgap: 15,
height: 54,
rgap: 20,
items: [{
type: "bi.right_vertical_adapt",
lgap: 10,
lgap: 15,
items: items
}]
});
@ -79,12 +79,12 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
layouts: [{
type: "bi.vertical",
cls: "bar-popup-container",
hgap: 15,
tgap: 10
hgap: 20,
tgap: 15
}]
});
button.element.css("min-height", o.minHeight - 48);
button.element.css("min-height", o.minHeight - 54);
return button;
}
@ -134,6 +134,7 @@ BI.TextBubblePopupBarView = BI.inherit(BI.Widget, {
});
return {
type: "bi.bubble_bar_popup_view",
primary: o.primary,
minWidth: o.minWidth,
maxWidth: o.maxWidth,
minHeight: o.minHeight,

3
src/less/base/combo/combo.bubble.less

@ -29,6 +29,9 @@
&:before {
background-color: @color-bi-background-bubble-combo-triangle;
}
&.bi-primary:before {
background-color: @background-color-primary;
}
}
}

4
src/less/core/utils/common.less

@ -122,6 +122,10 @@
& .bi-textarea {
color: @color-bi-text-card;
}
&.bi-primary {
background-color: @background-color-primary;
color: @color-card-primary;
}
}
.bi-theme-dark {

2
src/less/lib/constant.less

@ -23,6 +23,8 @@
// 色板
// 品牌
@color-primary: #3685f2;
@color-card-primary: @color-white;
@background-color-primary: #1e4092;
//green
@color-green-100: #13cd66;

Loading…
Cancel
Save