forked from fanruan/fineui
Browse Source
* commit '3d3973ee8c0ebc13ab283f04fb37707e13a7722e': (198 commits) 同步 同步 Pull request #3135: BI-115516 check面板也处理下 Merge pull request #200297 in DEC/fineui from master to feature/x Merge pull request #200530 in DEC/fineui from master to feature/x 无JIRA fix: text_value_combo_popup 兼容性 BI-115369 同步修改 update 无JIRA任务 图标key Pull request #3114: 无JIRA任务 chore: 优化 auto upgrade version to 2.0.20221009164825 BI-114880 style:图标更新 auto upgrade version to 2.0.20221008165420 auto upgrade version to 2.0.20221007090556 resizeObserver auto upgrade version to 2.0.20221004143445 auto upgrade version to 2.0.20221003165530 feature: 支持type可以直接传函数,没有xtype都行 无JIRA fix: 动态日期面板border auto upgrade version to 2.0.20220928194458 ...research/test
superman
2 years ago
110 changed files with 1634 additions and 987 deletions
Binary file not shown.
Before Width: | Height: | Size: 710 KiB After Width: | Height: | Size: 788 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +1 @@ |
|||||||
lodash core plus="debounce,throttle,get,set,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy,union,zipObject,initial,cloneDeep,clamp,isPlainObject,take,takeRight,without,difference,defaultsDeep,trim,merge,groupBy,uniqBy,before,after,unescape,chunk" |
lodash core plus="debounce,throttle,get,set,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy,union,zipObject,initial,cloneDeep,clamp,isPlainObject,take,takeRight,without,difference,defaultsDeep,trim,merge,groupBy,uniqBy,before,after,unescape,chunk,pick,pickBy,identity" |
||||||
|
@ -1,7 +1,7 @@ |
|||||||
@import "../../index.less"; |
@import "../../index.less"; |
||||||
|
|
||||||
.bi-trigger{ |
.bi-trigger{ |
||||||
& .bi-trigger-icon-button{ |
& .bi-trigger-icon-button, &.bi-trigger-icon-button { |
||||||
font-size: @font-size-16; |
font-size: @font-size-16; |
||||||
} |
} |
||||||
} |
} |
@ -1,110 +1,139 @@ |
|||||||
/** |
(function() { |
||||||
* Created by roy on 15/8/14. |
function transformItems(items) { |
||||||
*/ |
if (!items) return items; |
||||||
BI.DownListCombo = BI.inherit(BI.Widget, { |
var result = BI.cloneDeep(items); |
||||||
_defaultConfig: function () { |
var isComplexItmes = BI.some(items, function (_, item) { |
||||||
return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this, arguments), { |
return BI.isArray(item); |
||||||
baseCls: "bi-down-list-combo", |
|
||||||
height: 24, |
|
||||||
items: [], |
|
||||||
adjustLength: 0, |
|
||||||
direction: "bottom", |
|
||||||
trigger: "click", |
|
||||||
container: null, |
|
||||||
stopPropagation: false, |
|
||||||
el: {}, |
|
||||||
minWidth: 140, |
|
||||||
maxHeight: 1000, |
|
||||||
destroyWhenHide: false |
|
||||||
}); |
}); |
||||||
}, |
// 传一维数组,帮转二维
|
||||||
|
if (!isComplexItmes) { |
||||||
|
result = [result]; |
||||||
|
} |
||||||
|
// 帮转 el
|
||||||
|
BI.each(result, function (_, arr) { |
||||||
|
BI.each(arr, function (_, item) { |
||||||
|
if (item.children && !item.el) { |
||||||
|
item.el = { |
||||||
|
text: item.text, |
||||||
|
icon: item.icon, |
||||||
|
cls: item.cls, |
||||||
|
iconCls1: item.iconCls1,
|
||||||
|
value: item.value |
||||||
|
}; |
||||||
|
} |
||||||
|
}); |
||||||
|
}); |
||||||
|
return result; |
||||||
|
} |
||||||
|
|
||||||
_init: function () { |
/** |
||||||
BI.DownListCombo.superclass._init.apply(this, arguments); |
* Created by roy on 15/8/14. |
||||||
var self = this, o = this.options; |
*/ |
||||||
|
BI.DownListCombo = BI.inherit(BI.Widget, { |
||||||
|
_defaultConfig: function () { |
||||||
|
return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this, arguments), { |
||||||
|
baseCls: "bi-down-list-combo", |
||||||
|
height: 24, |
||||||
|
items: [], |
||||||
|
adjustLength: 0, |
||||||
|
direction: "bottom", |
||||||
|
trigger: "click", |
||||||
|
container: null, |
||||||
|
stopPropagation: false, |
||||||
|
el: {}, |
||||||
|
minWidth: 140, |
||||||
|
maxHeight: 1000, |
||||||
|
destroyWhenHide: false |
||||||
|
}); |
||||||
|
}, |
||||||
|
|
||||||
this.downlistcombo = BI.createWidget({ |
_init: function () { |
||||||
element: this, |
BI.DownListCombo.superclass._init.apply(this, arguments); |
||||||
type: "bi.combo", |
var self = this, o = this.options; |
||||||
trigger: o.trigger, |
|
||||||
isNeedAdjustWidth: false, |
this.downlistcombo = BI.createWidget({ |
||||||
isDefaultInit: true, |
element: this, |
||||||
container: o.container, |
type: "bi.combo", |
||||||
adjustLength: o.adjustLength, |
trigger: o.trigger, |
||||||
direction: o.direction, |
isNeedAdjustWidth: false, |
||||||
belowMouse: o.belowMouse, |
isDefaultInit: true, |
||||||
stopPropagation: o.stopPropagation, |
container: o.container, |
||||||
destroyWhenHide: o.destroyWhenHide, |
adjustLength: o.adjustLength, |
||||||
el: BI.createWidget(o.el, { |
direction: o.direction, |
||||||
type: "bi.icon_trigger", |
belowMouse: o.belowMouse, |
||||||
extraCls: o.iconCls, |
|
||||||
width: o.width, |
|
||||||
height: o.height |
|
||||||
}), |
|
||||||
popup: { |
|
||||||
el: { |
|
||||||
type: "bi.down_list_popup", |
|
||||||
ref: function (ref) { |
|
||||||
self.popupView = ref; |
|
||||||
}, |
|
||||||
items: o.items, |
|
||||||
chooseType: o.chooseType, |
|
||||||
value: o.value, |
|
||||||
listeners: [{ |
|
||||||
eventName: BI.DownListPopup.EVENT_CHANGE, |
|
||||||
action: function (value) { |
|
||||||
self.fireEvent(BI.DownListCombo.EVENT_CHANGE, value); |
|
||||||
self.downlistcombo.hideView(); |
|
||||||
} |
|
||||||
}, { |
|
||||||
eventName: BI.DownListPopup.EVENT_SON_VALUE_CHANGE, |
|
||||||
action: function (value, fatherValue) { |
|
||||||
self.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, value, fatherValue); |
|
||||||
self.downlistcombo.hideView(); |
|
||||||
} |
|
||||||
}] |
|
||||||
}, |
|
||||||
stopPropagation: o.stopPropagation, |
stopPropagation: o.stopPropagation, |
||||||
maxHeight: o.maxHeight, |
destroyWhenHide: o.destroyWhenHide, |
||||||
minWidth: o.minWidth |
el: BI.createWidget(o.el, { |
||||||
} |
type: "bi.icon_trigger", |
||||||
}); |
extraCls: o.iconCls, |
||||||
|
width: o.width, |
||||||
|
height: o.height |
||||||
|
}), |
||||||
|
popup: { |
||||||
|
el: { |
||||||
|
type: "bi.down_list_popup", |
||||||
|
ref: function (ref) { |
||||||
|
self.popupView = ref; |
||||||
|
}, |
||||||
|
items: transformItems(o.items), |
||||||
|
chooseType: o.chooseType, |
||||||
|
value: o.value, |
||||||
|
listeners: [{ |
||||||
|
eventName: BI.DownListPopup.EVENT_CHANGE, |
||||||
|
action: function (value) { |
||||||
|
self.fireEvent(BI.DownListCombo.EVENT_CHANGE, value); |
||||||
|
self.downlistcombo.hideView(); |
||||||
|
} |
||||||
|
}, { |
||||||
|
eventName: BI.DownListPopup.EVENT_SON_VALUE_CHANGE, |
||||||
|
action: function (value, fatherValue) { |
||||||
|
self.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, value, fatherValue); |
||||||
|
self.downlistcombo.hideView(); |
||||||
|
} |
||||||
|
}] |
||||||
|
}, |
||||||
|
stopPropagation: o.stopPropagation, |
||||||
|
maxHeight: o.maxHeight, |
||||||
|
minWidth: o.minWidth |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () { |
this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () { |
||||||
self.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW); |
self.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW); |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
|
|
||||||
hideView: function () { |
hideView: function () { |
||||||
this.downlistcombo.hideView(); |
this.downlistcombo.hideView(); |
||||||
}, |
}, |
||||||
|
|
||||||
showView: function (e) { |
showView: function (e) { |
||||||
this.downlistcombo.showView(e); |
this.downlistcombo.showView(e); |
||||||
}, |
}, |
||||||
|
|
||||||
populate: function (items) { |
populate: function (items) { |
||||||
this.popupView.populate(items); |
this.popupView.populate(items); |
||||||
}, |
}, |
||||||
|
|
||||||
setValue: function (v) { |
setValue: function (v) { |
||||||
this.popupView.setValue(v); |
this.popupView.setValue(v); |
||||||
}, |
}, |
||||||
|
|
||||||
getValue: function () { |
getValue: function () { |
||||||
return this.popupView.getValue(); |
return this.popupView.getValue(); |
||||||
}, |
}, |
||||||
|
|
||||||
adjustWidth: function () { |
adjustWidth: function () { |
||||||
this.downlistcombo.adjustWidth(); |
this.downlistcombo.adjustWidth(); |
||||||
}, |
}, |
||||||
|
|
||||||
adjustHeight: function () { |
adjustHeight: function () { |
||||||
this.downlistcombo.adjustHeight(); |
this.downlistcombo.adjustHeight(); |
||||||
} |
} |
||||||
}); |
}); |
||||||
BI.DownListCombo.EVENT_CHANGE = "EVENT_CHANGE"; |
BI.DownListCombo.EVENT_CHANGE = "EVENT_CHANGE"; |
||||||
BI.DownListCombo.EVENT_SON_VALUE_CHANGE = "EVENT_SON_VALUE_CHANGE"; |
BI.DownListCombo.EVENT_SON_VALUE_CHANGE = "EVENT_SON_VALUE_CHANGE"; |
||||||
BI.DownListCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; |
BI.DownListCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; |
||||||
|
|
||||||
BI.shortcut("bi.down_list_combo", BI.DownListCombo); |
BI.shortcut("bi.down_list_combo", BI.DownListCombo); |
||||||
|
}()); |
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue