Browse Source

REPORT-75687 & KERNEL-11647 fix: 依然把triggerIcon放到trigger外面

es6
zsmj 2 years ago
parent
commit
db11897957
  1. 1
      src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js
  2. 4
      src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js
  3. 5
      src/less/widget/multitree/multi.tree.combo.less
  4. 22
      src/widget/multiselect/multiselect.combo.js
  5. 3
      src/widget/multiselect/multiselect.loader.js
  6. 20
      src/widget/multiselect/multiselect.trigger.js
  7. 3
      src/widget/multiselect/search/multiselect.search.loader.js
  8. 23
      src/widget/multitree/multi.tree.combo.js
  9. 23
      src/widget/multitree/multi.tree.insert.combo.js
  10. 23
      src/widget/multitree/multi.tree.list.combo.js

1
src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js

@ -33,7 +33,6 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
adjustLength: 2,
height: height,
width: width,
toggle: false,
ref: function () {
self.combo = this;
},

4
src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js

@ -24,10 +24,6 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
},
width: o.height,
height: o.height,
stopPropagation: true,
handler: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.TOGGLE);
}
};
var stateText = this._digest(o.value, o.items) || o.text;

5
src/less/widget/multitree/multi.tree.combo.less

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

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

@ -173,7 +173,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
},
value: o.value,
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;
},
});
@ -198,6 +198,21 @@ BI.MultiSelectCombo = 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({
type: "bi.multi_select_check_selected_switcher",
masker: {
@ -248,6 +263,11 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
right: 0,
top: 0,
bottom: 0,
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0,
}, {
el: {
type: "bi.vertical_adapt",

3
src/widget/multiselect/multiselect.loader.js

@ -110,12 +110,13 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
},
_createItems: function (items) {
var allSelected = this.isAllSelected();
return BI.createItems(items, {
type: "bi.multi_select_item",
logic: this.options.logic,
cls: "bi-list-item-active",
height: this.options.itemHeight || BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
selected: this.isAllSelected(),
selected: allSelected,
iconWrapperWidth: 36
});
},

20
src/widget/multiselect/multiselect.trigger.js

@ -78,22 +78,10 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
items: [
{
el: this.searcher,
width: "fill"
}, {
el: this.wrapNumberCounter,
width: 0
}, {
el: {
type: "bi.trigger_icon_button",
height: o.height,
stopPropagation: true,
cls: "multi-select-trigger-icon-button",
handler: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.TOGGLE);
width: "fill",
rgap: 24
}
},
width: 24
}]
]
});
!o.allowEdit && BI.createWidget({
@ -123,7 +111,7 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
* 重新调整numberCounter的空白占位符
*/
refreshPlaceHolderWidth: function (width) {
this.wrapper.attr("items")[1].width = width;
this.wrapper.attr("items")[0].rgap = 24 + width;
this.wrapper.resize();
},

3
src/widget/multiselect/search/multiselect.search.loader.js

@ -91,13 +91,14 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
},
_createItems: function (items) {
var allSelected = this.isAllSelected();
return BI.createItems(items, {
type: "bi.multi_select_item",
logic: {
dynamic: false
},
height: this.options.itemHeight || BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
selected: this.isAllSelected(),
selected: allSelected,
cls: "bi-list-item-active",
iconWrapperWidth: 36
});

23
src/widget/multitree/multi.tree.combo.js

@ -107,7 +107,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
isNeedAdjustWidth: o.isNeedAdjustWidth,
value: {value: o.value || {}},
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;
}
});
@ -211,6 +212,21 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
change = false;
});
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({
type: "bi.multi_select_check_selected_switcher",
el: {
@ -273,6 +289,11 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.vertical_adapt",

23
src/widget/multitree/multi.tree.insert.combo.js

@ -123,7 +123,8 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
isNeedAdjustWidth: o.isNeedAdjustWidth,
value: {value: o.value || {}},
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;
}
});
@ -222,6 +223,21 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
change = false;
});
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({
type: "bi.multi_select_check_selected_switcher",
el: {
@ -284,6 +300,11 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.vertical_adapt",

23
src/widget/multitree/multi.tree.list.combo.js

@ -141,7 +141,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
isNeedAdjustWidth: o.isNeedAdjustWidth,
value: {value: o.value || {}},
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;
}
});
@ -240,6 +241,21 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
change = false;
});
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({
type: "bi.multi_select_check_selected_switcher",
el: {
@ -302,6 +318,11 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.vertical_adapt",

Loading…
Cancel
Save