guy 7 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);
},
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) {
@ -3609,7 +3621,15 @@ BI.shortcut("bi.combo_group", BI.ComboGroup);BI.VirtualGroup = BI.inherit(BI.Wid
},
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) {

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) {

28
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) {
@ -3609,7 +3621,15 @@ BI.shortcut("bi.combo_group", BI.ComboGroup);BI.VirtualGroup = BI.inherit(BI.Wid
},
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) {

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) {

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

@ -52,7 +52,15 @@ BI.VirtualGroup = BI.inherit(BI.Widget, {
},
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) {

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