guy 7 years ago
parent
commit
40a82f17d4
  1. 1
      bi/base.css
  2. 230
      bi/core.js
  3. 1
      docs/base.css
  4. 230
      docs/core.js
  5. 98
      src/core/wrapper/layout/adapt/inline.center.js
  6. 72
      src/core/wrapper/layout/adapt/inline.vertical.js
  7. 63
      src/core/wrapper/layout/layout.inline.js
  8. 1
      src/css/base/single/button/button.css
  9. 1
      src/less/base/single/button/button.less

1
bi/base.css

@ -715,6 +715,7 @@ li.CodeMirror-hint-active {
font-size: 14px;
}
.bi-button.clear {
font-size: inherit;
border-width: 0;
background-color: transparent;
}

230
bi/core.js

@ -12490,174 +12490,6 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, {
}
});
BI.shortcut('bi.horizontal_float', BI.FloatHorizontalLayout);/**
* 内联布局
* @class BI.InlineCenterAdaptLayout
* @extends BI.Layout
*
* @cfg {JSON} options 配置属性
* @cfg {Number} [hgap=0] 水平间隙
* @cfg {Number} [vgap=0] 垂直间隙
*/
BI.InlineCenterAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.InlineCenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-inline-center-adapt-layout",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.InlineCenterAdaptLayout.superclass.render.apply(this, arguments);
this.element.css({
whiteSpace: "nowrap"
});
this.populate(this.options.items);
},
_addElement: function (i, item, length) {
var o = this.options;
if (!this.hasWidget(this.getName() + "-" + i)) {
var t = BI.createWidget(item);
t.element.css({
"position": "relative"
});
var w = BI.createWidget({
type: "bi.horizontal_auto",
items: [t]
});
this.addWidget(this.getName() + "-" + i, w);
} else {
var w = this.getWidgetByName(this.getName() + "-" + i);
}
w.element.css({
"position": "relative",
"display": "inline-block",
"vertical-align": "middle",
"*display": "inline",
"*zoom": 1,
"min-width": 100 / length + "%"
});
if (o.hgap + o.lgap + (item.lgap || 0) > 0) {
w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + "px"
})
}
if (o.hgap + o.rgap + (item.rgap || 0) > 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + "px"
})
}
if (o.vgap + o.tgap + (item.tgap || 0) > 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + "px"
})
}
if (o.vgap + o.bgap + (item.bgap || 0) > 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + "px"
})
}
return w;
},
resize: function () {
this.stroke(this.options.items);
},
addItem: function (item) {
throw new Error("cannot be added");
},
stroke: function (items) {
var self = this;
BI.each(items, function (i, item) {
if (!!item) {
self._addElement(i, item, items.length);
}
});
},
populate: function (items) {
BI.InlineCenterAdaptLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut('bi.inline_center_adapt', BI.InlineCenterAdaptLayout);/**
* 内联布局
* @class BI.InlineVerticalAdaptLayout
* @extends BI.Layout
*
* @cfg {JSON} options 配置属性
* @cfg {Number} [hgap=0] 水平间隙
* @cfg {Number} [vgap=0] 垂直间隙
*/
BI.InlineVerticalAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.InlineVerticalAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-inline-vertical-adapt-layout",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.InlineVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.element.css({
whiteSpace: "nowrap"
});
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.InlineVerticalAdaptLayout.superclass._addElement.apply(this, arguments);
w.element.css({
"position": "relative",
"display": "inline-block",
"vertical-align": "middle",
"*display": "inline",
"*zoom": 1
});
if (o.hgap + o.lgap + (item.lgap || 0) > 0) {
w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + "px"
})
}
if (o.hgap + o.rgap + (item.rgap || 0) > 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + "px"
})
}
if (o.vgap + o.tgap + (item.tgap || 0) > 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + "px"
})
}
if (o.vgap + o.bgap + (item.bgap || 0) > 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + "px"
})
}
return w;
},
resize: function () {
this.stroke(this.options.items);
},
populate: function (items) {
BI.InlineVerticalAdaptLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut('bi.inline_vertical_adapt', BI.InlineVerticalAdaptLayout);/**
*自适应水平和垂直方向都居中容器
* Created by GUY on 2016/12/2.
*
@ -14225,68 +14057,6 @@ BI.HorizontalCellLayout = BI.inherit(BI.Layout, {
}
});
BI.shortcut('bi.horizontal_cell', BI.HorizontalCellLayout);/**
* 内联布局
* @class BI.InlineLayout
* @extends BI.Layout
*
* @cfg {JSON} options 配置属性
* @cfg {Number} [hgap=0] 水平间隙
* @cfg {Number} [vgap=0] 垂直间隙
*/
BI.InlineLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.InlineLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-inline-layout",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.InlineLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.InlineLayout.superclass._addElement.apply(this, arguments);
w.element.css({"position": "relative", display: "inline-block", "*display": "inline", "*zoom": 1});
if (o.hgap + o.lgap + (item.lgap || 0) > 0) {
w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + "px"
})
}
if (o.hgap + o.rgap + (item.rgap || 0) > 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + "px"
})
}
if (o.vgap + o.tgap + (item.tgap || 0) > 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + "px"
})
}
if (o.vgap + o.bgap + (item.bgap || 0) > 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + "px"
})
}
return w;
},
resize: function(){
this.stroke(this.options.items);
},
populate: function (items) {
BI.InlineLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut('bi.inline', BI.InlineLayout);/**
* 靠左对齐的自由浮动布局
* @class BI.LatticeLayout
* @extends BI.Layout

1
docs/base.css

@ -715,6 +715,7 @@ li.CodeMirror-hint-active {
font-size: 14px;
}
.bi-button.clear {
font-size: inherit;
border-width: 0;
background-color: transparent;
}

230
docs/core.js

@ -25998,174 +25998,6 @@ BI.FloatHorizontalLayout = BI.inherit(BI.Layout, {
}
});
BI.shortcut('bi.horizontal_float', BI.FloatHorizontalLayout);/**
* 内联布局
* @class BI.InlineCenterAdaptLayout
* @extends BI.Layout
*
* @cfg {JSON} options 配置属性
* @cfg {Number} [hgap=0] 水平间隙
* @cfg {Number} [vgap=0] 垂直间隙
*/
BI.InlineCenterAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.InlineCenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-inline-center-adapt-layout",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.InlineCenterAdaptLayout.superclass.render.apply(this, arguments);
this.element.css({
whiteSpace: "nowrap"
});
this.populate(this.options.items);
},
_addElement: function (i, item, length) {
var o = this.options;
if (!this.hasWidget(this.getName() + "-" + i)) {
var t = BI.createWidget(item);
t.element.css({
"position": "relative"
});
var w = BI.createWidget({
type: "bi.horizontal_auto",
items: [t]
});
this.addWidget(this.getName() + "-" + i, w);
} else {
var w = this.getWidgetByName(this.getName() + "-" + i);
}
w.element.css({
"position": "relative",
"display": "inline-block",
"vertical-align": "middle",
"*display": "inline",
"*zoom": 1,
"min-width": 100 / length + "%"
});
if (o.hgap + o.lgap + (item.lgap || 0) > 0) {
w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + "px"
})
}
if (o.hgap + o.rgap + (item.rgap || 0) > 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + "px"
})
}
if (o.vgap + o.tgap + (item.tgap || 0) > 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + "px"
})
}
if (o.vgap + o.bgap + (item.bgap || 0) > 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + "px"
})
}
return w;
},
resize: function () {
this.stroke(this.options.items);
},
addItem: function (item) {
throw new Error("cannot be added");
},
stroke: function (items) {
var self = this;
BI.each(items, function (i, item) {
if (!!item) {
self._addElement(i, item, items.length);
}
});
},
populate: function (items) {
BI.InlineCenterAdaptLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut('bi.inline_center_adapt', BI.InlineCenterAdaptLayout);/**
* 内联布局
* @class BI.InlineVerticalAdaptLayout
* @extends BI.Layout
*
* @cfg {JSON} options 配置属性
* @cfg {Number} [hgap=0] 水平间隙
* @cfg {Number} [vgap=0] 垂直间隙
*/
BI.InlineVerticalAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.InlineVerticalAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-inline-vertical-adapt-layout",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.InlineVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.element.css({
whiteSpace: "nowrap"
});
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.InlineVerticalAdaptLayout.superclass._addElement.apply(this, arguments);
w.element.css({
"position": "relative",
"display": "inline-block",
"vertical-align": "middle",
"*display": "inline",
"*zoom": 1
});
if (o.hgap + o.lgap + (item.lgap || 0) > 0) {
w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + "px"
})
}
if (o.hgap + o.rgap + (item.rgap || 0) > 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + "px"
})
}
if (o.vgap + o.tgap + (item.tgap || 0) > 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + "px"
})
}
if (o.vgap + o.bgap + (item.bgap || 0) > 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + "px"
})
}
return w;
},
resize: function () {
this.stroke(this.options.items);
},
populate: function (items) {
BI.InlineVerticalAdaptLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut('bi.inline_vertical_adapt', BI.InlineVerticalAdaptLayout);/**
*自适应水平和垂直方向都居中容器
* Created by GUY on 2016/12/2.
*
@ -27733,68 +27565,6 @@ BI.HorizontalCellLayout = BI.inherit(BI.Layout, {
}
});
BI.shortcut('bi.horizontal_cell', BI.HorizontalCellLayout);/**
* 内联布局
* @class BI.InlineLayout
* @extends BI.Layout
*
* @cfg {JSON} options 配置属性
* @cfg {Number} [hgap=0] 水平间隙
* @cfg {Number} [vgap=0] 垂直间隙
*/
BI.InlineLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.InlineLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-inline-layout",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.InlineLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.InlineLayout.superclass._addElement.apply(this, arguments);
w.element.css({"position": "relative", display: "inline-block", "*display": "inline", "*zoom": 1});
if (o.hgap + o.lgap + (item.lgap || 0) > 0) {
w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + "px"
})
}
if (o.hgap + o.rgap + (item.rgap || 0) > 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + "px"
})
}
if (o.vgap + o.tgap + (item.tgap || 0) > 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + "px"
})
}
if (o.vgap + o.bgap + (item.bgap || 0) > 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + "px"
})
}
return w;
},
resize: function(){
this.stroke(this.options.items);
},
populate: function (items) {
BI.InlineLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut('bi.inline', BI.InlineLayout);/**
* 靠左对齐的自由浮动布局
* @class BI.LatticeLayout
* @extends BI.Layout

98
src/core/wrapper/layout/adapt/inline.center.js

@ -1,98 +0,0 @@
/**
* 内联布局
* @class BI.InlineCenterAdaptLayout
* @extends BI.Layout
*
* @cfg {JSON} options 配置属性
* @cfg {Number} [hgap=0] 水平间隙
* @cfg {Number} [vgap=0] 垂直间隙
*/
BI.InlineCenterAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.InlineCenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-inline-center-adapt-layout",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.InlineCenterAdaptLayout.superclass.render.apply(this, arguments);
this.element.css({
whiteSpace: "nowrap"
});
this.populate(this.options.items);
},
_addElement: function (i, item, length) {
var o = this.options;
if (!this.hasWidget(this.getName() + "-" + i)) {
var t = BI.createWidget(item);
t.element.css({
"position": "relative"
});
var w = BI.createWidget({
type: "bi.horizontal_auto",
items: [t]
});
this.addWidget(this.getName() + "-" + i, w);
} else {
var w = this.getWidgetByName(this.getName() + "-" + i);
}
w.element.css({
"position": "relative",
"display": "inline-block",
"vertical-align": "middle",
"*display": "inline",
"*zoom": 1,
"min-width": 100 / length + "%"
});
if (o.hgap + o.lgap + (item.lgap || 0) > 0) {
w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + "px"
})
}
if (o.hgap + o.rgap + (item.rgap || 0) > 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + "px"
})
}
if (o.vgap + o.tgap + (item.tgap || 0) > 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + "px"
})
}
if (o.vgap + o.bgap + (item.bgap || 0) > 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + "px"
})
}
return w;
},
resize: function () {
this.stroke(this.options.items);
},
addItem: function (item) {
throw new Error("cannot be added");
},
stroke: function (items) {
var self = this;
BI.each(items, function (i, item) {
if (!!item) {
self._addElement(i, item, items.length);
}
});
},
populate: function (items) {
BI.InlineCenterAdaptLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut('bi.inline_center_adapt', BI.InlineCenterAdaptLayout);

72
src/core/wrapper/layout/adapt/inline.vertical.js

@ -1,72 +0,0 @@
/**
* 内联布局
* @class BI.InlineVerticalAdaptLayout
* @extends BI.Layout
*
* @cfg {JSON} options 配置属性
* @cfg {Number} [hgap=0] 水平间隙
* @cfg {Number} [vgap=0] 垂直间隙
*/
BI.InlineVerticalAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.InlineVerticalAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-inline-vertical-adapt-layout",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.InlineVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.element.css({
whiteSpace: "nowrap"
});
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.InlineVerticalAdaptLayout.superclass._addElement.apply(this, arguments);
w.element.css({
"position": "relative",
"display": "inline-block",
"vertical-align": "middle",
"*display": "inline",
"*zoom": 1
});
if (o.hgap + o.lgap + (item.lgap || 0) > 0) {
w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + "px"
})
}
if (o.hgap + o.rgap + (item.rgap || 0) > 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + "px"
})
}
if (o.vgap + o.tgap + (item.tgap || 0) > 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + "px"
})
}
if (o.vgap + o.bgap + (item.bgap || 0) > 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + "px"
})
}
return w;
},
resize: function () {
this.stroke(this.options.items);
},
populate: function (items) {
BI.InlineVerticalAdaptLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut('bi.inline_vertical_adapt', BI.InlineVerticalAdaptLayout);

63
src/core/wrapper/layout/layout.inline.js

@ -1,63 +0,0 @@
/**
* 内联布局
* @class BI.InlineLayout
* @extends BI.Layout
*
* @cfg {JSON} options 配置属性
* @cfg {Number} [hgap=0] 水平间隙
* @cfg {Number} [vgap=0] 垂直间隙
*/
BI.InlineLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.InlineLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-inline-layout",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.InlineLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.InlineLayout.superclass._addElement.apply(this, arguments);
w.element.css({"position": "relative", display: "inline-block", "*display": "inline", "*zoom": 1});
if (o.hgap + o.lgap + (item.lgap || 0) > 0) {
w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + "px"
})
}
if (o.hgap + o.rgap + (item.rgap || 0) > 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + "px"
})
}
if (o.vgap + o.tgap + (item.tgap || 0) > 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + "px"
})
}
if (o.vgap + o.bgap + (item.bgap || 0) > 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + "px"
})
}
return w;
},
resize: function(){
this.stroke(this.options.items);
},
populate: function (items) {
BI.InlineLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut('bi.inline', BI.InlineLayout);

1
src/css/base/single/button/button.css

@ -13,6 +13,7 @@
font-size: 14px;
}
.bi-button.clear {
font-size: inherit;
border-width: 0;
background-color: transparent;
}

1
src/less/base/single/button/button.less

@ -9,6 +9,7 @@
cursor: pointer;
font-size: 14px;
&.clear {
font-size: inherit;
border-width: 0;
background-color: transparent;
&:hover, &:active {

Loading…
Cancel
Save