Browse Source

Pull request #1778: 无JIAR任务 update

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit '9b7224ca2e2184b08b726aa724e8bc79dfc34560':
  update
  update
  update
es6
guy 4 years ago
parent
commit
1f1504b461
  1. 22
      src/core/platform/web/config.js
  2. 87
      src/core/wrapper/layout/adapt/adapt.leftrightvertical.js
  3. 15
      src/less/core/wrapper/flex.horizontal.less
  4. 15
      src/less/core/wrapper/flex.vertical.less
  5. 13
      src/less/core/wrapper/flex.wrapper.horizontal.less
  6. 13
      src/less/core/wrapper/flex.wrapper.vertical.less

22
src/core/platform/web/config.js

@ -26,14 +26,14 @@ BI.prepares.push(function () {
if (!isIE && supportFlex) { if (!isIE && supportFlex) {
return BI.extend({}, ob, {type: "bi.flex_horizontal"}); return BI.extend({}, ob, {type: "bi.flex_horizontal"});
} }
// 解决使用inline_vertical_adapt的顺序问题 // // 解决使用inline_vertical_adapt的顺序问题
// 从右往左放置时,为了兼容,我们统一采用从右到左的放置方式 // // 从右往左放置时,为了兼容,我们统一采用从右到左的放置方式
if (ob.horizontalAlign === BI.HorizontalAlign.Right) { // if (ob.horizontalAlign === BI.HorizontalAlign.Right) {
return BI.extend({verticalAlign: BI.VerticalAlign.Top}, ob, { // return BI.extend({verticalAlign: BI.VerticalAlign.Top}, ob, {
type: "bi.inline_vertical_adapt", // type: "bi.inline_vertical_adapt",
items: ob.items && ob.items.reverse() // items: ob.items && ob.items.reverse()
}); // });
} // }
return BI.extend({}, ob, {type: "bi.table_adapt"}); return BI.extend({}, ob, {type: "bi.table_adapt"});
}); });
BI.Plugin.configWidget("bi.center_adapt", function (ob) { BI.Plugin.configWidget("bi.center_adapt", function (ob) {
@ -43,9 +43,6 @@ BI.prepares.push(function () {
if (!isIE && supportFlex) { if (!isIE && supportFlex) {
return BI.extend({}, ob, {type: "bi.flex_center_adapt"}); return BI.extend({}, ob, {type: "bi.flex_center_adapt"});
} }
if (ob.horizontalAlign === BI.HorizontalAlign.Right) {
return BI.extend({}, ob, {type: "bi.inline_center_adapt", items: ob.items && ob.items.reverse()});
}
return BI.extend({}, ob, {type: "bi.inline_center_adapt"}); return BI.extend({}, ob, {type: "bi.inline_center_adapt"});
} }
return ob; return ob;
@ -57,9 +54,6 @@ BI.prepares.push(function () {
if (!isIE && supportFlex) { if (!isIE && supportFlex) {
return BI.extend({}, ob, {type: "bi.flex_vertical_center_adapt"}); return BI.extend({}, ob, {type: "bi.flex_vertical_center_adapt"});
} }
if (ob.horizontalAlign === BI.HorizontalAlign.Right) {
return BI.extend({}, ob, {type: "bi.inline_vertical_adapt", items: ob.items && ob.items.reverse()});
}
return BI.extend({}, ob, {type: "bi.inline_vertical_adapt"}); return BI.extend({}, ob, {type: "bi.inline_vertical_adapt"});
} }
return ob; return ob;

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

@ -15,9 +15,15 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
llgap: 0, llgap: 0,
lrgap: 0, lrgap: 0,
lhgap: 0, lhgap: 0,
ltgap: 0,
lbgap: 0,
lvgap: 0,
rlgap: 0, rlgap: 0,
rrgap: 0, rrgap: 0,
rhgap: 0 rhgap: 0,
rtgap: 0,
rbgap: 0,
rvgap: 0
}); });
}, },
render: function () { render: function () {
@ -30,11 +36,17 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
items: [{ items: [{
el: { el: {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
ref: function (_ref) {
self.left = _ref;
},
height: "100%", height: "100%",
items: o.items.left, items: o.items.left,
hgap: o.lhgap, hgap: o.lhgap,
lgap: o.llgap, lgap: o.llgap,
rgap: o.lrgap rgap: o.lrgap,
tgap: o.ltgap,
bgap: o.lbgap,
vgap: o.lvgap
} }
}] }]
}); });
@ -45,12 +57,17 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
items: [{ items: [{
el: { el: {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
ref: function (_ref) {
self.right = _ref;
},
height: "100%", height: "100%",
items: o.items.right, items: o.items.right,
textAlign: "right",
hgap: o.rhgap, hgap: o.rhgap,
lgap: o.rlgap, lgap: o.rlgap,
rgap: o.rrgap rgap: o.rrgap,
tgap: o.rtgap,
bgap: o.rbgap,
vgap: o.rvgap
} }
}] }]
}); });
@ -68,8 +85,8 @@ BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this, arguments); this.left.populate(items.left);
this._mount(); this.right.populate(items.right);
} }
}); });
BI.shortcut("bi.left_right_vertical_adapt", BI.LeftRightVerticalAdaptLayout); BI.shortcut("bi.left_right_vertical_adapt", BI.LeftRightVerticalAdaptLayout);
@ -82,27 +99,30 @@ BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
items: [], items: [],
lgap: 0, lgap: 0,
rgap: 0, rgap: 0,
hgap: 0 hgap: 0,
tgap: 0,
bgap: 0,
vgap: 0
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this; var o = this.options, self = this;
BI.LeftVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.LeftVerticalAdaptLayout.superclass.render.apply(this, arguments);
return { return {
type: "bi.left", type: "bi.vertical_adapt",
ref: function (_ref) { ref: function (_ref) {
self.layout = _ref; self.layout = _ref;
}, },
items: [{ items: o.items,
el: { hgap: o.hgap,
type: "bi.vertical_adapt", lgap: o.lgap,
height: "100%", rgap: o.rgap,
items: o.items, tgap: o.tgap,
lgap: o.lgap, bgap: o.bgap,
hgap: o.hgap, vgap: o.vgap,
rgap: o.rgap scrollx: o.scrollx,
} scrolly: o.scrolly,
}] scrollable: o.scrollable
}; };
}, },
@ -128,28 +148,31 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
items: [], items: [],
lgap: 0, lgap: 0,
rgap: 0, rgap: 0,
hgap: 0 hgap: 0,
tgap: 0,
bgap: 0,
vgap: 0
}); });
}, },
render: function () { render: function () {
var o = this.options, self = this; var o = this.options, self = this;
BI.RightVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.RightVerticalAdaptLayout.superclass.render.apply(this, arguments);
return { return {
type: "bi.right", type: "bi.vertical_adapt",
ref: function (_ref) { ref: function (_ref) {
self.layout = _ref; self.layout = _ref;
}, },
items: [{ horizontalAlign: BI.HorizontalAlign.Right,
el: { items: o.items,
type: "bi.vertical_adapt", hgap: o.hgap,
height: "100%", lgap: o.lgap,
textAlign: "right", rgap: o.rgap,
items: o.items, tgap: o.tgap,
lgap: o.lgap, bgap: o.bgap,
hgap: o.hgap, vgap: o.vgap,
rgap: o.rgap scrollx: o.scrollx,
} scrolly: o.scrolly,
}] scrollable: o.scrollable
}; };
}, },
@ -163,7 +186,7 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
this.layout.populate.apply(this, arguments); this.layout.populate(items);
} }
}); });
BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout); BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout);

