Browse Source

Merge branch 'master' of http://cloud.finedevelop.com:2015/scm/visual/fineui

# Conflicts:
#	dist/bundle.ie.min.js
#	dist/bundle.min.js
#	dist/fineui.ie.min.js
#	dist/fineui.min.js
#	dist/utils.min.js
es6
王瑞 6 years ago
parent
commit
41f6c97e25
  1. 137
      demo/js/core/layout/demo.horizontal.js
  2. 157
      dist/base.js
  3. 504
      dist/bundle.ie.js
  4. 60
      dist/bundle.ie.min.js
  5. 502
      dist/bundle.js
  6. 60
      dist/bundle.min.js
  7. 345
      dist/core.js
  8. 131
      dist/demo.js
  9. 504
      dist/fineui.ie.js
  10. 60
      dist/fineui.ie.min.js
  11. 502
      dist/fineui.js
  12. 60
      dist/fineui.min.js
  13. 502
      dist/fineui_without_jquery_polyfill.js
  14. 2
      dist/fix/fix.compact.ie.js
  15. 2
      dist/utils.min.js
  16. 157
      src/base/foundation/message.js
  17. 98
      src/core/wrapper/layout/adapt/adapt.center.js
  18. 140
      src/core/wrapper/layout/adapt/adapt.leftrightvertical.js
  19. 101
      src/core/wrapper/layout/adapt/adapt.vertical.js
  20. 6
      src/core/wrapper/layout/layout.horizontal.js

137
demo/js/core/layout/demo.horizontal.js

@ -7,33 +7,118 @@ Demo.Horizontal = BI.inherit(BI.Widget, {
}, },
render: function () { render: function () {
return { return {
type: "bi.horizontal", type: "bi.vertical",
hgap: 10, vgap: 10,
items: [{ items: [{
type: "bi.label", type: "bi.horizontal",
whiteSpace: "normal", height: 150,
text: "因为大多数场景下都需要垂直居中,所以这个布局一般会被vertical_adapt布局设置scrollx=true取代", hgap: 10,
cls: "layout-bg3", items: [{
width: 500, type: "bi.label",
height: 50 whiteSpace: "normal",
}, { text: "因为大多数场景下都需要垂直居中,所以这个布局一般会被vertical_adapt布局设置scrollx=true取代",
type: "bi.label", cls: "layout-bg3",
text: "水平布局", width: 500,
cls: "layout-bg4", height: 50
width: 300, }, {
height: 30 type: "bi.label",
}, { text: "水平布局",
type: "bi.label", cls: "layout-bg4",
text: "水平布局", width: 300,
cls: "layout-bg5", height: 30
width: 300, }, {
height: 30 type: "bi.label",
}, { text: "水平布局",
type: "bi.label", cls: "layout-bg5",
text: "水平布局", width: 300,
cls: "layout-bg6", height: 30
width: 300, }, {
height: 30 type: "bi.label",
text: "水平布局",
cls: "layout-bg6",
width: 300,
height: 30
}]
}, {
type: "bi.layout",
height: 1,
cls: "bi-border-bottom bi-high-light-border"
}, {
type: "bi.horizontal",
height: 150,
verticalAlign: BI.VerticalAlign.Middle,
horizontalAlign: BI.HorizontalAlign.Left,
vgap: 10,
items: [{
type: "bi.label",
text: "以horizontal实现的vertical_adapt垂直居中",
cls: "layout-bg1",
width: 300,
height: 30
}, {
type: "bi.label",
text: "以horizontal实现的vertical_adapt垂直居中",
cls: "layout-bg2",
width: 300,
height: 30
}]
}, {
type: "bi.layout",
height: 1,
cls: "bi-border-bottom bi-high-light-border"
}, {
type: "bi.horizontal",
height: 150,
verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: BI.HorizontalAlign.Center,
items: [{
type: "bi.label",
text: "以horizontal代替horizontal_adapt实现的水平居中(单元素)",
cls: "layout-bg1",
width: 300,
height: 30
}]
}, {
type: "bi.layout",
height: 1,
cls: "bi-border-bottom bi-high-light-border"
}, {
type: "bi.horizontal",
height: 150,
verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: BI.HorizontalAlign.Center,
columnSize: [300, "fill"],
items: [{
type: "bi.label",
text: "以horizontal代替horizontal_adapt实现的用于水平适应布局",
cls: "layout-bg1",
height: 30
}, {
type: "bi.label",
text: "以horizontal代替horizontal_adapt实现的水平自适应列",
cls: "layout-bg2",
height: 30
}]
}, {
type: "bi.layout",
height: 1,
cls: "bi-border-bottom bi-high-light-border"
}, {
type: "bi.center_adapt",
height: 150,
verticalAlign: BI.VerticalAlign.Middle,
horizontalAlign: BI.HorizontalAlign.Center,
items: [{
type: "bi.label",
text: "以horizontal代替center_adapt实现的水平垂直居中",
width: 300,
height: 100,
cls: "layout-bg1"
}]
}, {
type: "bi.layout",
height: 1,
cls: "bi-border-bottom bi-high-light-border"
}] }]
}; };
} }

157
dist/base.js vendored

