Browse Source

Pull request #2994: KERNEL-11286 feat: 下拉框value,text,defaultText属性规则统一

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

* commit 'adf265507037d042d8ceb0fd9b95dfc283abc41e':
  REPORT-77978 fix: 下拉树水印表现异常问题
  KERNEL-11286 feat: 下拉框value,text,defaultText属性规则统一
  KERNEL-11286 feat: 下拉框value,text,defaultText属性规则统一
es6
Dailer 2 years ago
parent
commit
1e566cc229
  1. 4
      src/case/editor/editor.state.js
  2. 3
      src/case/editor/editor.state.simple.js
  3. 11
      src/case/trigger/trigger.text.select.js
  4. 1
      src/widget/multilayersingletree/multilayersingletree.combo.js
  5. 2
      src/widget/multiselect/multiselect.combo.js
  6. 2
      src/widget/multiselect/multiselect.combo.nobar.js
  7. 3
      src/widget/multiselect/multiselect.insert.combo.js
  8. 1
      src/widget/multiselect/multiselect.insert.trigger.js
  9. 2
      src/widget/multiselect/trigger/editor/editor.patch.js
  10. 2
      src/widget/multiselect/trigger/searcher.multiselect.insert.js
  11. 2
      src/widget/multiselect/trigger/searcher.multiselect.js
  12. 1
      src/widget/multitree/multi.tree.combo.js
  13. 7
      src/widget/multitree/multi.tree.insert.combo.js
  14. 7
      src/widget/multitree/multi.tree.list.combo.js
  15. 2
      src/widget/multitree/trigger/searcher.list.multi.tree.js

4
src/case/editor/editor.state.js

@ -21,8 +21,8 @@ BI.StateEditor = BI.inherit(BI.Widget, {
watermark: "",
errorText: "",
height: 24,
defaultText: "", // 默认显示值,默认显示值与显示值的区别是默认显示值标记灰色
text: BI.i18nText("BI-Basic_Unrestricted"), // 显示值
defaultText: BI.i18nText("BI-Basic_Unrestricted"), // 默认显示值,默认显示值与显示值的区别是默认显示值标记灰色
text: "", // 显示值
el: {}
});
},

3
src/case/editor/editor.state.simple.js

@ -22,7 +22,8 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
watermark: "",
errorText: "",
height: 24,
text: BI.i18nText("BI-Basic_Unrestricted")
text: "",
defaultText: BI.i18nText("BI-Basic_Unrestricted"),
});
},

11
src/case/trigger/trigger.text.select.js

