Browse Source

feature: 布局优化

es6
guy 2 years ago
parent
commit
545ae9e8bd
  1. 3
      src/core/wrapper/layout/flex/flex.horizontal.js
  2. 3
      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");

3
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,
@ -25,6 +26,7 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
ref: function (_ref) {
self.layout = _ref;
},
columnSize: o.columnSize,
items: this._formatItems(o.items),
scrollx: o.scrollx,
scrolly: o.scrolly,
@ -70,6 +72,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