@ -5181,132 +5181,57 @@ BI.Msg = function () {
}, 5000); }, 5000);
}, },
_show: function (hasCancel, title, message, callback) { _show: function (hasCancel, title, message, callback) {
$mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({ var name = BI.UUID();
position: "absolute", BI.Popovers.create(name, {
zIndex: BI.zIndex_tip - 2, type: "bi.bar_popover",
top: 0, header: title,
left: 0, body: {
right: 0, type: "bi.center_adapt",
bottom: 0, items: [{
opacity: 0.5 type: "bi.label",
}).appendTo("body"); text: message
$pop = BI.Widget._renderEngine.createElement("<div class=\"bi-message-depend\">").css({ }]
position: "absolute", },
zIndex: BI.zIndex_tip - 1, footer: hasCancel ? {
top: 0, type: "bi.right_vertical_adapt",
left: 0, lgap: 10,
right: 0, items: [{
bottom: 0
}).appendTo("body");
var close = function () {
messageShow.destroy();
$mask.remove();
};
var controlItems = [];
if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button", type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"), text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore", level: "ignore",
handler: function () { handler: function () {
close(); BI.Popovers.remove(name);
if (BI.isFunction(callback)) { if (BI.isFunction(callback)) {
callback.apply(null, [false]); callback.apply(null, [false]);
} }
} }
} }, {
}); type: "bi.button",
} text: BI.i18nText("BI-Basic_Sure"),
controlItems.push({ handler: function () {
el: { BI.Popovers.remove(name);
type: "bi.button", if (BI.isFunction(callback)) {
text: BI.i18nText("BI-Basic_OK"), callback.apply(null, [true]);
handler: function () { }
close();
if (BI.isFunction(callback)) {
callback.apply(null, [true]);
} }
} }]
} } : {
}); type: "bi.right_vertical_adapt",
var conf = { lgap: 10,
element: $pop, items: [{
type: "bi.center_adapt", type: "bi.button",
items: [ text: BI.i18nText("BI-Basic_Cancel"),
{ level: "ignore",
type: "bi.border", handler: function () {
cls: "bi-message-content bi-card", BI.Popovers.remove(name);
items: { if (BI.isFunction(callback)) {
north: { callback.apply(null, [false]);
el: {
type: "bi.border",
cls: "bi-message-title bi-background",
items: {
center: {
el: {
type: "bi.label",
text: title || BI.i18nText("BI-Basic_Prompt"),
textAlign: "left",
hgap: 20,
height: 50
}
},
east: {
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
// height: 50,
handler: function () {
close();
if (BI.isFunction(callback)) {
callback.apply(null, [false]);
}
}
},
width: 60
}
}
},
height: 50
},
center: {
el: {
type: "bi.text",
cls: "bi-message-text",
tgap: 60,
hgap: 20,
lineHeight: 30,
whiteSpace: "normal",
text: message
}
},
south: {
el: {
type: "bi.absolute",
items: [{
el: {
type: "bi.right_vertical_adapt",
hgap: 5,
items: controlItems
},
top: 0,
left: 20,
right: 20,
bottom: 0
}]
},
height: 60
} }
}, }
width: 400, }]
height: 300 },
} size: "small"
] }).open(name);
};
messageShow = BI.createWidget(conf);
} }
}; };
}();/** }();/**

504
dist/bundle.ie.js vendored

@ -30415,6 +30415,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-center-adapt-layout", baseCls: "bi-center-adapt-layout",
columnSize: [], columnSize: [],
scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -30424,92 +30425,33 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.CenterAdaptLayout.superclass.render.apply(this, arguments); BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ return {
position: "relative", type: "bi.horizontal",
width: "100%", verticalAlign: BI.VerticalAlign.Middle,
height: "100%", horizontalAlign: BI.HorizontalAlign.Center,
"white-space": "nowrap", columnSize: o.columnSize,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", items: o.items,
"border-collapse": "separate" ref: function (_ref) {
}); self.layout = _ref;
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); },
this.$tr.appendTo(this.$table); hgap: o.hgap,
this.populate(this.options.items); vgap: o.vgap,
}, lgap: o.lgap,
rgap: o.rgap,
_addElement: function (i, item) { tgap: o.tgap,
var o = this.options; bgap: o.bgap
var td; };
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
td.element.css({"max-width": o.columnSize[i]});
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
}, },
resize: function () { resize: function () {
// console.log("center_adapt布局不需要resize"); // console.log("center_adapt布局不需要resize");
}, },
_getWrapper: function () {
return this.$tr;
},
populate: function (items) { populate: function (items) {
BI.CenterAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/** BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/**
@ -30641,8 +30583,40 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); var layoutArray = [];
if ("left" in o.items) {
layoutArray.push({
type: "bi.left",
items: [{
el: {
type: "bi.vertical_adapt",
height: "100%",
items: o.items.left,
hgap: o.lhgap,
lgap: o.llgap,
rgap: o.lrgap
}
}]
});
}
if ("right" in o.items) {
layoutArray.push({
type: "bi.right",
items: [{
el: {
type: "bi.vertical_adapt",
height: "100%",
items: o.items.right,
hgap: o.rhgap,
lgap: o.rlgap,
rgap: o.rrgap
}
}]
});
}
return layoutArray;
}, },
resize: function () { resize: function () {
@ -30654,40 +30628,6 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
if ("left" in items) {
var left = BI.createWidget({
type: "bi.vertical_adapt",
items: items.left,
hgap: o.lhgap,
lgap: o.llgap,
rgap: o.lrgap
});
left.element.css("height", "100%");
BI.createWidget({
type: "bi.left",
element: this,
items: [left]
});
}
if ("right" in items) {
var right = BI.createWidget({
type: "bi.vertical_adapt",
items: items.right,
hgap: o.rhgap,
lgap: o.rlgap,
rgap: o.rrgap
});
right.element.css("height", "100%");
BI.createWidget({
type: "bi.right",
element: this,
items: [right]
});
}
},
populate: function (items) { populate: function (items) {
BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this, arguments); BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();
@ -30707,8 +30647,22 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.LeftVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.LeftVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); return {
type: "bi.left",
ref: function (_ref) {
self.layout = _ref;
},
items: [{
type: "bi.vertical_adapt",
height: "100%",
items: o.items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
}]
};
}, },
resize: function () { resize: function () {
@ -30720,26 +30674,8 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
var left = BI.createWidget({
type: "bi.vertical_adapt",
items: items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
});
left.element.css("height", "100%");
BI.createWidget({
type: "bi.left",
element: this,
items: [left]
});
},
populate: function (items) { populate: function (items) {
BI.LeftVerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.left_vertical_adapt", BI.LeftVerticalAdaptLayout); BI.shortcut("bi.left_vertical_adapt", BI.LeftVerticalAdaptLayout);
@ -30755,8 +30691,22 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.RightVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.RightVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); return {
type: "bi.right",
ref: function (_ref) {
self.layout = _ref;
},
items: [{
type: "bi.vertical_adapt",
height: "100%",
items: o.items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
}]
};
}, },
resize: function () { resize: function () {
@ -30768,26 +30718,8 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
var right = BI.createWidget({
type: "bi.vertical_adapt",
items: items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
});
right.element.css("height", "100%");
BI.createWidget({
type: "bi.right",
element: this,
items: [right]
});
},
populate: function (items) { populate: function (items) {
BI.RightVerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout);/** BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout);/**
@ -30799,7 +30731,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
props: { props: {
baseCls: "bi-vertical-adapt-layout", baseCls: "bi-vertical-adapt-layout",
columnSize: [], columnSize: [],
horizontalAlign: BI.HorizontalAlign.Left, scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -30807,85 +30739,27 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
tgap: 0, tgap: 0,
bgap: 0 bgap: 0
}, },
render: function () { render: function () {
var self = this, o = this.options;
BI.VerticalAdaptLayout.superclass.render.apply(this, arguments); BI.VerticalAdaptLayout.superclass.render.apply(this, arguments);
var o = this.options; return {
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ type: "bi.horizontal",
position: "relative", verticalAlign: BI.VerticalAlign.Middle,
width: o.horizontalAlign === BI.HorizontalAlign.Stretch ? "100%" : "auto", horizontalAlign: BI.HorizontalAlign.Left,
height: "100%", columnSize: o.columnSize,
"white-space": "nowrap", items: o.items,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", ref: function (_ref) {
"border-collapse": "separate" self.layout = _ref;
}); },
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); hgap: o.hgap,
this.$tr.appendTo(this.$table); vgap: o.vgap,
this.populate(this.options.items); lgap: o.lgap,
}, rgap: o.rgap,
tgap: o.tgap,
_addElement: function (i, item) { bgap: o.bgap
var o = this.options; };
var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
},
_getWrapper: function () {
return this.$tr;
}, },
resize: function () { resize: function () {
@ -30893,8 +30767,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
BI.VerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/** BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/**
@ -32651,6 +32524,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-layout", baseCls: "bi-horizontal-layout",
verticalAlign: BI.VerticalAlign.Top, verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: BI.HorizontalAlign.Left,
columnSize: [], columnSize: [],
scrollx: true, scrollx: true,
hgap: 0, hgap: 0,
@ -32662,10 +32536,13 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options;
BI.HorizontalLayout.superclass.render.apply(this, arguments); BI.HorizontalLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative", position: "relative",
"white-space": "nowrap", "white-space": "nowrap",
height: o.verticalAlign === BI.VerticalAlign.Middle ? "100%" : "auto",
width: o.horizontalAlign === BI.HorizontalAlign.Center ? "100%" : "auto",
"border-spacing": "0px", "border-spacing": "0px",
border: "none", border: "none",
"border-collapse": "separate" "border-collapse": "separate"
@ -32695,7 +32572,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
td = this.getWidgetByName(this._getChildName(i)); td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width); td.element.attr("width", width);
} }
td.element.css({"max-width": o.columnSize[i] + "px"});
if (i === 0) { if (i === 0) {
td.element.addClass("first-element"); td.element.addClass("first-element");
} }
@ -40230,132 +40107,57 @@ BI.Msg = function () {
}, 5000); }, 5000);
}, },
_show: function (hasCancel, title, message, callback) { _show: function (hasCancel, title, message, callback) {
$mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({ var name = BI.UUID();
position: "absolute", BI.Popovers.create(name, {
zIndex: BI.zIndex_tip - 2, type: "bi.bar_popover",
top: 0, header: title,
left: 0, body: {
right: 0, type: "bi.center_adapt",
bottom: 0, items: [{
opacity: 0.5 type: "bi.label",
}).appendTo("body"); text: message
$pop = BI.Widget._renderEngine.createElement("<div class=\"bi-message-depend\">").css({ }]
position: "absolute", },
zIndex: BI.zIndex_tip - 1, footer: hasCancel ? {
top: 0, type: "bi.right_vertical_adapt",
left: 0, lgap: 10,
right: 0, items: [{
bottom: 0
}).appendTo("body");
var close = function () {
messageShow.destroy();
$mask.remove();
};
var controlItems = [];
if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button", type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"), text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore", level: "ignore",
handler: function () { handler: function () {
close(); BI.Popovers.remove(name);
if (BI.isFunction(callback)) { if (BI.isFunction(callback)) {
callback.apply(null, [false]); callback.apply(null, [false]);
} }
} }
} }, {
}); type: "bi.button",
} text: BI.i18nText("BI-Basic_Sure"),
controlItems.push({ handler: function () {
el: { BI.Popovers.remove(name);
type: "bi.button", if (BI.isFunction(callback)) {
text: BI.i18nText("BI-Basic_OK"), callback.apply(null, [true]);
handler: function () { }
close();
if (BI.isFunction(callback)) {
callback.apply(null, [true]);
} }
} }]
} } : {
}); type: "bi.right_vertical_adapt",
var conf = { lgap: 10,
element: $pop, items: [{
type: "bi.center_adapt", type: "bi.button",
items: [ text: BI.i18nText("BI-Basic_Cancel"),
{ level: "ignore",
type: "bi.border", handler: function () {
cls: "bi-message-content bi-card", BI.Popovers.remove(name);
items: { if (BI.isFunction(callback)) {
north: { callback.apply(null, [false]);
el: {
type: "bi.border",
cls: "bi-message-title bi-background",
items: {
center: {
el: {
type: "bi.label",
text: title || BI.i18nText("BI-Basic_Prompt"),
textAlign: "left",
hgap: 20,
height: 50
}
},
east: {
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
// height: 50,
handler: function () {
close();
if (BI.isFunction(callback)) {
callback.apply(null, [false]);
}
}
},
width: 60
}
}
},
height: 50
},
center: {
el: {
type: "bi.text",
cls: "bi-message-text",
tgap: 60,
hgap: 20,
lineHeight: 30,
whiteSpace: "normal",
text: message
}
},
south: {
el: {
type: "bi.absolute",
items: [{
el: {
type: "bi.right_vertical_adapt",
hgap: 5,
items: controlItems
},
top: 0,
left: 20,
right: 20,
bottom: 0
}]
},
height: 60
} }
}, }
width: 400, }]
height: 300 },
} size: "small"
] }).open(name);
};
messageShow = BI.createWidget(conf);
} }
}; };
}();/** }();/**
@ -81997,7 +81799,7 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () {
}); });
}; };
$(document).ajaxStop(additionFunc); $(document).ajaxComplete(additionFunc);
if (BI.history) { if (BI.history) {
var navigate = BI.history.navigate; var navigate = BI.history.navigate;

60
dist/bundle.ie.min.js vendored

File diff suppressed because one or more lines are too long

502
dist/bundle.js vendored

@ -30415,6 +30415,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-center-adapt-layout", baseCls: "bi-center-adapt-layout",
columnSize: [], columnSize: [],
scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -30424,92 +30425,33 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.CenterAdaptLayout.superclass.render.apply(this, arguments); BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ return {
position: "relative", type: "bi.horizontal",
width: "100%", verticalAlign: BI.VerticalAlign.Middle,
height: "100%", horizontalAlign: BI.HorizontalAlign.Center,
"white-space": "nowrap", columnSize: o.columnSize,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", items: o.items,
"border-collapse": "separate" ref: function (_ref) {
}); self.layout = _ref;
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); },
this.$tr.appendTo(this.$table); hgap: o.hgap,
this.populate(this.options.items); vgap: o.vgap,
}, lgap: o.lgap,
rgap: o.rgap,
_addElement: function (i, item) { tgap: o.tgap,
var o = this.options; bgap: o.bgap
var td; };
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
td.element.css({"max-width": o.columnSize[i]});
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
}, },
resize: function () { resize: function () {
// console.log("center_adapt布局不需要resize"); // console.log("center_adapt布局不需要resize");
}, },
_getWrapper: function () {
return this.$tr;
},
populate: function (items) { populate: function (items) {
BI.CenterAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/** BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/**
@ -30641,8 +30583,40 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); var layoutArray = [];
if ("left" in o.items) {
layoutArray.push({
type: "bi.left",
items: [{
el: {
type: "bi.vertical_adapt",
height: "100%",
items: o.items.left,
hgap: o.lhgap,
lgap: o.llgap,
rgap: o.lrgap
}
}]
});
}
if ("right" in o.items) {
layoutArray.push({
type: "bi.right",
items: [{
el: {
type: "bi.vertical_adapt",
height: "100%",
items: o.items.right,
hgap: o.rhgap,
lgap: o.rlgap,
rgap: o.rrgap
}
}]
});
}
return layoutArray;
}, },
resize: function () { resize: function () {
@ -30654,40 +30628,6 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
if ("left" in items) {
var left = BI.createWidget({
type: "bi.vertical_adapt",
items: items.left,
hgap: o.lhgap,
lgap: o.llgap,
rgap: o.lrgap
});
left.element.css("height", "100%");
BI.createWidget({
type: "bi.left",
element: this,
items: [left]
});
}
if ("right" in items) {
var right = BI.createWidget({
type: "bi.vertical_adapt",
items: items.right,
hgap: o.rhgap,
lgap: o.rlgap,
rgap: o.rrgap
});
right.element.css("height", "100%");
BI.createWidget({
type: "bi.right",
element: this,
items: [right]
});
}
},
populate: function (items) { populate: function (items) {
BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this, arguments); BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();
@ -30707,8 +30647,22 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.LeftVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.LeftVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); return {
type: "bi.left",
ref: function (_ref) {
self.layout = _ref;
},
items: [{
type: "bi.vertical_adapt",
height: "100%",
items: o.items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
}]
};
}, },
resize: function () { resize: function () {
@ -30720,26 +30674,8 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
var left = BI.createWidget({
type: "bi.vertical_adapt",
items: items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
});
left.element.css("height", "100%");
BI.createWidget({
type: "bi.left",
element: this,
items: [left]
});
},
populate: function (items) { populate: function (items) {
BI.LeftVerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.left_vertical_adapt", BI.LeftVerticalAdaptLayout); BI.shortcut("bi.left_vertical_adapt", BI.LeftVerticalAdaptLayout);
@ -30755,8 +30691,22 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.RightVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.RightVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); return {
type: "bi.right",
ref: function (_ref) {
self.layout = _ref;
},
items: [{
type: "bi.vertical_adapt",
height: "100%",
items: o.items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
}]
};
}, },
resize: function () { resize: function () {
@ -30768,26 +30718,8 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
var right = BI.createWidget({
type: "bi.vertical_adapt",
items: items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
});
right.element.css("height", "100%");
BI.createWidget({
type: "bi.right",
element: this,
items: [right]
});
},
populate: function (items) { populate: function (items) {
BI.RightVerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout);/** BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout);/**
@ -30799,7 +30731,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
props: { props: {
baseCls: "bi-vertical-adapt-layout", baseCls: "bi-vertical-adapt-layout",
columnSize: [], columnSize: [],
horizontalAlign: BI.HorizontalAlign.Left, scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -30807,85 +30739,27 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
tgap: 0, tgap: 0,
bgap: 0 bgap: 0
}, },
render: function () { render: function () {
var self = this, o = this.options;
BI.VerticalAdaptLayout.superclass.render.apply(this, arguments); BI.VerticalAdaptLayout.superclass.render.apply(this, arguments);
var o = this.options; return {
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ type: "bi.horizontal",
position: "relative", verticalAlign: BI.VerticalAlign.Middle,
width: o.horizontalAlign === BI.HorizontalAlign.Stretch ? "100%" : "auto", horizontalAlign: BI.HorizontalAlign.Left,
height: "100%", columnSize: o.columnSize,
"white-space": "nowrap", items: o.items,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", ref: function (_ref) {
"border-collapse": "separate" self.layout = _ref;
}); },
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); hgap: o.hgap,
this.$tr.appendTo(this.$table); vgap: o.vgap,
this.populate(this.options.items); lgap: o.lgap,
}, rgap: o.rgap,
tgap: o.tgap,
_addElement: function (i, item) { bgap: o.bgap
var o = this.options; };
var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
},
_getWrapper: function () {
return this.$tr;
}, },
resize: function () { resize: function () {
@ -30893,8 +30767,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
BI.VerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/** BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/**
@ -32651,6 +32524,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-layout", baseCls: "bi-horizontal-layout",
verticalAlign: BI.VerticalAlign.Top, verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: BI.HorizontalAlign.Left,
columnSize: [], columnSize: [],
scrollx: true, scrollx: true,
hgap: 0, hgap: 0,
@ -32662,10 +32536,13 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options;
BI.HorizontalLayout.superclass.render.apply(this, arguments); BI.HorizontalLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative", position: "relative",
"white-space": "nowrap", "white-space": "nowrap",
height: o.verticalAlign === BI.VerticalAlign.Middle ? "100%" : "auto",
width: o.horizontalAlign === BI.HorizontalAlign.Center ? "100%" : "auto",
"border-spacing": "0px", "border-spacing": "0px",
border: "none", border: "none",
"border-collapse": "separate" "border-collapse": "separate"
@ -32695,7 +32572,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
td = this.getWidgetByName(this._getChildName(i)); td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width); td.element.attr("width", width);
} }
td.element.css({"max-width": o.columnSize[i] + "px"});
if (i === 0) { if (i === 0) {
td.element.addClass("first-element"); td.element.addClass("first-element");
} }
@ -40634,132 +40511,57 @@ BI.Msg = function () {
}, 5000); }, 5000);
}, },
_show: function (hasCancel, title, message, callback) { _show: function (hasCancel, title, message, callback) {
$mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({ var name = BI.UUID();
position: "absolute", BI.Popovers.create(name, {
zIndex: BI.zIndex_tip - 2, type: "bi.bar_popover",
top: 0, header: title,
left: 0, body: {
right: 0, type: "bi.center_adapt",
bottom: 0, items: [{
opacity: 0.5 type: "bi.label",
}).appendTo("body"); text: message
$pop = BI.Widget._renderEngine.createElement("<div class=\"bi-message-depend\">").css({ }]
position: "absolute", },
zIndex: BI.zIndex_tip - 1, footer: hasCancel ? {
top: 0, type: "bi.right_vertical_adapt",
left: 0, lgap: 10,
right: 0, items: [{
bottom: 0
}).appendTo("body");
var close = function () {
messageShow.destroy();
$mask.remove();
};
var controlItems = [];
if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button", type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"), text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore", level: "ignore",
handler: function () { handler: function () {
close(); BI.Popovers.remove(name);
if (BI.isFunction(callback)) { if (BI.isFunction(callback)) {
callback.apply(null, [false]); callback.apply(null, [false]);
} }
} }
} }, {
}); type: "bi.button",
} text: BI.i18nText("BI-Basic_Sure"),
controlItems.push({ handler: function () {
el: { BI.Popovers.remove(name);
type: "bi.button", if (BI.isFunction(callback)) {
text: BI.i18nText("BI-Basic_OK"), callback.apply(null, [true]);
handler: function () { }
close();
if (BI.isFunction(callback)) {
callback.apply(null, [true]);
} }
} }]
} } : {
}); type: "bi.right_vertical_adapt",
var conf = { lgap: 10,
element: $pop, items: [{
type: "bi.center_adapt", type: "bi.button",
items: [ text: BI.i18nText("BI-Basic_Cancel"),
{ level: "ignore",
type: "bi.border", handler: function () {
cls: "bi-message-content bi-card", BI.Popovers.remove(name);
items: { if (BI.isFunction(callback)) {
north: { callback.apply(null, [false]);
el: {
type: "bi.border",
cls: "bi-message-title bi-background",
items: {
center: {
el: {
type: "bi.label",
text: title || BI.i18nText("BI-Basic_Prompt"),
textAlign: "left",
hgap: 20,
height: 50
}
},
east: {
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
// height: 50,
handler: function () {
close();
if (BI.isFunction(callback)) {
callback.apply(null, [false]);
}
}
},
width: 60
}
}
},
height: 50
},
center: {
el: {
type: "bi.text",
cls: "bi-message-text",
tgap: 60,
hgap: 20,
lineHeight: 30,
whiteSpace: "normal",
text: message
}
},
south: {
el: {
type: "bi.absolute",
items: [{
el: {
type: "bi.right_vertical_adapt",
hgap: 5,
items: controlItems
},
top: 0,
left: 20,
right: 20,
bottom: 0
}]
},
height: 60
} }
}, }
width: 400, }]
height: 300 },
} size: "small"
] }).open(name);
};
messageShow = BI.createWidget(conf);
} }
}; };
}();/** }();/**

60
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

345
dist/core.js vendored

@ -30415,6 +30415,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-center-adapt-layout", baseCls: "bi-center-adapt-layout",
columnSize: [], columnSize: [],
scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -30424,92 +30425,33 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.CenterAdaptLayout.superclass.render.apply(this, arguments); BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ return {
position: "relative", type: "bi.horizontal",
width: "100%", verticalAlign: BI.VerticalAlign.Middle,
height: "100%", horizontalAlign: BI.HorizontalAlign.Center,
"white-space": "nowrap", columnSize: o.columnSize,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", items: o.items,
"border-collapse": "separate" ref: function (_ref) {
}); self.layout = _ref;
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); },
this.$tr.appendTo(this.$table); hgap: o.hgap,
this.populate(this.options.items); vgap: o.vgap,
}, lgap: o.lgap,
rgap: o.rgap,
_addElement: function (i, item) { tgap: o.tgap,
var o = this.options; bgap: o.bgap
var td; };
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
td.element.css({"max-width": o.columnSize[i]});
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
}, },
resize: function () { resize: function () {
// console.log("center_adapt布局不需要resize"); // console.log("center_adapt布局不需要resize");
}, },
_getWrapper: function () {
return this.$tr;
},
populate: function (items) { populate: function (items) {
BI.CenterAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/** BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/**
@ -30641,8 +30583,40 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); var layoutArray = [];
if ("left" in o.items) {
layoutArray.push({
type: "bi.left",
items: [{
el: {
type: "bi.vertical_adapt",
height: "100%",
items: o.items.left,
hgap: o.lhgap,
lgap: o.llgap,
rgap: o.lrgap
}
}]
});
}
if ("right" in o.items) {
layoutArray.push({
type: "bi.right",
items: [{
el: {
type: "bi.vertical_adapt",
height: "100%",
items: o.items.right,
hgap: o.rhgap,
lgap: o.rlgap,
rgap: o.rrgap
}
}]
});
}
return layoutArray;
}, },
resize: function () { resize: function () {
@ -30654,40 +30628,6 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
if ("left" in items) {
var left = BI.createWidget({
type: "bi.vertical_adapt",
items: items.left,
hgap: o.lhgap,
lgap: o.llgap,
rgap: o.lrgap
});
left.element.css("height", "100%");
BI.createWidget({
type: "bi.left",
element: this,
items: [left]
});
}
if ("right" in items) {
var right = BI.createWidget({
type: "bi.vertical_adapt",
items: items.right,
hgap: o.rhgap,
lgap: o.rlgap,
rgap: o.rrgap
});
right.element.css("height", "100%");
BI.createWidget({
type: "bi.right",
element: this,
items: [right]
});
}
},
populate: function (items) { populate: function (items) {
BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this, arguments); BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();
@ -30707,8 +30647,22 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.LeftVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.LeftVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); return {
type: "bi.left",
ref: function (_ref) {
self.layout = _ref;
},
items: [{
type: "bi.vertical_adapt",
height: "100%",
items: o.items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
}]
};
}, },
resize: function () { resize: function () {
@ -30720,26 +30674,8 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
var left = BI.createWidget({
type: "bi.vertical_adapt",
items: items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
});
left.element.css("height", "100%");
BI.createWidget({
type: "bi.left",
element: this,
items: [left]
});
},
populate: function (items) { populate: function (items) {
BI.LeftVerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.left_vertical_adapt", BI.LeftVerticalAdaptLayout); BI.shortcut("bi.left_vertical_adapt", BI.LeftVerticalAdaptLayout);
@ -30755,8 +30691,22 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.RightVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.RightVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); return {
type: "bi.right",
ref: function (_ref) {
self.layout = _ref;
},
items: [{
type: "bi.vertical_adapt",
height: "100%",
items: o.items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
}]
};
}, },
resize: function () { resize: function () {
@ -30768,26 +30718,8 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
var right = BI.createWidget({
type: "bi.vertical_adapt",
items: items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
});
right.element.css("height", "100%");
BI.createWidget({
type: "bi.right",
element: this,
items: [right]
});
},
populate: function (items) { populate: function (items) {
BI.RightVerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout);/** BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout);/**
@ -30799,7 +30731,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
props: { props: {
baseCls: "bi-vertical-adapt-layout", baseCls: "bi-vertical-adapt-layout",
columnSize: [], columnSize: [],
horizontalAlign: BI.HorizontalAlign.Left, scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -30807,85 +30739,27 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
tgap: 0, tgap: 0,
bgap: 0 bgap: 0
}, },
render: function () { render: function () {
var self = this, o = this.options;
BI.VerticalAdaptLayout.superclass.render.apply(this, arguments); BI.VerticalAdaptLayout.superclass.render.apply(this, arguments);
var o = this.options; return {
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ type: "bi.horizontal",
position: "relative", verticalAlign: BI.VerticalAlign.Middle,
width: o.horizontalAlign === BI.HorizontalAlign.Stretch ? "100%" : "auto", horizontalAlign: BI.HorizontalAlign.Left,
height: "100%", columnSize: o.columnSize,
"white-space": "nowrap", items: o.items,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", ref: function (_ref) {
"border-collapse": "separate" self.layout = _ref;
}); },
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); hgap: o.hgap,
this.$tr.appendTo(this.$table); vgap: o.vgap,
this.populate(this.options.items); lgap: o.lgap,
}, rgap: o.rgap,
tgap: o.tgap,
_addElement: function (i, item) { bgap: o.bgap
var o = this.options; };
var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
},
_getWrapper: function () {
return this.$tr;
}, },
resize: function () { resize: function () {
@ -30893,8 +30767,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
BI.VerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/** BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/**
@ -32651,6 +32524,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-layout", baseCls: "bi-horizontal-layout",
verticalAlign: BI.VerticalAlign.Top, verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: BI.HorizontalAlign.Left,
columnSize: [], columnSize: [],
scrollx: true, scrollx: true,
hgap: 0, hgap: 0,
@ -32662,10 +32536,13 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options;
BI.HorizontalLayout.superclass.render.apply(this, arguments); BI.HorizontalLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative", position: "relative",
"white-space": "nowrap", "white-space": "nowrap",
height: o.verticalAlign === BI.VerticalAlign.Middle ? "100%" : "auto",
width: o.horizontalAlign === BI.HorizontalAlign.Center ? "100%" : "auto",
"border-spacing": "0px", "border-spacing": "0px",
border: "none", border: "none",
"border-collapse": "separate" "border-collapse": "separate"
@ -32695,7 +32572,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
td = this.getWidgetByName(this._getChildName(i)); td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width); td.element.attr("width", width);
} }
td.element.css({"max-width": o.columnSize[i] + "px"});
if (i === 0) { if (i === 0) {
td.element.addClass("first-element"); td.element.addClass("first-element");
} }

131
dist/demo.js vendored

@ -5973,33 +5973,118 @@ Demo.Horizontal = BI.inherit(BI.Widget, {
}, },
render: function () { render: function () {
return { return {
type: "bi.horizontal", type: "bi.vertical",
hgap: 10, vgap: 10,
items: [{ items: [{
type: "bi.label", type: "bi.horizontal",
whiteSpace: "normal", height: 150,
text: "因为大多数场景下都需要垂直居中,所以这个布局一般会被vertical_adapt布局设置scrollx=true取代", hgap: 10,
cls: "layout-bg3", items: [{
width: 500, type: "bi.label",
height: 50 whiteSpace: "normal",
text: "因为大多数场景下都需要垂直居中,所以这个布局一般会被vertical_adapt布局设置scrollx=true取代",
cls: "layout-bg3",
width: 500,
height: 50
}, {
type: "bi.label",
text: "水平布局",
cls: "layout-bg4",
width: 300,
height: 30
}, {
type: "bi.label",
text: "水平布局",
cls: "layout-bg5",
width: 300,
height: 30
}, {
type: "bi.label",
text: "水平布局",
cls: "layout-bg6",
width: 300,
height: 30
}]
}, { }, {
type: "bi.label", type: "bi.layout",
text: "水平布局", height: 1,
cls: "layout-bg4", cls: "bi-border-bottom bi-high-light-border"
width: 300,
height: 30
}, { }, {
type: "bi.label", type: "bi.horizontal",
text: "水平布局", height: 150,
cls: "layout-bg5", verticalAlign: BI.VerticalAlign.Middle,
width: 300, horizontalAlign: BI.HorizontalAlign.Left,
height: 30 vgap: 10,
items: [{
type: "bi.label",
text: "以horizontal实现的vertical_adapt垂直居中",
cls: "layout-bg1",
width: 300,
height: 30
}, {
type: "bi.label",
text: "以horizontal实现的vertical_adapt垂直居中",
cls: "layout-bg2",
width: 300,
height: 30
}]
}, { }, {
type: "bi.label", type: "bi.layout",
text: "水平布局", height: 1,
cls: "layout-bg6", cls: "bi-border-bottom bi-high-light-border"
width: 300, }, {
height: 30 type: "bi.horizontal",
height: 150,
verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: BI.HorizontalAlign.Center,
items: [{
type: "bi.label",
text: "以horizontal代替horizontal_adapt实现的水平居中(单元素)",
cls: "layout-bg1",
width: 300,
height: 30
}]
}, {
type: "bi.layout",
height: 1,
cls: "bi-border-bottom bi-high-light-border"
}, {
type: "bi.horizontal",
height: 150,
verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: BI.HorizontalAlign.Center,
columnSize: [300, "fill"],
items: [{
type: "bi.label",
text: "以horizontal代替horizontal_adapt实现的用于水平适应布局",
cls: "layout-bg1",
height: 30
}, {
type: "bi.label",
text: "以horizontal代替horizontal_adapt实现的水平自适应列",
cls: "layout-bg2",
height: 30
}]
}, {
type: "bi.layout",
height: 1,
cls: "bi-border-bottom bi-high-light-border"
}, {
type: "bi.center_adapt",
height: 150,
verticalAlign: BI.VerticalAlign.Middle,
horizontalAlign: BI.HorizontalAlign.Center,
items: [{
type: "bi.label",
text: "以horizontal代替center_adapt实现的水平垂直居中",
width: 300,
height: 100,
cls: "layout-bg1"
}]
}, {
type: "bi.layout",
height: 1,
cls: "bi-border-bottom bi-high-light-border"
}] }]
}; };
} }

504
dist/fineui.ie.js vendored

@ -30657,6 +30657,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-center-adapt-layout", baseCls: "bi-center-adapt-layout",
columnSize: [], columnSize: [],
scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -30666,92 +30667,33 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.CenterAdaptLayout.superclass.render.apply(this, arguments); BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ return {
position: "relative", type: "bi.horizontal",
width: "100%", verticalAlign: BI.VerticalAlign.Middle,
height: "100%", horizontalAlign: BI.HorizontalAlign.Center,
"white-space": "nowrap", columnSize: o.columnSize,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", items: o.items,
"border-collapse": "separate" ref: function (_ref) {
}); self.layout = _ref;
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); },
this.$tr.appendTo(this.$table); hgap: o.hgap,
this.populate(this.options.items); vgap: o.vgap,
}, lgap: o.lgap,
rgap: o.rgap,
_addElement: function (i, item) { tgap: o.tgap,
var o = this.options; bgap: o.bgap
var td; };
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
td.element.css({"max-width": o.columnSize[i]});
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
}, },
resize: function () { resize: function () {
// console.log("center_adapt布局不需要resize"); // console.log("center_adapt布局不需要resize");
}, },
_getWrapper: function () {
return this.$tr;
},
populate: function (items) { populate: function (items) {
BI.CenterAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/** BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/**
@ -30883,8 +30825,40 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); var layoutArray = [];
if ("left" in o.items) {
layoutArray.push({
type: "bi.left",
items: [{
el: {
type: "bi.vertical_adapt",
height: "100%",
items: o.items.left,
hgap: o.lhgap,
lgap: o.llgap,
rgap: o.lrgap
}
}]
});
}
if ("right" in o.items) {
layoutArray.push({
type: "bi.right",
items: [{
el: {
type: "bi.vertical_adapt",
height: "100%",
items: o.items.right,
hgap: o.rhgap,
lgap: o.rlgap,
rgap: o.rrgap
}
}]
});
}
return layoutArray;
}, },
resize: function () { resize: function () {
@ -30896,40 +30870,6 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
if ("left" in items) {
var left = BI.createWidget({
type: "bi.vertical_adapt",
items: items.left,
hgap: o.lhgap,
lgap: o.llgap,
rgap: o.lrgap
});
left.element.css("height", "100%");
BI.createWidget({
type: "bi.left",
element: this,
items: [left]
});
}
if ("right" in items) {
var right = BI.createWidget({
type: "bi.vertical_adapt",
items: items.right,
hgap: o.rhgap,
lgap: o.rlgap,
rgap: o.rrgap
});
right.element.css("height", "100%");
BI.createWidget({
type: "bi.right",
element: this,
items: [right]
});
}
},
populate: function (items) { populate: function (items) {
BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this, arguments); BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();
@ -30949,8 +30889,22 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.LeftVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.LeftVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); return {
type: "bi.left",
ref: function (_ref) {
self.layout = _ref;
},
items: [{
type: "bi.vertical_adapt",
height: "100%",
items: o.items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
}]
};
}, },
resize: function () { resize: function () {
@ -30962,26 +30916,8 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
var left = BI.createWidget({
type: "bi.vertical_adapt",
items: items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
});
left.element.css("height", "100%");
BI.createWidget({
type: "bi.left",
element: this,
items: [left]
});
},
populate: function (items) { populate: function (items) {
BI.LeftVerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.left_vertical_adapt", BI.LeftVerticalAdaptLayout); BI.shortcut("bi.left_vertical_adapt", BI.LeftVerticalAdaptLayout);
@ -30997,8 +30933,22 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.RightVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.RightVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); return {
type: "bi.right",
ref: function (_ref) {
self.layout = _ref;
},
items: [{
type: "bi.vertical_adapt",
height: "100%",
items: o.items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
}]
};
}, },
resize: function () { resize: function () {
@ -31010,26 +30960,8 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
var right = BI.createWidget({
type: "bi.vertical_adapt",
items: items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
});
right.element.css("height", "100%");
BI.createWidget({
type: "bi.right",
element: this,
items: [right]
});
},
populate: function (items) { populate: function (items) {
BI.RightVerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout);/** BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout);/**
@ -31041,7 +30973,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
props: { props: {
baseCls: "bi-vertical-adapt-layout", baseCls: "bi-vertical-adapt-layout",
columnSize: [], columnSize: [],
horizontalAlign: BI.HorizontalAlign.Left, scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -31049,85 +30981,27 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
tgap: 0, tgap: 0,
bgap: 0 bgap: 0
}, },
render: function () { render: function () {
var self = this, o = this.options;
BI.VerticalAdaptLayout.superclass.render.apply(this, arguments); BI.VerticalAdaptLayout.superclass.render.apply(this, arguments);
var o = this.options; return {
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ type: "bi.horizontal",
position: "relative", verticalAlign: BI.VerticalAlign.Middle,
width: o.horizontalAlign === BI.HorizontalAlign.Stretch ? "100%" : "auto", horizontalAlign: BI.HorizontalAlign.Left,
height: "100%", columnSize: o.columnSize,
"white-space": "nowrap", items: o.items,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", ref: function (_ref) {
"border-collapse": "separate" self.layout = _ref;
}); },
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); hgap: o.hgap,
this.$tr.appendTo(this.$table); vgap: o.vgap,
this.populate(this.options.items); lgap: o.lgap,
}, rgap: o.rgap,
tgap: o.tgap,
_addElement: function (i, item) { bgap: o.bgap
var o = this.options; };
var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
},
_getWrapper: function () {
return this.$tr;
}, },
resize: function () { resize: function () {
@ -31135,8 +31009,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
BI.VerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/** BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/**
@ -32893,6 +32766,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-layout", baseCls: "bi-horizontal-layout",
verticalAlign: BI.VerticalAlign.Top, verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: BI.HorizontalAlign.Left,
columnSize: [], columnSize: [],
scrollx: true, scrollx: true,
hgap: 0, hgap: 0,
@ -32904,10 +32778,13 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options;
BI.HorizontalLayout.superclass.render.apply(this, arguments); BI.HorizontalLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative", position: "relative",
"white-space": "nowrap", "white-space": "nowrap",
height: o.verticalAlign === BI.VerticalAlign.Middle ? "100%" : "auto",
width: o.horizontalAlign === BI.HorizontalAlign.Center ? "100%" : "auto",
"border-spacing": "0px", "border-spacing": "0px",
border: "none", border: "none",
"border-collapse": "separate" "border-collapse": "separate"
@ -32937,7 +32814,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
td = this.getWidgetByName(this._getChildName(i)); td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width); td.element.attr("width", width);
} }
td.element.css({"max-width": o.columnSize[i] + "px"});
if (i === 0) { if (i === 0) {
td.element.addClass("first-element"); td.element.addClass("first-element");
} }
@ -40472,132 +40349,57 @@ BI.Msg = function () {
}, 5000); }, 5000);
}, },
_show: function (hasCancel, title, message, callback) { _show: function (hasCancel, title, message, callback) {
$mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({ var name = BI.UUID();
position: "absolute", BI.Popovers.create(name, {
zIndex: BI.zIndex_tip - 2, type: "bi.bar_popover",
top: 0, header: title,
left: 0, body: {
right: 0, type: "bi.center_adapt",
bottom: 0, items: [{
opacity: 0.5 type: "bi.label",
}).appendTo("body"); text: message
$pop = BI.Widget._renderEngine.createElement("<div class=\"bi-message-depend\">").css({ }]
position: "absolute", },
zIndex: BI.zIndex_tip - 1, footer: hasCancel ? {
top: 0, type: "bi.right_vertical_adapt",
left: 0, lgap: 10,
right: 0, items: [{
bottom: 0
}).appendTo("body");
var close = function () {
messageShow.destroy();
$mask.remove();
};
var controlItems = [];
if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button", type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"), text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore", level: "ignore",
handler: function () { handler: function () {
close(); BI.Popovers.remove(name);
if (BI.isFunction(callback)) { if (BI.isFunction(callback)) {
callback.apply(null, [false]); callback.apply(null, [false]);
} }
} }
} }, {
}); type: "bi.button",
} text: BI.i18nText("BI-Basic_Sure"),
controlItems.push({ handler: function () {
el: { BI.Popovers.remove(name);
type: "bi.button", if (BI.isFunction(callback)) {
text: BI.i18nText("BI-Basic_OK"), callback.apply(null, [true]);
handler: function () { }
close();
if (BI.isFunction(callback)) {
callback.apply(null, [true]);
} }
} }]
} } : {
}); type: "bi.right_vertical_adapt",
var conf = { lgap: 10,
element: $pop, items: [{
type: "bi.center_adapt", type: "bi.button",
items: [ text: BI.i18nText("BI-Basic_Cancel"),
{ level: "ignore",
type: "bi.border", handler: function () {
cls: "bi-message-content bi-card", BI.Popovers.remove(name);
items: { if (BI.isFunction(callback)) {
north: { callback.apply(null, [false]);
el: {
type: "bi.border",
cls: "bi-message-title bi-background",
items: {
center: {
el: {
type: "bi.label",
text: title || BI.i18nText("BI-Basic_Prompt"),
textAlign: "left",
hgap: 20,
height: 50
}
},
east: {
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
// height: 50,
handler: function () {
close();
if (BI.isFunction(callback)) {
callback.apply(null, [false]);
}
}
},
width: 60
}
}
},
height: 50
},
center: {
el: {
type: "bi.text",
cls: "bi-message-text",
tgap: 60,
hgap: 20,
lineHeight: 30,
whiteSpace: "normal",
text: message
}
},
south: {
el: {
type: "bi.absolute",
items: [{
el: {
type: "bi.right_vertical_adapt",
hgap: 5,
items: controlItems
},
top: 0,
left: 20,
right: 20,
bottom: 0
}]
},
height: 60
} }
}, }
width: 400, }]
height: 300 },
} size: "small"
] }).open(name);
};
messageShow = BI.createWidget(conf);
} }
}; };
}();/** }();/**
@ -82823,7 +82625,7 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);(function () {
}); });
}; };
$(document).ajaxStop(additionFunc); $(document).ajaxComplete(additionFunc);
if (BI.history) { if (BI.history) {
var navigate = BI.history.navigate; var navigate = BI.history.navigate;

60
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

502
dist/fineui.js vendored

@ -30657,6 +30657,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-center-adapt-layout", baseCls: "bi-center-adapt-layout",
columnSize: [], columnSize: [],
scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -30666,92 +30667,33 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.CenterAdaptLayout.superclass.render.apply(this, arguments); BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ return {
position: "relative", type: "bi.horizontal",
width: "100%", verticalAlign: BI.VerticalAlign.Middle,
height: "100%", horizontalAlign: BI.HorizontalAlign.Center,
"white-space": "nowrap", columnSize: o.columnSize,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", items: o.items,
"border-collapse": "separate" ref: function (_ref) {
}); self.layout = _ref;
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); },
this.$tr.appendTo(this.$table); hgap: o.hgap,
this.populate(this.options.items); vgap: o.vgap,
}, lgap: o.lgap,
rgap: o.rgap,
_addElement: function (i, item) { tgap: o.tgap,
var o = this.options; bgap: o.bgap
var td; };
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
td.element.css({"max-width": o.columnSize[i]});
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
}, },
resize: function () { resize: function () {
// console.log("center_adapt布局不需要resize"); // console.log("center_adapt布局不需要resize");
}, },
_getWrapper: function () {
return this.$tr;
},
populate: function (items) { populate: function (items) {
BI.CenterAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/** BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/**
@ -30883,8 +30825,40 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); var layoutArray = [];
if ("left" in o.items) {
layoutArray.push({
type: "bi.left",
items: [{
el: {
type: "bi.vertical_adapt",
height: "100%",
items: o.items.left,
hgap: o.lhgap,
lgap: o.llgap,
rgap: o.lrgap
}
}]
});
}
if ("right" in o.items) {
layoutArray.push({
type: "bi.right",
items: [{
el: {
type: "bi.vertical_adapt",
height: "100%",
items: o.items.right,
hgap: o.rhgap,
lgap: o.rlgap,
rgap: o.rrgap
}
}]
});
}
return layoutArray;
}, },
resize: function () { resize: function () {
@ -30896,40 +30870,6 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
if ("left" in items) {
var left = BI.createWidget({
type: "bi.vertical_adapt",
items: items.left,
hgap: o.lhgap,
lgap: o.llgap,
rgap: o.lrgap
});
left.element.css("height", "100%");
BI.createWidget({
type: "bi.left",
element: this,
items: [left]
});
}
if ("right" in items) {
var right = BI.createWidget({
type: "bi.vertical_adapt",
items: items.right,
hgap: o.rhgap,
lgap: o.rlgap,
rgap: o.rrgap
});
right.element.css("height", "100%");
BI.createWidget({
type: "bi.right",
element: this,
items: [right]
});
}
},
populate: function (items) { populate: function (items) {
BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this, arguments); BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();
@ -30949,8 +30889,22 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.LeftVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.LeftVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); return {
type: "bi.left",
ref: function (_ref) {
self.layout = _ref;
},
items: [{
type: "bi.vertical_adapt",
height: "100%",
items: o.items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
}]
};
}, },
resize: function () { resize: function () {
@ -30962,26 +30916,8 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
var left = BI.createWidget({
type: "bi.vertical_adapt",
items: items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
});
left.element.css("height", "100%");
BI.createWidget({
type: "bi.left",
element: this,
items: [left]
});
},
populate: function (items) { populate: function (items) {
BI.LeftVerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.left_vertical_adapt", BI.LeftVerticalAdaptLayout); BI.shortcut("bi.left_vertical_adapt", BI.LeftVerticalAdaptLayout);
@ -30997,8 +30933,22 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.RightVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.RightVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); return {
type: "bi.right",
ref: function (_ref) {
self.layout = _ref;
},
items: [{
type: "bi.vertical_adapt",
height: "100%",
items: o.items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
}]
};
}, },
resize: function () { resize: function () {
@ -31010,26 +30960,8 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
var right = BI.createWidget({
type: "bi.vertical_adapt",
items: items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
});
right.element.css("height", "100%");
BI.createWidget({
type: "bi.right",
element: this,
items: [right]
});
},
populate: function (items) { populate: function (items) {
BI.RightVerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout);/** BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout);/**
@ -31041,7 +30973,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
props: { props: {
baseCls: "bi-vertical-adapt-layout", baseCls: "bi-vertical-adapt-layout",
columnSize: [], columnSize: [],
horizontalAlign: BI.HorizontalAlign.Left, scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -31049,85 +30981,27 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
tgap: 0, tgap: 0,
bgap: 0 bgap: 0
}, },
render: function () { render: function () {
var self = this, o = this.options;
BI.VerticalAdaptLayout.superclass.render.apply(this, arguments); BI.VerticalAdaptLayout.superclass.render.apply(this, arguments);
var o = this.options; return {
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ type: "bi.horizontal",
position: "relative", verticalAlign: BI.VerticalAlign.Middle,
width: o.horizontalAlign === BI.HorizontalAlign.Stretch ? "100%" : "auto", horizontalAlign: BI.HorizontalAlign.Left,
height: "100%", columnSize: o.columnSize,
"white-space": "nowrap", items: o.items,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", ref: function (_ref) {
"border-collapse": "separate" self.layout = _ref;
}); },
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); hgap: o.hgap,
this.$tr.appendTo(this.$table); vgap: o.vgap,
this.populate(this.options.items); lgap: o.lgap,
}, rgap: o.rgap,
tgap: o.tgap,
_addElement: function (i, item) { bgap: o.bgap
var o = this.options; };
var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
},
_getWrapper: function () {
return this.$tr;
}, },
resize: function () { resize: function () {
@ -31135,8 +31009,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
BI.VerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/** BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/**
@ -32893,6 +32766,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-layout", baseCls: "bi-horizontal-layout",
verticalAlign: BI.VerticalAlign.Top, verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: BI.HorizontalAlign.Left,
columnSize: [], columnSize: [],
scrollx: true, scrollx: true,
hgap: 0, hgap: 0,
@ -32904,10 +32778,13 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options;
BI.HorizontalLayout.superclass.render.apply(this, arguments); BI.HorizontalLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative", position: "relative",
"white-space": "nowrap", "white-space": "nowrap",
height: o.verticalAlign === BI.VerticalAlign.Middle ? "100%" : "auto",
width: o.horizontalAlign === BI.HorizontalAlign.Center ? "100%" : "auto",
"border-spacing": "0px", "border-spacing": "0px",
border: "none", border: "none",
"border-collapse": "separate" "border-collapse": "separate"
@ -32937,7 +32814,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
td = this.getWidgetByName(this._getChildName(i)); td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width); td.element.attr("width", width);
} }
td.element.css({"max-width": o.columnSize[i] + "px"});
if (i === 0) { if (i === 0) {
td.element.addClass("first-element"); td.element.addClass("first-element");
} }
@ -40876,132 +40753,57 @@ BI.Msg = function () {
}, 5000); }, 5000);
}, },
_show: function (hasCancel, title, message, callback) { _show: function (hasCancel, title, message, callback) {
$mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({ var name = BI.UUID();
position: "absolute", BI.Popovers.create(name, {
zIndex: BI.zIndex_tip - 2, type: "bi.bar_popover",
top: 0, header: title,
left: 0, body: {
right: 0, type: "bi.center_adapt",
bottom: 0, items: [{
opacity: 0.5 type: "bi.label",
}).appendTo("body"); text: message
$pop = BI.Widget._renderEngine.createElement("<div class=\"bi-message-depend\">").css({ }]
position: "absolute", },
zIndex: BI.zIndex_tip - 1, footer: hasCancel ? {
top: 0, type: "bi.right_vertical_adapt",
left: 0, lgap: 10,
right: 0, items: [{
bottom: 0
}).appendTo("body");
var close = function () {
messageShow.destroy();
$mask.remove();
};
var controlItems = [];
if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button", type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"), text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore", level: "ignore",
handler: function () { handler: function () {
close(); BI.Popovers.remove(name);
if (BI.isFunction(callback)) { if (BI.isFunction(callback)) {
callback.apply(null, [false]); callback.apply(null, [false]);
} }
} }
} }, {
}); type: "bi.button",
} text: BI.i18nText("BI-Basic_Sure"),
controlItems.push({ handler: function () {
el: { BI.Popovers.remove(name);
type: "bi.button", if (BI.isFunction(callback)) {
text: BI.i18nText("BI-Basic_OK"), callback.apply(null, [true]);
handler: function () { }
close();
if (BI.isFunction(callback)) {
callback.apply(null, [true]);
} }
} }]
} } : {
}); type: "bi.right_vertical_adapt",
var conf = { lgap: 10,
element: $pop, items: [{
type: "bi.center_adapt", type: "bi.button",
items: [ text: BI.i18nText("BI-Basic_Cancel"),
{ level: "ignore",
type: "bi.border", handler: function () {
cls: "bi-message-content bi-card", BI.Popovers.remove(name);
items: { if (BI.isFunction(callback)) {
north: { callback.apply(null, [false]);
el: {
type: "bi.border",
cls: "bi-message-title bi-background",
items: {
center: {
el: {
type: "bi.label",
text: title || BI.i18nText("BI-Basic_Prompt"),
textAlign: "left",
hgap: 20,
height: 50
}
},
east: {
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
// height: 50,
handler: function () {
close();
if (BI.isFunction(callback)) {
callback.apply(null, [false]);
}
}
},
width: 60
}
}
},
height: 50
},
center: {
el: {
type: "bi.text",
cls: "bi-message-text",
tgap: 60,
hgap: 20,
lineHeight: 30,
whiteSpace: "normal",
text: message
}
},
south: {
el: {
type: "bi.absolute",
items: [{
el: {
type: "bi.right_vertical_adapt",
hgap: 5,
items: controlItems
},
top: 0,
left: 20,
right: 20,
bottom: 0
}]
},
height: 60
} }
}, }
width: 400, }]
height: 300 },
} size: "small"
] }).open(name);
};
messageShow = BI.createWidget(conf);
} }
}; };
}();/** }();/**

60
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

502
dist/fineui_without_jquery_polyfill.js vendored

@ -19426,6 +19426,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-center-adapt-layout", baseCls: "bi-center-adapt-layout",
columnSize: [], columnSize: [],
scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -19435,92 +19436,33 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.CenterAdaptLayout.superclass.render.apply(this, arguments); BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ return {
position: "relative", type: "bi.horizontal",
width: "100%", verticalAlign: BI.VerticalAlign.Middle,
height: "100%", horizontalAlign: BI.HorizontalAlign.Center,
"white-space": "nowrap", columnSize: o.columnSize,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", items: o.items,
"border-collapse": "separate" ref: function (_ref) {
}); self.layout = _ref;
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); },
this.$tr.appendTo(this.$table); hgap: o.hgap,
this.populate(this.options.items); vgap: o.vgap,
}, lgap: o.lgap,
rgap: o.rgap,
_addElement: function (i, item) { tgap: o.tgap,
var o = this.options; bgap: o.bgap
var td; };
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
td.element.css({"max-width": o.columnSize[i]});
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
}, },
resize: function () { resize: function () {
// console.log("center_adapt布局不需要resize"); // console.log("center_adapt布局不需要resize");
}, },
_getWrapper: function () {
return this.$tr;
},
populate: function (items) { populate: function (items) {
BI.CenterAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/** BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);/**
@ -19652,8 +19594,40 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); var layoutArray = [];
if ("left" in o.items) {
layoutArray.push({
type: "bi.left",
items: [{
el: {
type: "bi.vertical_adapt",
height: "100%",
items: o.items.left,
hgap: o.lhgap,
lgap: o.llgap,
rgap: o.lrgap
}
}]
});
}
if ("right" in o.items) {
layoutArray.push({
type: "bi.right",
items: [{
el: {
type: "bi.vertical_adapt",
height: "100%",
items: o.items.right,
hgap: o.rhgap,
lgap: o.rlgap,
rgap: o.rrgap
}
}]
});
}
return layoutArray;
}, },
resize: function () { resize: function () {
@ -19665,40 +19639,6 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
if ("left" in items) {
var left = BI.createWidget({
type: "bi.vertical_adapt",
items: items.left,
hgap: o.lhgap,
lgap: o.llgap,
rgap: o.lrgap
});
left.element.css("height", "100%");
BI.createWidget({
type: "bi.left",
element: this,
items: [left]
});
}
if ("right" in items) {
var right = BI.createWidget({
type: "bi.vertical_adapt",
items: items.right,
hgap: o.rhgap,
lgap: o.rlgap,
rgap: o.rrgap
});
right.element.css("height", "100%");
BI.createWidget({
type: "bi.right",
element: this,
items: [right]
});
}
},
populate: function (items) { populate: function (items) {
BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this, arguments); BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();
@ -19718,8 +19658,22 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.LeftVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.LeftVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); return {
type: "bi.left",
ref: function (_ref) {
self.layout = _ref;
},
items: [{
type: "bi.vertical_adapt",
height: "100%",
items: o.items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
}]
};
}, },
resize: function () { resize: function () {
@ -19731,26 +19685,8 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
var left = BI.createWidget({
type: "bi.vertical_adapt",
items: items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
});
left.element.css("height", "100%");
BI.createWidget({
type: "bi.left",
element: this,
items: [left]
});
},
populate: function (items) { populate: function (items) {
BI.LeftVerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.left_vertical_adapt", BI.LeftVerticalAdaptLayout); BI.shortcut("bi.left_vertical_adapt", BI.LeftVerticalAdaptLayout);
@ -19766,8 +19702,22 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.RightVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.RightVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); return {
type: "bi.right",
ref: function (_ref) {
self.layout = _ref;
},
items: [{
type: "bi.vertical_adapt",
height: "100%",
items: o.items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
}]
};
}, },
resize: function () { resize: function () {
@ -19779,26 +19729,8 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
var right = BI.createWidget({
type: "bi.vertical_adapt",
items: items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
});
right.element.css("height", "100%");
BI.createWidget({
type: "bi.right",
element: this,
items: [right]
});
},
populate: function (items) { populate: function (items) {
BI.RightVerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout);/** BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout);/**
@ -19810,7 +19742,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
props: { props: {
baseCls: "bi-vertical-adapt-layout", baseCls: "bi-vertical-adapt-layout",
columnSize: [], columnSize: [],
horizontalAlign: BI.HorizontalAlign.Left, scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -19818,85 +19750,27 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
tgap: 0, tgap: 0,
bgap: 0 bgap: 0
}, },
render: function () { render: function () {
var self = this, o = this.options;
BI.VerticalAdaptLayout.superclass.render.apply(this, arguments); BI.VerticalAdaptLayout.superclass.render.apply(this, arguments);
var o = this.options; return {
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ type: "bi.horizontal",
position: "relative", verticalAlign: BI.VerticalAlign.Middle,
width: o.horizontalAlign === BI.HorizontalAlign.Stretch ? "100%" : "auto", horizontalAlign: BI.HorizontalAlign.Left,
height: "100%", columnSize: o.columnSize,
"white-space": "nowrap", items: o.items,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", ref: function (_ref) {
"border-collapse": "separate" self.layout = _ref;
}); },
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); hgap: o.hgap,
this.$tr.appendTo(this.$table); vgap: o.vgap,
this.populate(this.options.items); lgap: o.lgap,
}, rgap: o.rgap,
tgap: o.tgap,
_addElement: function (i, item) { bgap: o.bgap
var o = this.options; };
var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
},
_getWrapper: function () {
return this.$tr;
}, },
resize: function () { resize: function () {
@ -19904,8 +19778,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
BI.VerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/** BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);/**
@ -21662,6 +21535,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-layout", baseCls: "bi-horizontal-layout",
verticalAlign: BI.VerticalAlign.Top, verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: BI.HorizontalAlign.Left,
columnSize: [], columnSize: [],
scrollx: true, scrollx: true,
hgap: 0, hgap: 0,
@ -21673,10 +21547,13 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options;
BI.HorizontalLayout.superclass.render.apply(this, arguments); BI.HorizontalLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative", position: "relative",
"white-space": "nowrap", "white-space": "nowrap",
height: o.verticalAlign === BI.VerticalAlign.Middle ? "100%" : "auto",
width: o.horizontalAlign === BI.HorizontalAlign.Center ? "100%" : "auto",
"border-spacing": "0px", "border-spacing": "0px",
border: "none", border: "none",
"border-collapse": "separate" "border-collapse": "separate"
@ -21706,7 +21583,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
td = this.getWidgetByName(this._getChildName(i)); td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width); td.element.attr("width", width);
} }
td.element.css({"max-width": o.columnSize[i] + "px"});
if (i === 0) { if (i === 0) {
td.element.addClass("first-element"); td.element.addClass("first-element");
} }
@ -28543,132 +28420,57 @@ BI.Msg = function () {
}, 5000); }, 5000);
}, },
_show: function (hasCancel, title, message, callback) { _show: function (hasCancel, title, message, callback) {
$mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({ var name = BI.UUID();
position: "absolute", BI.Popovers.create(name, {
zIndex: BI.zIndex_tip - 2, type: "bi.bar_popover",
top: 0, header: title,
left: 0, body: {
right: 0, type: "bi.center_adapt",
bottom: 0, items: [{
opacity: 0.5 type: "bi.label",
}).appendTo("body"); text: message
$pop = BI.Widget._renderEngine.createElement("<div class=\"bi-message-depend\">").css({ }]
position: "absolute", },
zIndex: BI.zIndex_tip - 1, footer: hasCancel ? {
top: 0, type: "bi.right_vertical_adapt",
left: 0, lgap: 10,
right: 0, items: [{
bottom: 0
}).appendTo("body");
var close = function () {
messageShow.destroy();
$mask.remove();
};
var controlItems = [];
if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button", type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"), text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore", level: "ignore",
handler: function () { handler: function () {
close(); BI.Popovers.remove(name);
if (BI.isFunction(callback)) { if (BI.isFunction(callback)) {
callback.apply(null, [false]); callback.apply(null, [false]);
} }
} }
} }, {
}); type: "bi.button",
} text: BI.i18nText("BI-Basic_Sure"),
controlItems.push({ handler: function () {
el: { BI.Popovers.remove(name);
type: "bi.button", if (BI.isFunction(callback)) {
text: BI.i18nText("BI-Basic_OK"), callback.apply(null, [true]);
handler: function () { }
close();
if (BI.isFunction(callback)) {
callback.apply(null, [true]);
} }
} }]
} } : {
}); type: "bi.right_vertical_adapt",
var conf = { lgap: 10,
element: $pop, items: [{
type: "bi.center_adapt", type: "bi.button",
items: [ text: BI.i18nText("BI-Basic_Cancel"),
{ level: "ignore",
type: "bi.border", handler: function () {
cls: "bi-message-content bi-card", BI.Popovers.remove(name);
items: { if (BI.isFunction(callback)) {
north: { callback.apply(null, [false]);
el: {
type: "bi.border",
cls: "bi-message-title bi-background",
items: {
center: {
el: {
type: "bi.label",
text: title || BI.i18nText("BI-Basic_Prompt"),
textAlign: "left",
hgap: 20,
height: 50
}
},
east: {
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
// height: 50,
handler: function () {
close();
if (BI.isFunction(callback)) {
callback.apply(null, [false]);
}
}
},
width: 60
}
}
},
height: 50
},
center: {
el: {
type: "bi.text",
cls: "bi-message-text",
tgap: 60,
hgap: 20,
lineHeight: 30,
whiteSpace: "normal",
text: message
}
},
south: {
el: {
type: "bi.absolute",
items: [{
el: {
type: "bi.right_vertical_adapt",
hgap: 5,
items: controlItems
},
top: 0,
left: 20,
right: 20,
bottom: 0
}]
},
height: 60
} }
}, }
width: 400, }]
height: 300 },
} size: "small"
] }).open(name);
};
messageShow = BI.createWidget(conf);
} }
}; };
}();/** }();/**

2
dist/fix/fix.compact.ie.js vendored

@ -207,7 +207,7 @@
}); });
}; };
$(document).ajaxStop(additionFunc); $(document).ajaxComplete(additionFunc);
if (BI.history) { if (BI.history) {
var navigate = BI.history.navigate; var navigate = BI.history.navigate;

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

157
src/base/foundation/message.js

@ -49,132 +49,57 @@ BI.Msg = function () {
}, 5000); }, 5000);
}, },
_show: function (hasCancel, title, message, callback) { _show: function (hasCancel, title, message, callback) {
$mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({ var name = BI.UUID();
position: "absolute", BI.Popovers.create(name, {
zIndex: BI.zIndex_tip - 2, type: "bi.bar_popover",
top: 0, header: title,
left: 0, body: {
right: 0, type: "bi.center_adapt",
bottom: 0, items: [{
opacity: 0.5 type: "bi.label",
}).appendTo("body"); text: message
$pop = BI.Widget._renderEngine.createElement("<div class=\"bi-message-depend\">").css({ }]
position: "absolute", },
zIndex: BI.zIndex_tip - 1, footer: hasCancel ? {
top: 0, type: "bi.right_vertical_adapt",
left: 0, lgap: 10,
right: 0, items: [{
bottom: 0
}).appendTo("body");
var close = function () {
messageShow.destroy();
$mask.remove();
};
var controlItems = [];
if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button", type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"), text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore", level: "ignore",
handler: function () { handler: function () {
close(); BI.Popovers.remove(name);
if (BI.isFunction(callback)) { if (BI.isFunction(callback)) {
callback.apply(null, [false]); callback.apply(null, [false]);
} }
} }
} }, {
}); type: "bi.button",
} text: BI.i18nText("BI-Basic_Sure"),
controlItems.push({ handler: function () {
el: { BI.Popovers.remove(name);
type: "bi.button", if (BI.isFunction(callback)) {
text: BI.i18nText("BI-Basic_OK"), callback.apply(null, [true]);
handler: function () { }
close();
if (BI.isFunction(callback)) {
callback.apply(null, [true]);
} }
} }]
} } : {
}); type: "bi.right_vertical_adapt",
var conf = { lgap: 10,
element: $pop, items: [{
type: "bi.center_adapt", type: "bi.button",
items: [ text: BI.i18nText("BI-Basic_Cancel"),
{ level: "ignore",
type: "bi.border", handler: function () {
cls: "bi-message-content bi-card", BI.Popovers.remove(name);
items: { if (BI.isFunction(callback)) {
north: { callback.apply(null, [false]);
el: {
type: "bi.border",
cls: "bi-message-title bi-background",
items: {
center: {
el: {
type: "bi.label",
text: title || BI.i18nText("BI-Basic_Prompt"),
textAlign: "left",
hgap: 20,
height: 50
}
},
east: {
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
// height: 50,
handler: function () {
close();
if (BI.isFunction(callback)) {
callback.apply(null, [false]);
}
}
},
width: 60
}
}
},
height: 50
},
center: {
el: {
type: "bi.text",
cls: "bi-message-text",
tgap: 60,
hgap: 20,
lineHeight: 30,
whiteSpace: "normal",
text: message
}
},
south: {
el: {
type: "bi.absolute",
items: [{
el: {
type: "bi.right_vertical_adapt",
hgap: 5,
items: controlItems
},
top: 0,
left: 20,
right: 20,
bottom: 0
}]
},
height: 60
} }
}, }
width: 400, }]
height: 300 },
} size: "small"
] }).open(name);
};
messageShow = BI.createWidget(conf);
} }
}; };
}(); }();

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

@ -8,6 +8,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-center-adapt-layout", baseCls: "bi-center-adapt-layout",
columnSize: [], columnSize: [],
scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -17,92 +18,33 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.CenterAdaptLayout.superclass.render.apply(this, arguments); BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ return {
position: "relative", type: "bi.horizontal",
width: "100%", verticalAlign: BI.VerticalAlign.Middle,
height: "100%", horizontalAlign: BI.HorizontalAlign.Center,
"white-space": "nowrap", columnSize: o.columnSize,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", items: o.items,
"border-collapse": "separate" ref: function (_ref) {
}); self.layout = _ref;
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); },
this.$tr.appendTo(this.$table); hgap: o.hgap,
this.populate(this.options.items); vgap: o.vgap,
}, lgap: o.lgap,
rgap: o.rgap,
_addElement: function (i, item) { tgap: o.tgap,
var o = this.options; bgap: o.bgap
var td; };
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
td.element.css({"max-width": o.columnSize[i]});
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
}, },
resize: function () { resize: function () {
// console.log("center_adapt布局不需要resize"); // console.log("center_adapt布局不需要resize");
}, },
_getWrapper: function () {
return this.$tr;
},
populate: function (items) { populate: function (items) {
BI.CenterAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout); BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);

140
src/core/wrapper/layout/adapt/adapt.leftrightvertical.js

@ -21,8 +21,40 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); var layoutArray = [];
if ("left" in o.items) {
layoutArray.push({
type: "bi.left",
items: [{
el: {
type: "bi.vertical_adapt",
height: "100%",
items: o.items.left,
hgap: o.lhgap,
lgap: o.llgap,
rgap: o.lrgap
}
}]
});
}
if ("right" in o.items) {
layoutArray.push({
type: "bi.right",
items: [{
el: {
type: "bi.vertical_adapt",
height: "100%",
items: o.items.right,
hgap: o.rhgap,
lgap: o.rlgap,
rgap: o.rrgap
}
}]
});
}
return layoutArray;
}, },
resize: function () { resize: function () {
@ -34,40 +66,6 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
if ("left" in items) {
var left = BI.createWidget({
type: "bi.vertical_adapt",
items: items.left,
hgap: o.lhgap,
lgap: o.llgap,
rgap: o.lrgap
});
left.element.css("height", "100%");
BI.createWidget({
type: "bi.left",
element: this,
items: [left]
});
}
if ("right" in items) {
var right = BI.createWidget({
type: "bi.vertical_adapt",
items: items.right,
hgap: o.rhgap,
lgap: o.rlgap,
rgap: o.rrgap
});
right.element.css("height", "100%");
BI.createWidget({
type: "bi.right",
element: this,
items: [right]
});
}
},
populate: function (items) { populate: function (items) {
BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this, arguments); BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this, arguments);
this._mount(); this._mount();
@ -87,8 +85,22 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.LeftVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.LeftVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); return {
type: "bi.left",
ref: function (_ref) {
self.layout = _ref;
},
items: [{
type: "bi.vertical_adapt",
height: "100%",
items: o.items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
}]
};
}, },
resize: function () { resize: function () {
@ -100,26 +112,8 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
var left = BI.createWidget({
type: "bi.vertical_adapt",
items: items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
});
left.element.css("height", "100%");
BI.createWidget({
type: "bi.left",
element: this,
items: [left]
});
},
populate: function (items) { populate: function (items) {
BI.LeftVerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.left_vertical_adapt", BI.LeftVerticalAdaptLayout); BI.shortcut("bi.left_vertical_adapt", BI.LeftVerticalAdaptLayout);
@ -135,8 +129,22 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this;
BI.RightVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.RightVerticalAdaptLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); return {
type: "bi.right",
ref: function (_ref) {
self.layout = _ref;
},
items: [{
type: "bi.vertical_adapt",
height: "100%",
items: o.items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
}]
};
}, },
resize: function () { resize: function () {
@ -148,26 +156,8 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
throw new Error("cannot be added"); throw new Error("cannot be added");
}, },
stroke: function (items) {
var o = this.options;
var right = BI.createWidget({
type: "bi.vertical_adapt",
items: items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
});
right.element.css("height", "100%");
BI.createWidget({
type: "bi.right",
element: this,
items: [right]
});
},
populate: function (items) { populate: function (items) {
BI.RightVerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout); BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout);

101
src/core/wrapper/layout/adapt/adapt.vertical.js

@ -7,7 +7,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
props: { props: {
baseCls: "bi-vertical-adapt-layout", baseCls: "bi-vertical-adapt-layout",
columnSize: [], columnSize: [],
horizontalAlign: BI.HorizontalAlign.Left, scrollx: false,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
lgap: 0, lgap: 0,
@ -15,85 +15,27 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
tgap: 0, tgap: 0,
bgap: 0 bgap: 0
}, },
render: function () { render: function () {
var self = this, o = this.options;
BI.VerticalAdaptLayout.superclass.render.apply(this, arguments); BI.VerticalAdaptLayout.superclass.render.apply(this, arguments);
var o = this.options; return {
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ type: "bi.horizontal",
position: "relative", verticalAlign: BI.VerticalAlign.Middle,
width: o.horizontalAlign === BI.HorizontalAlign.Stretch ? "100%" : "auto", horizontalAlign: BI.HorizontalAlign.Left,
height: "100%", columnSize: o.columnSize,
"white-space": "nowrap", items: o.items,
"border-spacing": "0px", scrollx: o.scrollx,
border: "none", ref: function (_ref) {
"border-collapse": "separate" self.layout = _ref;
}); },
this.$tr = BI.Widget._renderEngine.createElement("<tr>"); hgap: o.hgap,
this.$tr.appendTo(this.$table); vgap: o.vgap,
this.populate(this.options.items); lgap: o.lgap,
}, rgap: o.rgap,
tgap: o.tgap,
_addElement: function (i, item) { bgap: o.bgap
var o = this.options; };
var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
height: "100%",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
},
_getWrapper: function () {
return this.$tr;
}, },
resize: function () { resize: function () {
@ -101,8 +43,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
BI.VerticalAdaptLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout); BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);

6
src/core/wrapper/layout/layout.horizontal.js

@ -8,6 +8,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-layout", baseCls: "bi-horizontal-layout",
verticalAlign: BI.VerticalAlign.Top, verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: BI.HorizontalAlign.Left,
columnSize: [], columnSize: [],
scrollx: true, scrollx: true,
hgap: 0, hgap: 0,
@ -19,10 +20,13 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
}); });
}, },
render: function () { render: function () {
var o = this.options;
BI.HorizontalLayout.superclass.render.apply(this, arguments); BI.HorizontalLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({ this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative", position: "relative",
"white-space": "nowrap", "white-space": "nowrap",
height: o.verticalAlign === BI.VerticalAlign.Middle ? "100%" : "auto",
width: o.horizontalAlign === BI.HorizontalAlign.Center ? "100%" : "auto",
"border-spacing": "0px", "border-spacing": "0px",
border: "none", border: "none",
"border-collapse": "separate" "border-collapse": "separate"
@ -52,7 +56,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
td = this.getWidgetByName(this._getChildName(i)); td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width); td.element.attr("width", width);
} }
td.element.css({"max-width": o.columnSize[i] + "px"});
if (i === 0) { if (i === 0) {
td.element.addClass("first-element"); td.element.addClass("first-element");
} }

Loading…
Cancel
Save