Browse Source

Merge pull request #365 in FUI/fineui from ~WINDY/fui:master to master

* commit 'c1ab7cc6ce570c1dda75163e6a4b0d79d92e99d0':
  update
  BI-19190 && BI-18718 && BI-18671
  update
master
guy 7 years ago
parent
commit
427d6a94dd
  1. 44
      dist/_fineui.min.js
  2. 96
      dist/bundle.js
  3. 34
      dist/bundle.min.js
  4. 3
      dist/case.js
  5. 44
      dist/fineui.min.js
  6. 93
      dist/widget.js
  7. 3
      src/case/button/item.singleselect.radio.js
  8. 2
      src/widget/multiselect/multiselect..insert.combo.js
  9. 2
      src/widget/multiselect/multiselect.combo.js
  10. 2
      src/widget/multiselectlist/multiselectlist.insert.js
  11. 2
      src/widget/multiselectlist/multiselectlist.js
  12. 2
      src/widget/singleselect/search/singleselect.search.loader.js
  13. 1
      src/widget/singleselect/singleselect.combo.js
  14. 68
      src/widget/singleselect/singleselect.item.js
  15. 2
      src/widget/singleselect/singleselect.loader.js
  16. 2
      src/widget/singleselectaddsearch/search/singleselect.search.loader.js
  17. 2
      src/widget/yearmonth/card.static.yearmonth.js
  18. 2
      src/widget/yearmonth/combo.yearmonth.js
  19. 2
      src/widget/yearmonth/trigger.yearmonth.js
  20. 1
      src/widget/yearmonthinterval/yearmonthinterval.js
  21. 2
      src/widget/yearquarter/card.static.yearquarter.js
  22. 2
      src/widget/yearquarter/combo.yearquarter.js

44
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

96
dist/bundle.js vendored

