Browse Source

Merge pull request #72647 in DEC/fineui from master to feature/x

* commit 'd44926f5cbcb2a48f12fdf8162bf416596fe6afc':
  feature: 布局优化
  feature: 布局优化
es6
superman 2 years ago
parent
commit
fdbd68028b
  1. 3
      src/core/wrapper/layout/flex/flex.horizontal.js
  2. 8
      src/core/wrapper/layout/flex/flex.leftrightvertical.center.js
  3. 3
      src/core/wrapper/layout/flex/flex.vertical.js
  4. 4
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js
  5. 4
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js
  6. 6
      src/less/core/wrapper/flex.horizontal.less
  7. 6
      src/less/core/wrapper/flex.vertical.less
  8. 6
      src/less/core/wrapper/flex.wrapper.horizontal.less
  9. 6
      src/less/core/wrapper/flex.wrapper.vertical.less

3
src/core/wrapper/layout/flex/flex.horizontal.js

@ -82,6 +82,9 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
if (columnSize === "fill") {
w.element.addClass("f-f");
}
if (columnSize === "" || columnSize === "auto") {
w.element.addClass("f-auto");
}
w.element.addClass("c-e");
if (i === 0) {
w.element.addClass("f-c");

8
src/core/wrapper/layout/flex/flex.leftrightvertical.center.js

@ -2,6 +2,7 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FlexLeftRightVerticalAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-f-lr-v-c",
columnSize: [],
items: {},
llgap: 0,
lrgap: 0,
@ -20,17 +21,19 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
render: function () {
var o = this.options, self = this;
BI.FlexLeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments);
var items = this._formatItems(o.items);
return {
type: "bi.flex_vertical_adapt",
ref: function (_ref) {
self.layout = _ref;
},
items: this._formatItems(o.items),
columnSize: o.columnSize.slice(0, (o.items.left || []).length).concat((o.items.right || []).length > 0 ? [""] : []),
items: items,
scrollx: o.scrollx,
scrolly: o.scrolly,
scrollable: o.scrollable,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
innerVgap: o.innerVgap
};
},
@ -70,6 +73,7 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
return leftItems.concat({
el: {
type: "bi.flex_vertical_adapt",
columnSize: o.columnSize.slice(leftItems.length),
css: {
"margin-left": "auto"
},

3
src/core/wrapper/layout/flex/flex.vertical.js

@ -81,6 +81,9 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, {
if (rowSize === "fill") {
w.element.addClass("f-f");
}
if (rowSize === "" || rowSize === "auto") {
w.element.addClass("f-auto");
}
w.element.addClass("c-e");
if (i === 0) {
w.element.addClass("f-c");

4
src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js

@ -79,6 +79,10 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, {
w.element.addClass("f-f");
this.element.addClass("f-f");
}
if (columnSize === "" || columnSize === "auto") {
w.element.addClass("f-auto");
this.element.addClass("f-auto");
}
w.element.addClass("c-e");
if (i === 0) {
w.element.addClass("f-c");

4
src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js

@ -79,6 +79,10 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, {
w.element.addClass("f-f");
this.element.addClass("f-f");
}
if (rowSize === "" || rowSize === "auto") {
w.element.addClass("f-auto");
this.element.addClass("f-auto");
}
w.element.addClass("c-e");
if (i === 0) {
w.element.addClass("f-c");

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

@ -183,4 +183,10 @@
-ms-flex-shrink: 1;
flex-shrink: 1;
}
> .f-auto {
&:not(.f-s-n) {
min-width: 1px;
}
}
}

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

@ -182,4 +182,10 @@
-ms-flex-shrink: 1;
flex-shrink: 1;
}
> .f-auto {
&:not(.f-s-n) {
min-width: 1px;
}
}
}

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

@ -279,5 +279,11 @@
-ms-flex-shrink: 1;
flex-shrink: 1;
}
> .f-auto {
&:not(.f-s-n) {
min-width: 1px;
}
}
}
}

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

@ -273,5 +273,11 @@
-ms-flex-shrink: 1;
flex-shrink: 1;
}
> .f-auto {
&:not(.f-s-n) {
min-width: 1px;
}
}
}
}

Loading…
Cancel
Save