@ -53,7 +53,16 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
_digest: function (val, items) {
var o = this.options;
val = BI.isArray(val) ? val[0] : val;
// 提升valueFormatter的优先级
if (o.valueFormatter !== BI.emptyFn && BI.isFunction(o.valueFormatter)) {
return {
text: o.valueFormatter(val),
};
}
var result = [];
var formatItems = BI.Tree.transformToArrayFormat(items);
BI.each(formatItems, function (i, item) {
if (val === item.value && !BI.contains(result, item.text || item.value)) {
@ -64,7 +73,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
if (result.length > 0) {
return {
textCls: "",
text: o.valueFormatter(val) || result.join(","),
text: result.join(","),
};
} else {
var text = BI.isFunction(o.text) ? o.text() : o.text;

1
src/widget/multilayersingletree/multilayersingletree.combo.js

@ -200,6 +200,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
self.textTrigger = _ref;
},
text: o.text,
defaultText: o.defaultText,
height: o.height,
items: o.items,
value: o.value,

2
src/widget/multiselect/multiselect.combo.js

@ -47,7 +47,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
allowEdit: o.allowEdit,
height: o.height - (o.simple ? 1 : 2),
text: o.text,
// adapter: this.popup,
defaultText: o.defaultText,
masker: {
offset: {
left: 0,

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

@ -43,7 +43,7 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
type: "bi.multi_select_trigger",
height: o.height - (o.simple ? 1 : 2),
text: o.text,
// adapter: this.popup,
defaultText: o.defaultText,
masker: {
offset: {
left: 0,

3
src/widget/multiselect/multiselect.insert.combo.js

@ -43,6 +43,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
height: o.height - (o.simple ? 1 : 2),
text: o.text,
watermark: o.watermark,
defaultText: o.defaultText,
// adapter: this.popup,
masker: {
offset: {
@ -55,7 +56,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
valueFormatter: o.valueFormatter,
itemsCreator: BI.bind(this._itemsCreator4Trigger, this),
itemHeight: o.itemHeight,
value: o.value
value: this.storeValue,
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_FOCUS, function () {

1
src/widget/multiselect/multiselect.insert.trigger.js

@ -37,6 +37,7 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
type: "bi.multi_select_insert_searcher",
height: o.height,
text: o.text,
defaultText: o.defaultText,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
itemHeight: o.itemHeight,

2
src/widget/multiselect/trigger/editor/editor.patch.js

@ -30,7 +30,7 @@ BI.SelectPatchEditor = BI.inherit(BI.Widget, {
watermark: o.watermark,
allowBlank: true,
value: o.value,
defaultText: o.text,
defaultText: o.defaultText,
text: o.text,
tipType: o.tipType,
warningTitle: o.warningTitle,

2
src/widget/multiselect/trigger/searcher.multiselect.insert.js

@ -16,7 +16,6 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
valueFormatter: BI.emptyFn,
adapter: null,
masker: {},
text: BI.i18nText("BI-Basic_Please_Select"),
watermark: BI.i18nText("BI-Basic_Search_And_Patch_Paste"),
});
},
@ -29,6 +28,7 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
watermark: o.watermark,
height: o.height,
text: o.text,
defaultText: o.defaultText,
listeners: [{
eventName: BI.MultiSelectEditor.EVENT_FOCUS,
action: function () {

2
src/widget/multiselect/trigger/searcher.multiselect.js

@ -15,7 +15,7 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
valueFormatter: BI.emptyFn,
adapter: null,
masker: {},
text: BI.i18nText("BI-Basic_Please_Select"),
defaultText: BI.i18nText("BI-Basic_Please_Select"),
itemHeight: 24
});
},

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

@ -32,7 +32,6 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
text: o.text,
defaultText: o.defaultText,
watermark: o.watermark,
// adapter: this.popup,
masker: {
offset: {
left: 0,

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

@ -30,7 +30,9 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
allowEdit: o.allowEdit,
height: o.height - (o.simple ? 1 : 2),
valueFormatter: o.valueFormatter,
// adapter: this.popup,
text: o.text,
defaultText: o.defaultText,
watermark: o.watermark,
masker: {
offset: {
left: 0,
@ -41,8 +43,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
},
searcher: {
type: "bi.multi_tree_searcher",
text: o.text,
watermark: o.watermark,
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",

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

@ -15,7 +15,6 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
allowInsertValue: true,
isNeedAdjustWidth: true,
text: "",
defaultText: "",
});
},
@ -35,7 +34,6 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
watermark: o.watermark,
height: o.height - (o.simple ? 1 : 2),
valueFormatter: o.valueFormatter,
// adapter: this.popup,
masker: {
offset: {
left: 0,
@ -77,8 +75,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
itemsCreator: o.itemsCreator
}
},
value: { value: o.value || {} }
value: this.storeValue
});
this.combo = BI.createWidget({
@ -142,7 +139,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
maxWidth: o.isNeedAdjustWidth ? "auto" : 500,
},
isNeedAdjustWidth: o.isNeedAdjustWidth,
value: { value: o.value || {} },
value: this.storeValue,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0 &&
self.numberCounter.element.find(e.target).length === 0;

2
src/widget/multitree/trigger/searcher.list.multi.tree.js

@ -8,7 +8,7 @@ BI.MultiListTreeSearcher = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiListTreeSearcher.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-tree-searcher",
baseCls: "bi-multi-list-tree-searcher",
itemsCreator: BI.emptyFn,
valueFormatter: function (v) {
return v;

Loading…
Cancel
Save