@ -72791,9 +72791,6 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, {
this.radio = BI.createWidget({ this.radio = BI.createWidget({
type: "bi.radio" type: "bi.radio"
}); });
this.radio.on(BI.Controller.EVENT_CHANGE, function (type) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.text = BI.createWidget({ this.text = BI.createWidget({
type: "bi.label", type: "bi.label",
cls: "list-item-text", cls: "list-item-text",
@ -97203,7 +97200,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
}); });
BI.extend(BI.MultiSelectInsertCombo, { BI.extend(BI.MultiSelectInsertCombo, {
REQ_GET_DATA_LENGTH: 0, REQ_GET_DATA_LENGTH: 1,
REQ_GET_ALL_DATA: -1 REQ_GET_ALL_DATA: -1
}); });
@ -97584,7 +97581,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
}); });
BI.extend(BI.MultiSelectCombo, { BI.extend(BI.MultiSelectCombo, {
REQ_GET_DATA_LENGTH: 0, REQ_GET_DATA_LENGTH: 1,
REQ_GET_ALL_DATA: -1 REQ_GET_ALL_DATA: -1
}); });
@ -99007,7 +99004,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Widget, {
}); });
BI.extend(BI.MultiSelectInsertList, { BI.extend(BI.MultiSelectInsertList, {
REQ_GET_DATA_LENGTH: 0, REQ_GET_DATA_LENGTH: 1,
REQ_GET_ALL_DATA: -1 REQ_GET_ALL_DATA: -1
}); });
@ -99351,7 +99348,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
}); });
BI.extend(BI.MultiSelectList, { BI.extend(BI.MultiSelectList, {
REQ_GET_DATA_LENGTH: 0, REQ_GET_DATA_LENGTH: 1,
REQ_GET_ALL_DATA: -1 REQ_GET_ALL_DATA: -1
}); });
@ -103372,7 +103369,7 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
_createItems: function (items) { _createItems: function (items) {
return BI.createItems(items, { return BI.createItems(items, {
type: "bi.single_select_radio_item", type: "bi.single_select_combo.item",
logic: { logic: {
dynamic: false dynamic: false
}, },
@ -103631,6 +103628,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
this.trigger.on(BI.SingleSelectTrigger.EVENT_CHANGE, function (value, obj) { this.trigger.on(BI.SingleSelectTrigger.EVENT_CHANGE, function (value, obj) {
self.storeValue = this.getValue(); self.storeValue = this.getValue();
assertShowValue(); assertShowValue();
self._defaultState();
}); });
this.trigger.on(BI.SingleSelectTrigger.EVENT_COUNTER_CLICK, function () { this.trigger.on(BI.SingleSelectTrigger.EVENT_COUNTER_CLICK, function () {
if (!self.combo.isViewVisible()) { if (!self.combo.isViewVisible()) {
@ -103879,6 +103877,73 @@ BI.SingleSelectCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.single_select_combo", BI.SingleSelectCombo); BI.shortcut("bi.single_select_combo", BI.SingleSelectCombo);
/** /**
* guy
* 单选框item
* @type {*|void|Object}
*/
BI.SingleSelectComboItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectComboItem.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-single-select-radio-item",
logic: {
dynamic: false
},
hgap: 10,
height: 25
});
},
_init: function () {
BI.SingleSelectComboItem.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.radio = BI.createWidget({
type: "bi.radio"
});
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", {
type: "bi.center_adapt",
items: [this.radio],
width: 36
}, this.text)
}))));
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.SingleSelectComboItem.superclass.doClick.apply(this, arguments);
this.radio.setSelected(this.isSelected());
},
setSelected: function (v) {
BI.SingleSelectComboItem.superclass.setSelected.apply(this, arguments);
this.radio.setSelected(v);
}
});
BI.shortcut("bi.single_select_combo.item", BI.SingleSelectComboItem);/**
* 选择列表 * 选择列表
* *
* Created by GUY on 2015/11/1. * Created by GUY on 2015/11/1.
@ -104109,7 +104174,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
_createItems: function (items) { _createItems: function (items) {
return BI.createItems(items, { return BI.createItems(items, {
type: "bi.single_select_radio_item", type: "bi.single_select_combo.item",
logic: this.options.logic, logic: this.options.logic,
height: 25, height: 25,
selected: false selected: false
@ -105002,7 +105067,7 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
_createItems: function (items) { _createItems: function (items) {
return BI.createItems(items, { return BI.createItems(items, {
type: "bi.single_select_radio_item", type: "bi.single_select_combo.item",
logic: { logic: {
dynamic: false dynamic: false
}, },
@ -108465,7 +108530,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear
obj.year = obj.year || 0; obj.year = obj.year || 0;
obj.month = obj.month || 0; obj.month = obj.month || 0;
if (obj.year === 0 || obj.month === 0 || BI.checkDateVoid(obj.year, obj.month, 1, o.min, o.max)[0]) { if (obj.year === 0 || obj.month === 0 || BI.checkDateVoid(obj.year, obj.month, 1, o.min, o.max)[0]) {
var year = BI.getDate().getFullYear(); var year = obj.year || BI.getDate().getFullYear();
this.selectedYear = year; this.selectedYear = year;
this.selectedMonth = ""; this.selectedMonth = "";
this.yearPicker.setValue(year); this.yearPicker.setValue(year);
@ -108566,7 +108631,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
eventName: BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE, eventName: BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE,
action: function () { action: function () {
var date = BI.getDate(); var date = BI.getDate();
self.setValue({year: date.getFullYear(), month: date.getMonth() + 1}); self.setValue({type: BI.DynamicYearMonthCombo.Static, value: {year: date.getFullYear(), month: date.getMonth() + 1}});
self.combo.hideView(); self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
} }
@ -109079,7 +109144,7 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
return this.yearEditor.isValid() && this.monthEditor.isValid(); return this.yearEditor.isValid() && this.monthEditor.isValid();
} }
}); });
BI.DynamicYearMonthTrigger.EVENT_VALID = "EVENT_FOCUS"; BI.DynamicYearMonthTrigger.EVENT_VALID = "EVENT_VALID";
BI.DynamicYearMonthTrigger.EVENT_FOCUS = "EVENT_FOCUS"; BI.DynamicYearMonthTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicYearMonthTrigger.EVENT_ERROR = "EVENT_ERROR"; BI.DynamicYearMonthTrigger.EVENT_ERROR = "EVENT_ERROR";
BI.DynamicYearMonthTrigger.EVENT_START = "EVENT_START"; BI.DynamicYearMonthTrigger.EVENT_START = "EVENT_START";
@ -109163,6 +109228,7 @@ BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);BI.Year
}); });
combo.on(BI.DynamicYearMonthCombo.EVENT_ERROR, function () { combo.on(BI.DynamicYearMonthCombo.EVENT_ERROR, function () {
self._clearTitle(); self._clearTitle();
BI.Bubbles.hide("error");
self.element.removeClass(self.constants.timeErrorCls); self.element.removeClass(self.constants.timeErrorCls);
self.fireEvent(BI.YearMonthInterval.EVENT_ERROR); self.fireEvent(BI.YearMonthInterval.EVENT_ERROR);
}); });
@ -109442,7 +109508,7 @@ BI.shortcut("bi.dynamic_year_quarter_card", BI.DynamicYearQuarterCard);BI.Static
obj.year = obj.year || 0; obj.year = obj.year || 0;
obj.quarter = obj.quarter || 0; obj.quarter = obj.quarter || 0;
if (obj.quarter === 0 || obj.year === 0 || BI.checkDateVoid(obj.year, obj.quarter, 1, o.min, o.max)[0]) { if (obj.quarter === 0 || obj.year === 0 || BI.checkDateVoid(obj.year, obj.quarter, 1, o.min, o.max)[0]) {
var year = BI.getDate().getFullYear(); var year = obj.year || BI.getDate().getFullYear();
this.selectedYear = year; this.selectedYear = year;
this.selectedQuarter = ""; this.selectedQuarter = "";
this.yearPicker.setValue(year); this.yearPicker.setValue(year);
@ -109538,7 +109604,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
eventName: BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE, eventName: BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE,
action: function () { action: function () {
var date = BI.getDate(); var date = BI.getDate();
self.setValue({year: date.getFullYear(), quarter: date.getQuarter()}); self.setValue({type: BI.DynamicYearMonthCombo.Static, value: {year: date.getFullYear(), quarter: date.getQuarter()}});
self.combo.hideView(); self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
} }

34
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

3
dist/case.js vendored

@ -342,9 +342,6 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, {
this.radio = BI.createWidget({ this.radio = BI.createWidget({
type: "bi.radio" type: "bi.radio"
}); });
this.radio.on(BI.Controller.EVENT_CHANGE, function (type) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.text = BI.createWidget({ this.text = BI.createWidget({
type: "bi.label", type: "bi.label",
cls: "list-item-text", cls: "list-item-text",

44
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

93
dist/widget.js vendored

@ -10044,7 +10044,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
}); });
BI.extend(BI.MultiSelectInsertCombo, { BI.extend(BI.MultiSelectInsertCombo, {
REQ_GET_DATA_LENGTH: 0, REQ_GET_DATA_LENGTH: 1,
REQ_GET_ALL_DATA: -1 REQ_GET_ALL_DATA: -1
}); });
@ -10425,7 +10425,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
}); });
BI.extend(BI.MultiSelectCombo, { BI.extend(BI.MultiSelectCombo, {
REQ_GET_DATA_LENGTH: 0, REQ_GET_DATA_LENGTH: 1,
REQ_GET_ALL_DATA: -1 REQ_GET_ALL_DATA: -1
}); });
@ -11848,7 +11848,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Widget, {
}); });
BI.extend(BI.MultiSelectInsertList, { BI.extend(BI.MultiSelectInsertList, {
REQ_GET_DATA_LENGTH: 0, REQ_GET_DATA_LENGTH: 1,
REQ_GET_ALL_DATA: -1 REQ_GET_ALL_DATA: -1
}); });
@ -12192,7 +12192,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
}); });
BI.extend(BI.MultiSelectList, { BI.extend(BI.MultiSelectList, {
REQ_GET_DATA_LENGTH: 0, REQ_GET_DATA_LENGTH: 1,
REQ_GET_ALL_DATA: -1 REQ_GET_ALL_DATA: -1
}); });
@ -16213,7 +16213,7 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
_createItems: function (items) { _createItems: function (items) {
return BI.createItems(items, { return BI.createItems(items, {
type: "bi.single_select_radio_item", type: "bi.single_select_combo.item",
logic: { logic: {
dynamic: false dynamic: false
}, },
@ -16472,6 +16472,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
this.trigger.on(BI.SingleSelectTrigger.EVENT_CHANGE, function (value, obj) { this.trigger.on(BI.SingleSelectTrigger.EVENT_CHANGE, function (value, obj) {
self.storeValue = this.getValue(); self.storeValue = this.getValue();
assertShowValue(); assertShowValue();
self._defaultState();
}); });
this.trigger.on(BI.SingleSelectTrigger.EVENT_COUNTER_CLICK, function () { this.trigger.on(BI.SingleSelectTrigger.EVENT_COUNTER_CLICK, function () {
if (!self.combo.isViewVisible()) { if (!self.combo.isViewVisible()) {
@ -16720,6 +16721,73 @@ BI.SingleSelectCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.single_select_combo", BI.SingleSelectCombo); BI.shortcut("bi.single_select_combo", BI.SingleSelectCombo);
/** /**
* guy
* 单选框item
* @type {*|void|Object}
*/
BI.SingleSelectComboItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectComboItem.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-single-select-radio-item",
logic: {
dynamic: false
},
hgap: 10,
height: 25
});
},
_init: function () {
BI.SingleSelectComboItem.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.radio = BI.createWidget({
type: "bi.radio"
});
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", {
type: "bi.center_adapt",
items: [this.radio],
width: 36
}, this.text)
}))));
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.SingleSelectComboItem.superclass.doClick.apply(this, arguments);
this.radio.setSelected(this.isSelected());
},
setSelected: function (v) {
BI.SingleSelectComboItem.superclass.setSelected.apply(this, arguments);
this.radio.setSelected(v);
}
});
BI.shortcut("bi.single_select_combo.item", BI.SingleSelectComboItem);/**
* 选择列表 * 选择列表
* *
* Created by GUY on 2015/11/1. * Created by GUY on 2015/11/1.
@ -16950,7 +17018,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
_createItems: function (items) { _createItems: function (items) {
return BI.createItems(items, { return BI.createItems(items, {
type: "bi.single_select_radio_item", type: "bi.single_select_combo.item",
logic: this.options.logic, logic: this.options.logic,
height: 25, height: 25,
selected: false selected: false
@ -17843,7 +17911,7 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
_createItems: function (items) { _createItems: function (items) {
return BI.createItems(items, { return BI.createItems(items, {
type: "bi.single_select_radio_item", type: "bi.single_select_combo.item",
logic: { logic: {
dynamic: false dynamic: false
}, },
@ -21306,7 +21374,7 @@ BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);BI.StaticYear
obj.year = obj.year || 0; obj.year = obj.year || 0;
obj.month = obj.month || 0; obj.month = obj.month || 0;
if (obj.year === 0 || obj.month === 0 || BI.checkDateVoid(obj.year, obj.month, 1, o.min, o.max)[0]) { if (obj.year === 0 || obj.month === 0 || BI.checkDateVoid(obj.year, obj.month, 1, o.min, o.max)[0]) {
var year = BI.getDate().getFullYear(); var year = obj.year || BI.getDate().getFullYear();
this.selectedYear = year; this.selectedYear = year;
this.selectedMonth = ""; this.selectedMonth = "";
this.yearPicker.setValue(year); this.yearPicker.setValue(year);
@ -21407,7 +21475,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
eventName: BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE, eventName: BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE,
action: function () { action: function () {
var date = BI.getDate(); var date = BI.getDate();
self.setValue({year: date.getFullYear(), month: date.getMonth() + 1}); self.setValue({type: BI.DynamicYearMonthCombo.Static, value: {year: date.getFullYear(), month: date.getMonth() + 1}});
self.combo.hideView(); self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
} }
@ -21920,7 +21988,7 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
return this.yearEditor.isValid() && this.monthEditor.isValid(); return this.yearEditor.isValid() && this.monthEditor.isValid();
} }
}); });
BI.DynamicYearMonthTrigger.EVENT_VALID = "EVENT_FOCUS"; BI.DynamicYearMonthTrigger.EVENT_VALID = "EVENT_VALID";
BI.DynamicYearMonthTrigger.EVENT_FOCUS = "EVENT_FOCUS"; BI.DynamicYearMonthTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicYearMonthTrigger.EVENT_ERROR = "EVENT_ERROR"; BI.DynamicYearMonthTrigger.EVENT_ERROR = "EVENT_ERROR";
BI.DynamicYearMonthTrigger.EVENT_START = "EVENT_START"; BI.DynamicYearMonthTrigger.EVENT_START = "EVENT_START";
@ -22004,6 +22072,7 @@ BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);BI.Year
}); });
combo.on(BI.DynamicYearMonthCombo.EVENT_ERROR, function () { combo.on(BI.DynamicYearMonthCombo.EVENT_ERROR, function () {
self._clearTitle(); self._clearTitle();
BI.Bubbles.hide("error");
self.element.removeClass(self.constants.timeErrorCls); self.element.removeClass(self.constants.timeErrorCls);
self.fireEvent(BI.YearMonthInterval.EVENT_ERROR); self.fireEvent(BI.YearMonthInterval.EVENT_ERROR);
}); });
@ -22283,7 +22352,7 @@ BI.shortcut("bi.dynamic_year_quarter_card", BI.DynamicYearQuarterCard);BI.Static
obj.year = obj.year || 0; obj.year = obj.year || 0;
obj.quarter = obj.quarter || 0; obj.quarter = obj.quarter || 0;
if (obj.quarter === 0 || obj.year === 0 || BI.checkDateVoid(obj.year, obj.quarter, 1, o.min, o.max)[0]) { if (obj.quarter === 0 || obj.year === 0 || BI.checkDateVoid(obj.year, obj.quarter, 1, o.min, o.max)[0]) {
var year = BI.getDate().getFullYear(); var year = obj.year || BI.getDate().getFullYear();
this.selectedYear = year; this.selectedYear = year;
this.selectedQuarter = ""; this.selectedQuarter = "";
this.yearPicker.setValue(year); this.yearPicker.setValue(year);
@ -22379,7 +22448,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
eventName: BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE, eventName: BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE,
action: function () { action: function () {
var date = BI.getDate(); var date = BI.getDate();
self.setValue({year: date.getFullYear(), quarter: date.getQuarter()}); self.setValue({type: BI.DynamicYearMonthCombo.Static, value: {year: date.getFullYear(), quarter: date.getQuarter()}});
self.combo.hideView(); self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
} }

3
src/case/button/item.singleselect.radio.js

@ -20,9 +20,6 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, {
this.radio = BI.createWidget({ this.radio = BI.createWidget({
type: "bi.radio" type: "bi.radio"
}); });
this.radio.on(BI.Controller.EVENT_CHANGE, function (type) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.text = BI.createWidget({ this.text = BI.createWidget({
type: "bi.label", type: "bi.label",
cls: "list-item-text", cls: "list-item-text",

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

@ -350,7 +350,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
}); });
BI.extend(BI.MultiSelectInsertCombo, { BI.extend(BI.MultiSelectInsertCombo, {
REQ_GET_DATA_LENGTH: 0, REQ_GET_DATA_LENGTH: 1,
REQ_GET_ALL_DATA: -1 REQ_GET_ALL_DATA: -1
}); });

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

@ -373,7 +373,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
}); });
BI.extend(BI.MultiSelectCombo, { BI.extend(BI.MultiSelectCombo, {
REQ_GET_DATA_LENGTH: 0, REQ_GET_DATA_LENGTH: 1,
REQ_GET_ALL_DATA: -1 REQ_GET_ALL_DATA: -1
}); });

2
src/widget/multiselectlist/multiselectlist.insert.js

@ -318,7 +318,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Widget, {
}); });
BI.extend(BI.MultiSelectInsertList, { BI.extend(BI.MultiSelectInsertList, {
REQ_GET_DATA_LENGTH: 0, REQ_GET_DATA_LENGTH: 1,
REQ_GET_ALL_DATA: -1 REQ_GET_ALL_DATA: -1
}); });

2
src/widget/multiselectlist/multiselectlist.js

@ -337,7 +337,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
}); });
BI.extend(BI.MultiSelectList, { BI.extend(BI.MultiSelectList, {
REQ_GET_DATA_LENGTH: 0, REQ_GET_DATA_LENGTH: 1,
REQ_GET_ALL_DATA: -1 REQ_GET_ALL_DATA: -1
}); });

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

@ -90,7 +90,7 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
_createItems: function (items) { _createItems: function (items) {
return BI.createItems(items, { return BI.createItems(items, {
type: "bi.single_select_radio_item", type: "bi.single_select_combo.item",
logic: { logic: {
dynamic: false dynamic: false
}, },

1
src/widget/singleselect/singleselect.combo.js

@ -94,6 +94,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
this.trigger.on(BI.SingleSelectTrigger.EVENT_CHANGE, function (value, obj) { this.trigger.on(BI.SingleSelectTrigger.EVENT_CHANGE, function (value, obj) {
self.storeValue = this.getValue(); self.storeValue = this.getValue();
assertShowValue(); assertShowValue();
self._defaultState();
}); });
this.trigger.on(BI.SingleSelectTrigger.EVENT_COUNTER_CLICK, function () { this.trigger.on(BI.SingleSelectTrigger.EVENT_COUNTER_CLICK, function () {
if (!self.combo.isViewVisible()) { if (!self.combo.isViewVisible()) {

68
src/widget/singleselect/singleselect.item.js

@ -0,0 +1,68 @@
/**
* guy
* 单选框item
* @type {*|void|Object}
*/
BI.SingleSelectComboItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectComboItem.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-single-select-radio-item",
logic: {
dynamic: false
},
hgap: 10,
height: 25
});
},
_init: function () {
BI.SingleSelectComboItem.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.radio = BI.createWidget({
type: "bi.radio"
});
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", {
type: "bi.center_adapt",
items: [this.radio],
width: 36
}, this.text)
}))));
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.SingleSelectComboItem.superclass.doClick.apply(this, arguments);
this.radio.setSelected(this.isSelected());
},
setSelected: function (v) {
BI.SingleSelectComboItem.superclass.setSelected.apply(this, arguments);
this.radio.setSelected(v);
}
});
BI.shortcut("bi.single_select_combo.item", BI.SingleSelectComboItem);

