Browse Source

Merge pull request #140 in FUI/fineui from ~GUY/fineui:master to master

* commit '2b8e3a03af5efdfa40c004ba1858e8964ecec2de':
  年月,季度值为空
  update
  update
master
guy 7 years ago
parent
commit
c07479c03e
  1. 4
      bi/base.js
  2. 6
      bi/core.js
  3. 12
      bi/widget.js
  4. 32
      demo/js/core/abstract/demo.virtual_group.js
  5. 4
      dist/base.js
  6. 22
      dist/bundle.js
  7. 20
      dist/bundle.min.js
  8. 6
      dist/core.js
  9. 32
      dist/demo.js
  10. 12
      dist/widget.js
  11. 4
      src/base/combination/group.virtual.js
  12. 4
      src/core/wrapper/layout.js
  13. 2
      src/core/wrapper/layout/layout.horizontal.js
  14. 2
      src/widget/editor/editor.text.js
  15. 6
      src/widget/month/trigger.month.js
  16. 1
      src/widget/multidate/multidate.segment.js
  17. 1
      src/widget/quarter/trigger.quarter.js
  18. 2
      src/widget/year/combo.year.js

4
bi/base.js

@ -3904,10 +3904,6 @@ BI.shortcut("bi.combo_group", BI.ComboGroup);BI.VirtualGroup = BI.inherit(BI.Wid
return this.layouts.getValue();
},
empty: function () {
this.layouts.empty();
},
populate: function (items) {
var self = this;
items = items || [];

6
bi/core.js

@ -11527,9 +11527,9 @@ BI.Layout = BI.inherit(BI.Widget, {
})
},
update: function (item) {
update: function (opt) {
var o = this.options;
var items = item.items || [];
var items = opt.items || [];
var updated, i, len;
for (i = 0, len = Math.min(o.items.length, items.length); i < len; i++) {
if (!this._compare(o.items[i], items[i])) {
@ -13881,7 +13881,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-layout",
verticalAlign: "middle",
verticalAlign: BI.VerticalAlign.Top,
columnSize: [],
scrollx: true,
hgap: 0,

12
bi/widget.js

@ -4275,6 +4275,8 @@ BI.TextEditor = BI.inherit(BI.Widget, {
tgap: o.tgap,
bgap: o.bgap,
value: o.value,
title: o.title,
tipType: o.tipType,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
@ -5930,9 +5932,9 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
this.editor.setTitle(v + 1);
return;
}
this.editor.setState();
this.editor.setValue();
this.editor.setTitle();
this.editor.setState("");
this.editor.setValue("");
this.editor.setTitle("");
},
getKey: function () {
return this.editor.getValue() | 0;
@ -6870,6 +6872,7 @@ BI.MultiDateSegment = BI.inherit(BI.Single, {
title: function () {
return self.textEditor.getValue();
},
tipType: "success",
cls: 'bi-multidate-editor',
width: this.constants.textWidth,
height: this.constants.itemHeight
@ -13382,6 +13385,7 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
},
setValue: function (v) {
v = v || "";
this.editor.setState(v);
this.editor.setValue(v);
this.editor.setTitle(v);
@ -16019,7 +16023,7 @@ BI.YearCombo = BI.inherit(BI.Widget, {
},
setValue: function (v) {
this.combo.setValue(v);
this.combo.setValue(v || "");
},
getValue: function () {

32
demo/js/core/abstract/demo.virtual_group.js

@ -4,7 +4,7 @@ Demo.Func = BI.inherit(BI.Widget, {
},
_createItems: function () {
var items = BI.makeArray(100, {
var items = BI.makeArray(1000, {
type: "demo.virtual_group_item"
});
items[0].value = BI.UUID();
@ -17,11 +17,33 @@ Demo.Func = BI.inherit(BI.Widget, {
type: "bi.vertical",
vgap: 20,
items: [{
type: "bi.button_group",
width: 500,
height: 300,
ref: function () {
self.buttonGroup = this;
},
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
layouts: [{
type: "bi.vertical"
}, {
type: "bi.center_adapt",
}],
items: this._createItems()
}, {
type: "bi.button",
text: "演示button_group的刷新",
handler: function () {
var items = self._createItems();
items.pop();
self.buttonGroup.populate(items);
}
}, {
type: "bi.virtual_group",
width: 500,
height: 300,
ref: function () {
self.buttonMap = this;
self.virtualGroup = this;
},
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
layouts: [{
@ -32,11 +54,11 @@ Demo.Func = BI.inherit(BI.Widget, {
items: this._createItems()
}, {
type: "bi.button",
text: "点击刷新",
text: "演示virtual_group的刷新",
handler: function () {
var items = self._createItems();
items.pop();
self.buttonMap.populate(items);
self.virtualGroup.populate(items);
}
}]
@ -66,7 +88,7 @@ Demo.Item = BI.inherit(BI.Widget, {
update: function (item) {
this.label.setText(item.value);
console.log("更新了一项");
return true;
return true;//返回是不是更新成功
},
created: function () {

4
dist/base.js vendored

@ -3904,10 +3904,6 @@ BI.shortcut("bi.combo_group", BI.ComboGroup);BI.VirtualGroup = BI.inherit(BI.Wid
return this.layouts.getValue();
},
empty: function () {
this.layouts.empty();
},
populate: function (items) {
var self = this;
items = items || [];

22
dist/bundle.js vendored

@ -19883,9 +19883,9 @@ BI.Layout = BI.inherit(BI.Widget, {
})
},
update: function (item) {
update: function (opt) {
var o = this.options;
var items = item.items || [];
var items = opt.items || [];
var updated, i, len;
for (i = 0, len = Math.min(o.items.length, items.length); i < len; i++) {
if (!this._compare(o.items[i], items[i])) {
@ -27440,7 +27440,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-layout",
verticalAlign: "middle",
verticalAlign: BI.VerticalAlign.Top,
columnSize: [],
scrollx: true,
hgap: 0,
@ -32775,10 +32775,6 @@ BI.shortcut("bi.combo_group", BI.ComboGroup);BI.VirtualGroup = BI.inherit(BI.Wid
return this.layouts.getValue();
},
empty: function () {
this.layouts.empty();
},
populate: function (items) {
var self = this;
items = items || [];
@ -82604,6 +82600,8 @@ BI.TextEditor = BI.inherit(BI.Widget, {
tgap: o.tgap,
bgap: o.bgap,
value: o.value,
title: o.title,
tipType: o.tipType,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
@ -84259,9 +84257,9 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
this.editor.setTitle(v + 1);
return;
}
this.editor.setState();
this.editor.setValue();
this.editor.setTitle();
this.editor.setState("");
this.editor.setValue("");
this.editor.setTitle("");
},
getKey: function () {
return this.editor.getValue() | 0;
@ -85199,6 +85197,7 @@ BI.MultiDateSegment = BI.inherit(BI.Single, {
title: function () {
return self.textEditor.getValue();
},
tipType: "success",
cls: 'bi-multidate-editor',
width: this.constants.textWidth,
height: this.constants.itemHeight
@ -91711,6 +91710,7 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
},
setValue: function (v) {
v = v || "";
this.editor.setState(v);
this.editor.setValue(v);
this.editor.setTitle(v);
@ -94348,7 +94348,7 @@ BI.YearCombo = BI.inherit(BI.Widget, {
},
setValue: function (v) {
this.combo.setValue(v);
this.combo.setValue(v || "");
},
getValue: function () {

20
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

6
dist/core.js vendored

@ -19832,9 +19832,9 @@ BI.Layout = BI.inherit(BI.Widget, {
})
},
update: function (item) {
update: function (opt) {
var o = this.options;
var items = item.items || [];
var items = opt.items || [];
var updated, i, len;
for (i = 0, len = Math.min(o.items.length, items.length); i < len; i++) {
if (!this._compare(o.items[i], items[i])) {
@ -27389,7 +27389,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-layout",
verticalAlign: "middle",
verticalAlign: BI.VerticalAlign.Top,
columnSize: [],
scrollx: true,
hgap: 0,

32
dist/demo.js vendored

@ -6872,7 +6872,7 @@ BI.shortcut("demo.list_view", Demo.Func);Demo.Func = BI.inherit(BI.Widget, {
},
_createItems: function () {
var items = BI.makeArray(100, {
var items = BI.makeArray(1000, {
type: "demo.virtual_group_item"
});
items[0].value = BI.UUID();
@ -6885,11 +6885,33 @@ BI.shortcut("demo.list_view", Demo.Func);Demo.Func = BI.inherit(BI.Widget, {
type: "bi.vertical",
vgap: 20,
items: [{
type: "bi.button_group",
width: 500,
height: 300,
ref: function () {
self.buttonGroup = this;
},
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
layouts: [{
type: "bi.vertical"
}, {
type: "bi.center_adapt",
}],
items: this._createItems()
}, {
type: "bi.button",
text: "演示button_group的刷新",
handler: function () {
var items = self._createItems();
items.pop();
self.buttonGroup.populate(items);
}
}, {
type: "bi.virtual_group",
width: 500,
height: 300,
ref: function () {
self.buttonMap = this;
self.virtualGroup = this;
},
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
layouts: [{
@ -6900,11 +6922,11 @@ BI.shortcut("demo.list_view", Demo.Func);Demo.Func = BI.inherit(BI.Widget, {
items: this._createItems()
}, {
type: "bi.button",
text: "点击刷新",
text: "演示virtual_group的刷新",
handler: function () {
var items = self._createItems();
items.pop();
self.buttonMap.populate(items);
self.virtualGroup.populate(items);
}
}]
@ -6934,7 +6956,7 @@ Demo.Item = BI.inherit(BI.Widget, {
update: function (item) {
this.label.setText(item.value);
console.log("更新了一项");
return true;
return true;//返回是不是更新成功
},
created: function () {

12
dist/widget.js vendored

@ -4275,6 +4275,8 @@ BI.TextEditor = BI.inherit(BI.Widget, {
tgap: o.tgap,
bgap: o.bgap,
value: o.value,
title: o.title,
tipType: o.tipType,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
@ -5930,9 +5932,9 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
this.editor.setTitle(v + 1);
return;
}
this.editor.setState();
this.editor.setValue();
this.editor.setTitle();
this.editor.setState("");
this.editor.setValue("");
this.editor.setTitle("");
},
getKey: function () {
return this.editor.getValue() | 0;
@ -6870,6 +6872,7 @@ BI.MultiDateSegment = BI.inherit(BI.Single, {
title: function () {
return self.textEditor.getValue();
},
tipType: "success",
cls: 'bi-multidate-editor',
width: this.constants.textWidth,
height: this.constants.itemHeight
@ -13382,6 +13385,7 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
},
setValue: function (v) {
v = v || "";
this.editor.setState(v);
this.editor.setValue(v);
this.editor.setTitle(v);
@ -16019,7 +16023,7 @@ BI.YearCombo = BI.inherit(BI.Widget, {
},
setValue: function (v) {
this.combo.setValue(v);
this.combo.setValue(v || "");
},
getValue: function () {

4
src/base/combination/group.virtual.js

@ -63,10 +63,6 @@ BI.VirtualGroup = BI.inherit(BI.Widget, {
return this.layouts.getValue();
},
empty: function () {
this.layouts.empty();
},
populate: function (items) {
var self = this;
items = items || [];

4
src/core/wrapper/layout.js

@ -347,9 +347,9 @@ BI.Layout = BI.inherit(BI.Widget, {
})
},
update: function (item) {
update: function (opt) {
var o = this.options;
var items = item.items || [];
var items = opt.items || [];
var updated, i, len;
for (i = 0, len = Math.min(o.items.length, items.length); i < len; i++) {
if (!this._compare(o.items[i], items[i])) {

2
src/core/wrapper/layout/layout.horizontal.js

@ -7,7 +7,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-layout",
verticalAlign: "middle",
verticalAlign: BI.VerticalAlign.Top,
columnSize: [],
scrollx: true,
hgap: 0,

2
src/widget/editor/editor.text.js

@ -42,6 +42,8 @@ BI.TextEditor = BI.inherit(BI.Widget, {
tgap: o.tgap,
bgap: o.bgap,
value: o.value,
title: o.title,
tipType: o.tipType,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,

6
src/widget/month/trigger.month.js

@ -92,9 +92,9 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
this.editor.setTitle(v + 1);
return;
}
this.editor.setState();
this.editor.setValue();
this.editor.setTitle();
this.editor.setState("");
this.editor.setValue("");
this.editor.setTitle("");
},
getKey: function () {
return this.editor.getValue() | 0;

1
src/widget/multidate/multidate.segment.js

@ -41,6 +41,7 @@ BI.MultiDateSegment = BI.inherit(BI.Single, {
title: function () {
return self.textEditor.getValue();
},
tipType: "success",
cls: 'bi-multidate-editor',
width: this.constants.textWidth,
height: this.constants.itemHeight

1
src/widget/quarter/trigger.quarter.js

@ -89,6 +89,7 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
},
setValue: function (v) {
v = v || "";
this.editor.setState(v);
this.editor.setValue(v);
this.editor.setTitle(v);

2
src/widget/year/combo.year.js

@ -91,7 +91,7 @@ BI.YearCombo = BI.inherit(BI.Widget, {
},
setValue: function (v) {
this.combo.setValue(v);
this.combo.setValue(v || "");
},
getValue: function () {

Loading…
Cancel
Save