Browse Source

Merge pull request #157583 in DEC/fineui from master to feature/x

* commit '6dc2a501eb62c3e9100372d2f7acd01535b2ad44':
  KERNEL-11626 feat: 半选checkbox支持动态宽高
  无JIRA fix: nor_bar 复选下拉框切换箭头
master
superman 2 years ago
parent
commit
621cc8bb2a
  1. 22
      src/case/button/icon/iconhalf/icon.half.js
  2. 8
      src/less/widget/multiselect/multiselect.combo.less
  3. 22
      src/widget/multiselect/multiselect.combo.nobar.js

22
src/case/button/icon/iconhalf/icon.half.js

@ -7,16 +7,30 @@ BI.HalfButton = BI.inherit(BI.BasicButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.HalfIconButton.superclass._defaultConfig.apply(this, arguments); var conf = BI.HalfIconButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
extraCls: "bi-half-button bi-high-light-border", selected: false,
height: 14,
width: 14, width: 14,
selected: false height: 14,
iconWidth: 14,
iconHeight: 14,
}); });
}, },
render: function () {
var o = this.options;
return {
type: "bi.center_adapt",
items: [{
type: "bi.default",
cls: "bi-half-button bi-high-light-border",
width: o.iconWidth,
height: o.iconHeight,
}],
};
},
doClick: function () { doClick: function () {
BI.HalfButton.superclass.doClick.apply(this, arguments); BI.HalfButton.superclass.doClick.apply(this, arguments);
if(this.isValid()) { if (this.isValid()) {
this.fireEvent(BI.HalfButton.EVENT_CHANGE); this.fireEvent(BI.HalfButton.EVENT_CHANGE);
} }
} }

8
src/less/widget/multiselect/multiselect.combo.less

@ -1,9 +1,12 @@
@import "../../index.less"; @import "../../index.less";
@val: transform .3s ease; @val: transform .3s ease;
.bi-multi-select-combo{
& .multi-select-trigger-icon-button{ .bi-multi-select-combo, .bi-multi-select-combo-no-bar {
& .multi-select-trigger-icon-button {
font-size: @font-size-16; font-size: @font-size-16;
} }
// 此combo的trigger_button是absolute上去的,与bi-combo在同一层级,独立写一下 // 此combo的trigger_button是absolute上去的,与bi-combo在同一层级,独立写一下
& .bi-combo.bi-combo-popup + .bi-trigger-icon-button { & .bi-combo.bi-combo-popup + .bi-trigger-icon-button {
& .x-icon { & .x-icon {
@ -11,6 +14,7 @@
.transition(@val); .transition(@val);
} }
} }
& .bi-combo + .bi-trigger-icon-button { & .bi-combo + .bi-trigger-icon-button {
& .x-icon { & .x-icon {
.rotate(0deg); .rotate(0deg);

22
src/widget/multiselect/multiselect.combo.nobar.js

@ -174,7 +174,7 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
value: o.value value: o.value
}, },
hideChecker: function (e) { hideChecker: function (e) {
return self.numberCounter.element.find(e.target).length === 0; return triggerBtn.element.find(e.target).length === 0 && self.numberCounter.element.find(e.target).length === 0;
} }
}); });
@ -199,6 +199,21 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
} }
}); });
var triggerBtn = BI.createWidget({
type: "bi.trigger_icon_button",
width: o.height,
height: o.height,
cls: "multi-select-trigger-icon-button"
});
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
self.numberCounter.hideView();
if (self.combo.isViewVisible()) {
self.combo.hideView();
} else {
self.combo.showView();
}
});
this.numberCounter = BI.createWidget({ this.numberCounter = BI.createWidget({
type: "bi.multi_select_check_selected_switcher", type: "bi.multi_select_check_selected_switcher",
masker: { masker: {
@ -252,6 +267,11 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
right: 0, right: 0,
top: 0, top: 0,
bottom: 0 bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}, { }, {
el: { el: {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",

Loading…
Cancel
Save