2
src/widget/singleselect/singleselect.loader.js

@ -96,7 +96,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
_createItems: function (items) { _createItems: function (items) {
return BI.createItems(items, { return BI.createItems(items, {
type: "bi.single_select_radio_item", type: "bi.single_select_combo.item",
logic: this.options.logic, logic: this.options.logic,
height: 25, height: 25,
selected: false selected: false

2
src/widget/singleselectaddsearch/search/singleselect.search.loader.js

@ -106,7 +106,7 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
_createItems: function (items) { _createItems: function (items) {
return BI.createItems(items, { return BI.createItems(items, {
type: "bi.single_select_radio_item", type: "bi.single_select_combo.item",
logic: { logic: {
dynamic: false dynamic: false
}, },

2
src/widget/yearmonth/card.static.yearmonth.js

@ -100,7 +100,7 @@ BI.StaticYearMonthCard = BI.inherit(BI.Widget, {
obj.year = obj.year || 0; obj.year = obj.year || 0;
obj.month = obj.month || 0; obj.month = obj.month || 0;
if (obj.year === 0 || obj.month === 0 || BI.checkDateVoid(obj.year, obj.month, 1, o.min, o.max)[0]) { if (obj.year === 0 || obj.month === 0 || BI.checkDateVoid(obj.year, obj.month, 1, o.min, o.max)[0]) {
var year = BI.getDate().getFullYear(); var year = obj.year || BI.getDate().getFullYear();
this.selectedYear = year; this.selectedYear = year;
this.selectedMonth = ""; this.selectedMonth = "";
this.yearPicker.setValue(year); this.yearPicker.setValue(year);

2
src/widget/yearmonth/combo.yearmonth.js

@ -84,7 +84,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
eventName: BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE, eventName: BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE,
action: function () { action: function () {
var date = BI.getDate(); var date = BI.getDate();
self.setValue({year: date.getFullYear(), month: date.getMonth() + 1}); self.setValue({type: BI.DynamicYearMonthCombo.Static, value: {year: date.getFullYear(), month: date.getMonth() + 1}});
self.combo.hideView(); self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
} }

2
src/widget/yearmonth/trigger.yearmonth.js

@ -208,7 +208,7 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, {
return this.yearEditor.isValid() && this.monthEditor.isValid(); return this.yearEditor.isValid() && this.monthEditor.isValid();
} }
}); });
BI.DynamicYearMonthTrigger.EVENT_VALID = "EVENT_FOCUS"; BI.DynamicYearMonthTrigger.EVENT_VALID = "EVENT_VALID";
BI.DynamicYearMonthTrigger.EVENT_FOCUS = "EVENT_FOCUS"; BI.DynamicYearMonthTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicYearMonthTrigger.EVENT_ERROR = "EVENT_ERROR"; BI.DynamicYearMonthTrigger.EVENT_ERROR = "EVENT_ERROR";
BI.DynamicYearMonthTrigger.EVENT_START = "EVENT_START"; BI.DynamicYearMonthTrigger.EVENT_START = "EVENT_START";

1
src/widget/yearmonthinterval/yearmonthinterval.js

@ -75,6 +75,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
}); });
combo.on(BI.DynamicYearMonthCombo.EVENT_ERROR, function () { combo.on(BI.DynamicYearMonthCombo.EVENT_ERROR, function () {
self._clearTitle(); self._clearTitle();
BI.Bubbles.hide("error");
self.element.removeClass(self.constants.timeErrorCls); self.element.removeClass(self.constants.timeErrorCls);
self.fireEvent(BI.YearMonthInterval.EVENT_ERROR); self.fireEvent(BI.YearMonthInterval.EVENT_ERROR);
}); });

2
src/widget/yearquarter/card.static.yearquarter.js

@ -92,7 +92,7 @@ BI.StaticYearQuarterCard = BI.inherit(BI.Widget, {
obj.year = obj.year || 0; obj.year = obj.year || 0;
obj.quarter = obj.quarter || 0; obj.quarter = obj.quarter || 0;
if (obj.quarter === 0 || obj.year === 0 || BI.checkDateVoid(obj.year, obj.quarter, 1, o.min, o.max)[0]) { if (obj.quarter === 0 || obj.year === 0 || BI.checkDateVoid(obj.year, obj.quarter, 1, o.min, o.max)[0]) {
var year = BI.getDate().getFullYear(); var year = obj.year || BI.getDate().getFullYear();
this.selectedYear = year; this.selectedYear = year;
this.selectedQuarter = ""; this.selectedQuarter = "";
this.yearPicker.setValue(year); this.yearPicker.setValue(year);

2
src/widget/yearquarter/combo.yearquarter.js

@ -79,7 +79,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
eventName: BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE, eventName: BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE,
action: function () { action: function () {
var date = BI.getDate(); var date = BI.getDate();
self.setValue({year: date.getFullYear(), quarter: date.getQuarter()}); self.setValue({type: BI.DynamicYearMonthCombo.Static, value: {year: date.getFullYear(), quarter: date.getQuarter()}});
self.combo.hideView(); self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM); self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
} }

Loading…
Cancel
Save