guy 8 years ago
parent
commit
0f9eb6313a
  1. 26
      bi/base.js
  2. 23
      bi/core.js
  3. 26
      dist/base.js
  4. 23
      dist/core.js
  5. 18
      src/base/combination/group.button.js
  6. 8
      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

26
bi/base.js

@ -1118,9 +1118,21 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
this.layouts.addItems(this._packageLayout(items).items);
},
removeItemAt: function (index) {
this.buttons[index].destroy();
this.layouts.removeItemAt(index);
removeItemAt: function (indexes) {
BI.remove(this.buttons, indexes);
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) {
@ -3612,6 +3624,14 @@ BI.shortcut("bi.combo_group", BI.ComboGroup);BI.VirtualGroup = BI.inherit(BI.Wid
this.layouts.prependItems(items);
},
setValue: function (v) {
this.layouts.setValue(v);
},
getValue: function () {
return this.layouts.getValue();
},
populate: function (items) {
var self = this;
items = items || [];

23
bi/core.js

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

26
dist/base.js vendored

@ -1118,9 +1118,21 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
this.layouts.addItems(this._packageLayout(items).items);
},
removeItemAt: function (index) {
this.buttons[index].destroy();
this.layouts.removeItemAt(index);
removeItemAt: function (indexes) {
BI.remove(this.buttons, indexes);
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) {
@ -3612,6 +3624,14 @@ BI.shortcut("bi.combo_group", BI.ComboGroup);BI.VirtualGroup = BI.inherit(BI.Wid
this.layouts.prependItems(items);
},
setValue: function (v) {
this.layouts.setValue(v);
},
getValue: function () {
return this.layouts.getValue();
},
populate: function (items) {
var self = this;
items = items || [];

23
dist/core.js vendored

@ -19552,13 +19552,24 @@ BI.Layout = BI.inherit(BI.Widget, {
return w;
},
removeItemAt: function (index) {
if (index < 0 || index > this.options.items.length - 1) {
return;
removeItemAt: function (indexes) {
indexes = BI.isArray(indexes) ? indexes : [indexes];
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._removeItemAt(index);
child.destroy();
this.options.items = newItems;
this._children = newChildren;
BI.each(deleted, function (i, c) {
c.destroy();
});
},
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);
},
removeItemAt: function (index) {
this.buttons[index].destroy();
this.layouts.removeItemAt(index);
removeItemAt: function (indexes) {
BI.remove(this.buttons, indexes);
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) {

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

@ -55,6 +55,14 @@ BI.VirtualGroup = BI.inherit(BI.Widget, {
this.layouts.prependItems(items);
},
setValue: function (v) {
this.layouts.setValue(v);
},
getValue: function () {
return this.layouts.getValue();
},
populate: function (items) {
var self = this;
items = items || [];

23
src/core/wrapper/layout.js

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

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

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

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

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