guy 8 years ago
parent
commit
0f9eb6313a
  1. 28
      bi/base.js
  2. 23
      bi/core.js
  3. 28
      dist/base.js
  4. 23
      dist/core.js
  5. 18
      src/base/combination/group.button.js
  6. 10
      src/base/combination/group.virtual.js
  7. 23
      src/core/wrapper/layout.js
  8. 2
      src/css/base/single/text.css
  9. 2
      src/less/base/single/text.less

28
bi/base.js

@ -1118,9 +1118,21 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
this.layouts.addItems(this._packageLayout(items).items); this.layouts.addItems(this._packageLayout(items).items);
}, },
removeItemAt: function (index) { removeItemAt: function (indexes) {
this.buttons[index].destroy(); BI.remove(this.buttons, indexes);
this.layouts.removeItemAt(index); this.layouts.removeItemAt(indexes);
},
removeItems: function (values) {
values = BI.isArray(values) ? values : [values];
var deleted = [];
BI.each(this.buttons, function (i, button) {
if (BI.deepContains(values, button.getValue())) {
deleted.push(i);
}
});
BI.remove(this.buttons, deleted);
this.layouts.removeItemAt(deleted);
}, },
populate: function (items) { populate: function (items) {
@ -3609,7 +3621,15 @@ BI.shortcut("bi.combo_group", BI.ComboGroup);BI.VirtualGroup = BI.inherit(BI.Wid
}, },
prependItems: function (items) { prependItems: function (items) {
this.layouts.prependItems(items); this.layouts.prependItems(items);
},
setValue: function (v) {
this.layouts.setValue(v);
},
getValue: function () {
return this.layouts.getValue();
}, },
populate: function (items) { populate: function (items) {

23
bi/core.js

@ -11419,13 +11419,24 @@ BI.Layout = BI.inherit(BI.Widget, {
return w; return w;
}, },
removeItemAt: function (index) { removeItemAt: function (indexes) {
if (index < 0 || index > this.options.items.length - 1) { indexes = BI.isArray(indexes) ? indexes : [indexes];
return; var deleted = [];
var newItems = [], newChildren = {};
for (var i = 0, len = this.options.items.length; i < len; i++) {
var child = this._children[this._getChildName(i)];
if (indexes.contains(i)) {
deleted.push(child);
} else {
newChildren[this._getChildName(newItems.length)] = child;
newItems.push(this.options.items[i]);
}
} }
var child = this._children[this._getChildName(index)]; this.options.items = newItems;
this._removeItemAt(index); this._children = newChildren;
child.destroy(); BI.each(deleted, function (i, c) {
c.destroy();
});
}, },
updateItemAt: function (index, item) { updateItemAt: function (index, item) {

28
dist/base.js vendored

@ -1118,9 +1118,21 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
this.layouts.addItems(this._packageLayout(items).items); this.layouts.addItems(this._packageLayout(items).items);
}, },
removeItemAt: function (index) { removeItemAt: function (indexes) {
this.buttons[index].destroy(); BI.remove(this.buttons, indexes);
this.layouts.removeItemAt(index); this.layouts.removeItemAt(indexes);
},
removeItems: function (values) {
values = BI.isArray(values) ? values : [values];
var deleted = [];
BI.each(this.buttons, function (i, button) {
if (BI.deepContains(values, button.getValue())) {
deleted.push(i);
}
});
BI.remove(this.buttons, deleted);
this.layouts.removeItemAt(deleted);
}, },
populate: function (items) { populate: function (items) {
@ -3609,7 +3621,15 @@ BI.shortcut("bi.combo_group", BI.ComboGroup);BI.VirtualGroup = BI.inherit(BI.Wid
}, },
prependItems: function (items) { prependItems: function (items) {
this.layouts.prependItems(items); this.layouts.prependItems(items);
},
setValue: function (v) {
this.layouts.setValue(v);
},
getValue: function () {
return this.layouts.getValue();
}, },
populate: function (items) { populate: function (items) {

23
dist/core.js vendored

@ -19552,13 +19552,24 @@ BI.Layout = BI.inherit(BI.Widget, {
return w; return w;
}, },
removeItemAt: function (index) { removeItemAt: function (indexes) {
if (index < 0 || index > this.options.items.length - 1) { indexes = BI.isArray(indexes) ? indexes : [indexes];
return; var deleted = [];
var newItems = [], newChildren = {};
for (var i = 0, len = this.options.items.length; i < len; i++) {
var child = this._children[this._getChildName(i)];
if (indexes.contains(i)) {
deleted.push(child);
} else {
newChildren[this._getChildName(newItems.length)] = child;
newItems.push(this.options.items[i]);
}
} }
var child = this._children[this._getChildName(index)]; this.options.items = newItems;
this._removeItemAt(index); this._children = newChildren;
child.destroy(); BI.each(deleted, function (i, c) {
c.destroy();
});
}, },
updateItemAt: function (index, item) { updateItemAt: function (index, item) {

18
src/base/combination/group.button.js

@ -155,9 +155,21 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
this.layouts.addItems(this._packageLayout(items).items); this.layouts.addItems(this._packageLayout(items).items);
}, },
removeItemAt: function (index) { removeItemAt: function (indexes) {
this.buttons[index].destroy(); BI.remove(this.buttons, indexes);
this.layouts.removeItemAt(index); this.layouts.removeItemAt(indexes);
},
removeItems: function (values) {
values = BI.isArray(values) ? values : [values];
var deleted = [];
BI.each(this.buttons, function (i, button) {
if (BI.deepContains(values, button.getValue())) {
deleted.push(i);
}
});
BI.remove(this.buttons, deleted);
this.layouts.removeItemAt(deleted);
}, },
populate: function (items) { populate: function (items) {

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

@ -52,7 +52,15 @@ BI.VirtualGroup = BI.inherit(BI.Widget, {
}, },
prependItems: function (items) { prependItems: function (items) {
this.layouts.prependItems(items); this.layouts.prependItems(items);
},
setValue: function (v) {
this.layouts.setValue(v);
},
getValue: function () {
return this.layouts.getValue();
}, },
populate: function (items) { populate: function (items) {

23
src/core/wrapper/layout.js

@ -220,13 +220,24 @@ BI.Layout = BI.inherit(BI.Widget, {
return w; return w;
}, },
removeItemAt: function (index) { removeItemAt: function (indexes) {
if (index < 0 || index > this.options.items.length - 1) { indexes = BI.isArray(indexes) ? indexes : [indexes];
return; var deleted = [];
var newItems = [], newChildren = {};
for (var i = 0, len = this.options.items.length; i < len; i++) {
var child = this._children[this._getChildName(i)];
if (indexes.contains(i)) {
deleted.push(child);
} else {
newChildren[this._getChildName(newItems.length)] = child;
newItems.push(this.options.items[i]);
}
} }
var child = this._children[this._getChildName(index)]; this.options.items = newItems;
this._removeItemAt(index); this._children = newChildren;
child.destroy(); BI.each(deleted, function (i, c) {
c.destroy();
});
}, },
updateItemAt: function (index, item) { updateItemAt: function (index, item) {

2
src/css/base/single/text.css

@ -6,5 +6,5 @@
overflow-x: hidden; overflow-x: hidden;
overflow-y: hidden; overflow-y: hidden;
white-space: nowrap; white-space: nowrap;
word-break: break-all; word-break: break-word;
} }

2
src/less/base/single/text.less

@ -2,5 +2,5 @@
.bi-text{ .bi-text{
.overflow-dot(); .overflow-dot();
word-break: break-all; word-break: break-word;
} }
Loading…
Cancel
Save