guy 7 years ago
parent
commit
b9b8867882
  1. 28
      demo/js/case/combo/demo.bubble_combo.js
  2. 8
      dist/bundle.js
  3. 20
      dist/bundle.min.js
  4. 28
      dist/demo.js

28
demo/js/case/combo/demo.bubble_combo.js

@ -2,38 +2,12 @@ Demo.Func = BI.inherit(BI.Widget, {
props: { props: {
baseCls: "demo-func" baseCls: "demo-func"
}, },
_createNav: function(v){
var m = this.MONTH, y = this.YEAR;
m += v;
while(m < 0){
y--;
m += 12;
}
while(m > 11){
y++;
m -= 12;
}
var calendar = BI.createWidget({
type: "bi.calendar",
logic: {
dynamic: false
},
year: y,
month: m,
day: this.DAY
})
calendar.setValue(this.selectedTime);
return calendar;
},
_stringfyTimeObject: function(timeOb){
return timeOb.year + "-" + (timeOb.month + 1) + "-" + timeOb.day;
},
render: function () { render: function () {
var self = this; var self = this;
var combo1 = BI.createWidget({ var combo1 = BI.createWidget({
type: "bi.bubble_combo", type: "bi.bubble_combo",
trigger: "click,hover",
el: { el: {
type: "bi.button", type: "bi.button",
text: "测试", text: "测试",

8
dist/bundle.js vendored

@ -15901,7 +15901,7 @@ BI.View.registerVMRouter = function (viewRouter, modelRouter) {
}; };
BI.createWidget = function (item, options) { BI.createWidget = function (item, options) {
var el; var el, w;
options || (options = {}); options || (options = {});
if (BI.isEmpty(item) && BI.isEmpty(options)) { if (BI.isEmpty(item) && BI.isEmpty(options)) {
return BI.createWidget({ return BI.createWidget({
@ -15913,11 +15913,13 @@ BI.View.registerVMRouter = function (viewRouter, modelRouter) {
} }
if (item && (item.type || options.type)) { if (item && (item.type || options.type)) {
el = BI.extend({}, options, item); el = BI.extend({}, options, item);
return BI.Plugin.getObject(el.type, createWidget(BI.Plugin.getWidget(el.type, el))); w = BI.Plugin.getWidget(el.type, el);
return BI.Plugin.getObject(el.type, w.type === el.type ? createWidget(w) : BI.createWidget(BI.extend({}, item, {type: w.type}, options)));
} }
if (item && item.el && (item.el.type || options.type)) { if (item && item.el && (item.el.type || options.type)) {
el = BI.extend({}, options, item.el); el = BI.extend({}, options, item.el);
return BI.Plugin.getObject(el.type, createWidget(BI.Plugin.getWidget(el.type, el))); w = BI.Plugin.getWidget(el.type, el);
return BI.Plugin.getObject(el.type, w.type === el.type ? createWidget(w) : BI.createWidget(BI.extend({}, item, {type: w.type}, options)));
} }
if (item && BI.isWidget(item.el)) { if (item && BI.isWidget(item.el)) {
return item.el; return item.el;

20
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

28
dist/demo.js vendored

@ -1746,38 +1746,12 @@ BI.shortcut("demo.tree_view", Demo.Func);Demo.Func = BI.inherit(BI.Widget, {
props: { props: {
baseCls: "demo-func" baseCls: "demo-func"
}, },
_createNav: function(v){
var m = this.MONTH, y = this.YEAR;
m += v;
while(m < 0){
y--;
m += 12;
}
while(m > 11){
y++;
m -= 12;
}
var calendar = BI.createWidget({
type: "bi.calendar",
logic: {
dynamic: false
},
year: y,
month: m,
day: this.DAY
})
calendar.setValue(this.selectedTime);
return calendar;
},
_stringfyTimeObject: function(timeOb){
return timeOb.year + "-" + (timeOb.month + 1) + "-" + timeOb.day;
},
render: function () { render: function () {
var self = this; var self = this;
var combo1 = BI.createWidget({ var combo1 = BI.createWidget({
type: "bi.bubble_combo", type: "bi.bubble_combo",
trigger: "click,hover",
el: { el: {
type: "bi.button", type: "bi.button",
text: "测试", text: "测试",

Loading…
Cancel
Save