Browse Source

Pull request #2818: 无JIRAR任务 feature: 布局优化

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

* commit '727383972b27689465c878126f53684cc663dfe8':
  feature: 布局优化
  feature: 布局优化
es6
guy 2 years ago
parent
commit
d44926f5cb
  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") { if (columnSize === "fill") {
w.element.addClass("f-f"); w.element.addClass("f-f");
} }
if (columnSize === "" || columnSize === "auto") {
w.element.addClass("f-auto");
}
w.element.addClass("c-e"); w.element.addClass("c-e");
if (i === 0) { if (i === 0) {
w.element.addClass("f-c"); 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 () { props: function () {
return BI.extend(BI.FlexLeftRightVerticalAdaptLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.FlexLeftRightVerticalAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-f-lr-v-c", baseCls: "bi-f-lr-v-c",
columnSize: [],
items: {}, items: {},
llgap: 0, llgap: 0,
lrgap: 0, lrgap: 0,
@ -20,17 +21,19 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
render: function () { render: function () {
var o = this.options, self = this; var o = this.options, self = this;
BI.FlexLeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments); BI.FlexLeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments);
var items = this._formatItems(o.items);
return { return {
type: "bi.flex_vertical_adapt", type: "bi.flex_vertical_adapt",
ref: function (_ref) { ref: function (_ref) {
self.layout = _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, scrollx: o.scrollx,
scrolly: o.scrolly, scrolly: o.scrolly,
scrollable: o.scrollable, scrollable: o.scrollable,
innerHgap: o.innerHgap, innerHgap: o.innerHgap,
innerVgap: o.innerVgap, innerVgap: o.innerVgap
}; };
}, },
@ -70,6 +73,7 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
return leftItems.concat({ return leftItems.concat({
el: { el: {
type: "bi.flex_vertical_adapt", type: "bi.flex_vertical_adapt",
columnSize: o.columnSize.slice(leftItems.length),
css: { css: {
"margin-left": "auto" "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") { if (rowSize === "fill") {
w.element.addClass("f-f"); w.element.addClass("f-f");
} }
if (rowSize === "" || rowSize === "auto") {
w.element.addClass("f-auto");
}
w.element.addClass("c-e"); w.element.addClass("c-e");
if (i === 0) { if (i === 0) {
w.element.addClass("f-c"); 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"); w.element.addClass("f-f");
this.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"); w.element.addClass("c-e");
if (i === 0) { if (i === 0) {
w.element.addClass("f-c"); 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"); w.element.addClass("f-f");
this.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"); w.element.addClass("c-e");
if (i === 0) { if (i === 0) {
w.element.addClass("f-c"); w.element.addClass("f-c");

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

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

Loading…
Cancel
Save