Browse Source

Pull request #2864: KERNEL-11647 feat: 下拉框trigger按钮交互行为的统一

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

* commit 'fe3c4c5697ef6d18b2df6e7854e4fb94678ccb29':
  KERNEL-11647 feat: 下拉框trigger按钮交互行为的统一
  KERNEL-11647 feat: 下拉框trigger按钮交互行为的统一
es6
Dailer 3 years ago
parent
commit
d0c2c175ad
  1. 3
      src/base/combination/combo.js
  2. 1
      src/case/combo/bubblecombo/combo.bubble.js
  3. 5
      src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js
  4. 6
      src/core/constant/events.js
  5. 22
      src/widget/multiselect/multiselect.combo.js
  6. 23
      src/widget/multiselect/multiselect.combo.nobar.js
  7. 10
      src/widget/multiselect/multiselect.trigger.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

3
src/base/combination/combo.js

@ -55,6 +55,9 @@
});
this.combo.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (self.isEnabled() && self.isValid()) {
if (type === BI.Events.TOGGLE) {
self._toggle();
}
if (type === BI.Events.EXPAND) {
self._popupView();
}

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

@ -52,6 +52,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
hideChecker: o.hideChecker,
offsetStyle: o.offsetStyle,
showArrow: true,
comboClass: o.comboClass,
el: o.el,
popup: () => BI.extend({
type: "bi.bubble_popup_view",

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

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

6
src/core/constant/events.js

@ -143,6 +143,12 @@ _.extend(BI, {
*/
COLLAPSE: "_COLLAPSE",
/**
* @static
* @property 下拉菜单切换展开收起事件
*/
TOGGLE: "_TOGGLE",
/**
* @static
* @property 回调事件

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

@ -173,7 +173,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0 && self.numberCounter.element.find(e.target).length === 0;
return self.numberCounter.element.find(e.target).length === 0;
},
});
@ -198,21 +198,6 @@ 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: {
@ -263,11 +248,6 @@ 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",

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

@ -174,8 +174,7 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
value: o.value
},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0 &&
self.numberCounter.element.find(e.target).length === 0;
return self.numberCounter.element.find(e.target).length === 0;
}
});
@ -200,21 +199,6 @@ 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({
type: "bi.multi_select_check_selected_switcher",
masker: {
@ -268,11 +252,6 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.vertical_adapt",

10
src/widget/multiselect/multiselect.trigger.js

@ -83,7 +83,15 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
el: this.wrapNumberCounter,
width: 0
}, {
el: BI.createWidget(),
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: 24
}]
});

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

@ -107,8 +107,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
isNeedAdjustWidth: o.isNeedAdjustWidth,
value: { value: o.value || {} },
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0 &&
self.numberCounter.element.find(e.target).length === 0;
return self.numberCounter.element.find(e.target).length === 0;
}
});
@ -212,21 +211,6 @@ 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: {
@ -289,11 +273,6 @@ 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,8 +123,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
isNeedAdjustWidth: o.isNeedAdjustWidth,
value: { value: o.value || {} },
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0 &&
self.numberCounter.element.find(e.target).length === 0;
return self.numberCounter.element.find(e.target).length === 0;
}
});
@ -223,21 +222,6 @@ 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: {
@ -300,11 +284,6 @@ 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,8 +141,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
isNeedAdjustWidth: o.isNeedAdjustWidth,
value: { value: o.value || {} },
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0 &&
self.numberCounter.element.find(e.target).length === 0;
return self.numberCounter.element.find(e.target).length === 0;
}
});
@ -241,21 +240,6 @@ 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: {
@ -318,11 +302,6 @@ 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