15
src/less/core/wrapper/flex.horizontal.less

@ -105,18 +105,21 @@
-webkit-justify-content: center; -webkit-justify-content: center;
-moz-justify-content: center; -moz-justify-content: center;
-ms-justify-content: center; -ms-justify-content: center;
-o-justify-content: center;
-ms-flex-pack: center; -ms-flex-pack: center;
-o-justify-content: center;
justify-content: center; justify-content: center;
} }
&.h-right { &.h-right {
/* 09版 */
-webkit-box-pack: flex-end;
/* 12版 */ /* 12版 */
-webkit-flex-direction: row-reverse; -webkit-justify-content: flex-end;
-moz-flex-direction: row-reverse; -moz-justify-content: flex-end;
-ms-flex-direction: row-reverse; -ms-justify-content: flex-end;
-o-flex-direction: row-reverse; -ms-flex-pack: end;
flex-direction: row-reverse; -o-justify-content: flex-end;
justify-content: flex-end;
} }
> .shrink-none { > .shrink-none {

15
src/less/core/wrapper/flex.vertical.less

@ -104,18 +104,21 @@
-webkit-justify-content: center; -webkit-justify-content: center;
-moz-justify-content: center; -moz-justify-content: center;
-ms-justify-content: center; -ms-justify-content: center;
-o-justify-content: center;
-ms-flex-pack: center; -ms-flex-pack: center;
-o-justify-content: center;
justify-content: center; justify-content: center;
} }
&.v-bottom { &.v-bottom {
/* 09版 */
-webkit-box-pack: flex-end;
/* 12版 */ /* 12版 */
-webkit-flex-direction: column-reverse; -webkit-justify-content: flex-end;
-moz-flex-direction: column-reverse; -moz-justify-content: flex-end;
-ms-flex-direction: column-reverse; -ms-justify-content: flex-end;
-o-flex-direction: column-reverse; -ms-flex-pack: end;
flex-direction: column-reverse; -o-justify-content: flex-end;
justify-content: flex-end;
} }
> .shrink-none { > .shrink-none {

13
src/less/core/wrapper/flex.wrapper.horizontal.less

@ -118,12 +118,15 @@
} }
&.h-right { &.h-right {
/* 09版 */
-webkit-box-pack: flex-end;
/* 12版 */ /* 12版 */
-webkit-flex-direction: row-reverse; -webkit-justify-content: flex-end;
-moz-flex-direction: row-reverse; -moz-justify-content: flex-end;
-ms-flex-direction: row-reverse; -ms-justify-content: flex-end;
-o-flex-direction: row-reverse; -ms-flex-pack: end;
flex-direction: row-reverse; -o-justify-content: flex-end;
justify-content: flex-end;
} }
> .shrink-none { > .shrink-none {

13
src/less/core/wrapper/flex.wrapper.vertical.less

@ -118,12 +118,15 @@
} }
&.v-bottom { &.v-bottom {
/* 09版 */
-webkit-box-pack: flex-end;
/* 12版 */ /* 12版 */
-webkit-flex-direction: column-reverse; -webkit-justify-content: flex-end;
-moz-flex-direction: column-reverse; -moz-justify-content: flex-end;
-ms-flex-direction: column-reverse; -ms-justify-content: flex-end;
-o-flex-direction: column-reverse; -ms-flex-pack: end;
flex-direction: column-reverse; -o-justify-content: flex-end;
justify-content: flex-end;
} }
> .shrink-none { > .shrink-none {

Loading…
Cancel
Save