Browse Source

Pull request #2358: 无JIRA任务 chore: 乱加

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

* commit 'a20bccfcf021158e3fc112a0dd2bb64f79dcfaf9':
  chore: 乱加
  chore: 乱加
es6
guy 3 years ago
parent
commit
f31a10423a
  1. 2
      src/case/button/item.singleselect.js
  2. 24
      src/case/combo/searchtextvaluecombo/popup.searchtextvalue.js
  3. 5
      src/case/combo/textvaluecheckcombo/popup.textvaluecheck.js
  4. 22
      src/case/combo/textvaluecombo/popup.textvalue.js
  5. 19
      src/widget/singleselect/search/singleselect.search.loader.js
  6. 15
      src/widget/singleselect/singleselect.loader.js

2
src/case/button/item.singleselect.js

@ -21,8 +21,6 @@ BI.SingleSelectItem = BI.inherit(BI.BasicButton, {
text: o.text, text: o.text,
keyword: o.keyword, keyword: o.keyword,
value: o.value, value: o.value,
title: o.title || o.text,
warningTitle: o.warningTitle,
py: o.py py: o.py
}); });
}, },

24
src/case/combo/searchtextvaluecombo/popup.searchtextvalue.js

@ -17,11 +17,7 @@ BI.SearchTextValueComboPopup = BI.inherit(BI.Pane, {
ref: function () { ref: function () {
self.popup = this; self.popup = this;
}, },
items: BI.createItems(o.items, { items: this._formatItems(o.items),
type: "bi.single_select_item",
textAlign: o.textAlign,
height: 24
}),
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
layouts: [{ layouts: [{
type: "bi.vertical" type: "bi.vertical"
@ -45,6 +41,18 @@ BI.SearchTextValueComboPopup = BI.inherit(BI.Pane, {
}; };
}, },
_formatItems: function (items) {
var o = this.options;
return BI.map(items, function (i, item) {
return BI.extend({
type: "bi.single_select_item",
textAlign: o.textAlign,
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
title: item.title || item.text
}, item);
});
},
// mounted之后做check // mounted之后做check
mounted: function() { mounted: function() {
this.check(); this.check();
@ -53,11 +61,7 @@ BI.SearchTextValueComboPopup = BI.inherit(BI.Pane, {
populate: function (find, match, keyword) { populate: function (find, match, keyword) {
var items = BI.concat(find, match); var items = BI.concat(find, match);
BI.SearchTextValueComboPopup.superclass.populate.apply(this, items); BI.SearchTextValueComboPopup.superclass.populate.apply(this, items);
items = BI.createItems(items, { this.popup.populate(this._formatItems(items), keyword);
type: "bi.single_select_item",
height: 24
});
this.popup.populate(items, keyword);
}, },
getValue: function () { getValue: function () {

5
src/case/combo/textvaluecheckcombo/popup.textvaluecheck.js

@ -35,11 +35,14 @@ BI.TextValueCheckComboPopup = BI.inherit(BI.Pane, {
}, },
_formatItems: function (items) { _formatItems: function (items) {
var o = this.options;
return BI.map(items, function (i, item) { return BI.map(items, function (i, item) {
return BI.extend({ return BI.extend({
type: "bi.single_select_item", type: "bi.single_select_item",
cls: "bi-list-item", cls: "bi-list-item",
height: 24 textAlign: o.textAlign,
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
title: item.title || item.text
}, item); }, item);
}); });
}, },

22
src/case/combo/textvaluecombo/popup.textvalue.js

@ -11,11 +11,7 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, {
var o = this.options, self = this; var o = this.options, self = this;
this.popup = BI.createWidget({ this.popup = BI.createWidget({
type: "bi.button_group", type: "bi.button_group",
items: BI.createItems(o.items, { items: this._formatItems(o.items),
type: "bi.single_select_item",
textAlign: o.textAlign,
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
}),
chooseType: o.chooseType, chooseType: o.chooseType,
layouts: [{ layouts: [{
type: "bi.vertical" type: "bi.vertical"
@ -39,13 +35,21 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, {
}); });
}, },
populate: function (items) { _formatItems: function (items) {
BI.TextValueComboPopup.superclass.populate.apply(this, arguments); var o = this.options;
items = BI.createItems(items, { return BI.map(items, function (i, item) {
return BI.extend({
type: "bi.single_select_item", type: "bi.single_select_item",
textAlign: o.textAlign,
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
title: item.title || item.text
}, item);
}); });
this.popup.populate(items); },
populate: function (items) {
BI.TextValueComboPopup.superclass.populate.apply(this, arguments);
this.popup.populate(this._formatItems(items));
}, },
getValue: function () { getValue: function () {

19
src/widget/singleselect/search/singleselect.search.loader.js

@ -10,6 +10,9 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
return BI.extend(BI.SingleSelectSearchLoader.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.SingleSelectSearchLoader.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-search-loader", baseCls: "bi-single-select-search-loader",
allowNoSelect: false, allowNoSelect: false,
logic: {
dynamic: false
},
itemsCreator: BI.emptyFn, itemsCreator: BI.emptyFn,
keywordGetter: BI.emptyFn, keywordGetter: BI.emptyFn,
valueFormatter: BI.emptyFn valueFormatter: BI.emptyFn
@ -86,16 +89,18 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
}, },
_createItems: function (items) { _createItems: function (items) {
return BI.createItems(items, { var o = this.options;
type: this.options.allowNoSelect ? "bi.single_select_item" : "bi.single_select_radio_item", return BI.map(items, function (i, item) {
return BI.extend({
type: o.allowNoSelect ? "bi.single_select_item" : "bi.single_select_radio_item",
logic: o.logic,
cls: "bi-list-item-active", cls: "bi-list-item-active",
logic: { height: 24,
dynamic: false
},
height: 25,
selected: false, selected: false,
iconWrapperWidth: 26, iconWrapperWidth: 26,
hgap: this.options.allowNoSelect ? 10 : 0 hgap: o.allowNoSelect ? 10 : 0,
title: item.title || item.text
}, item);
}); });
}, },

15
src/widget/singleselect/singleselect.loader.js

@ -108,14 +108,18 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
}, },
_createItems: function (items) { _createItems: function (items) {
return BI.createItems(items, { var o = this.options;
type: this.options.allowNoSelect ? "bi.single_select_item" : "bi.single_select_radio_item", return BI.map(items, function (i, item) {
logic: this.options.logic, return BI.extend({
type: o.allowNoSelect ? "bi.single_select_item" : "bi.single_select_radio_item",
logic: o.logic,
cls: "bi-list-item-active", cls: "bi-list-item-active",
height: 24, height: 24,
selected: false, selected: false,
iconWrapperWidth: 26, iconWrapperWidth: 26,
hgap: this.options.allowNoSelect ? 10 : 0 hgap: o.allowNoSelect ? 10 : 0,
title: item.title || item.text
}, item);
}); });
}, },
@ -126,7 +130,8 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
}, 30); }, 30);
}, },
_assertValue: function (val) {}, _assertValue: function (val) {
},
setStartValue: function (v) { setStartValue: function (v) {
this._startValue = v; this._startValue = v;

Loading…
Cancel
Save