Browse Source

布局大一统

master
guy 4 years ago
parent
commit
dc9b683fea
  1. 4
      src/core/wrapper/layout/flex/flex.horizontal.js
  2. 4
      src/core/wrapper/layout/flex/flex.vertical.js
  3. 5
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js
  4. 5
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js
  5. 17
      src/less/core/wrapper/flex.wrapper.horizontal.less
  6. 17
      src/less/core/wrapper/flex.wrapper.vertical.less
  7. 4
      src/less/core/wrapper/inline.center.less
  8. 4
      src/less/core/wrapper/inline.horizontal.less
  9. 4
      src/less/core/wrapper/inline.vertical.less

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

@ -41,9 +41,7 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
position: "relative" position: "relative"
}); });
if (o.columnSize[i] !== "auto") { if (o.columnSize[i] !== "auto") {
if (o.horizontalAlign === BI.HorizontalAlign.Stretch && o.columnSize[i] === "fill") { if (!(o.horizontalAlign === BI.HorizontalAlign.Stretch && o.columnSize[i] === "fill")) {
w.element.addClass("f-f");
} else {
w.element.addClass("f-s-n"); w.element.addClass("f-s-n");
} }
} }

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

@ -40,9 +40,7 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, {
position: "relative" position: "relative"
}); });
if (o.rowSize[i] !== "auto") { if (o.rowSize[i] !== "auto") {
if (o.verticalAlign === BI.VerticalAlign.Stretch && o.rowSize[i] === "fill") { if (!(o.verticalAlign === BI.VerticalAlign.Stretch && o.rowSize[i] === "fill")) {
w.element.addClass("f-f");
} else {
w.element.addClass("f-s-n"); w.element.addClass("f-s-n");
} }
} }

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

@ -37,9 +37,7 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, {
position: "relative" position: "relative"
}); });
if (o.columnSize[i] !== "auto") { if (o.columnSize[i] !== "auto") {
if (o.horizontalAlign === BI.HorizontalAlign.Stretch && o.columnSize[i] !== "") { if (!(o.horizontalAlign === BI.HorizontalAlign.Stretch && o.columnSize[i] === "fill")) {
w.element.addClass("f-f");
} else {
w.element.addClass("f-s-n"); w.element.addClass("f-s-n");
} }
} }
@ -48,6 +46,7 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, {
} }
if (o.columnSize[i] === "fill") { if (o.columnSize[i] === "fill") {
w.element.addClass("f-f"); w.element.addClass("f-f");
this.element.addClass("f-f");
} }
w.element.addClass("c-e"); w.element.addClass("c-e");
if (i === 0) { if (i === 0) {

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

@ -37,9 +37,7 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, {
position: "relative" position: "relative"
}); });
if (o.rowSize[i] !== "auto") { if (o.rowSize[i] !== "auto") {
if (o.verticalAlign === BI.VerticalAlign.Stretch && o.rowSize[i] !== "") { if (!(o.verticalAlign === BI.VerticalAlign.Stretch && o.rowSize[i] === "fill")) {
w.element.addClass("f-f");
} else {
w.element.addClass("f-s-n"); w.element.addClass("f-s-n");
} }
} }
@ -48,6 +46,7 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, {
} }
if (o.rowSize[i] === "fill") { if (o.rowSize[i] === "fill") {
w.element.addClass("f-f"); w.element.addClass("f-f");
this.element.addClass("f-f");
} }
w.element.addClass("c-e"); w.element.addClass("c-e");
if (i === 0) { if (i === 0) {

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

@ -76,6 +76,19 @@
} }
} }
&.f-f {
> .f-s-h-w {
-webkit-flex-shrink: 0;
-moz-flex-shrink: 0;
-ms-flex-shrink: 0;
flex-shrink: 0;
-webkit-flex-grow: 1;
-moz-flex-grow: 1;
-ms-flex-grow: 1;
flex-grow: 1;
}
}
&.h-right { &.h-right {
/* 09版 */ /* 09版 */
-webkit-box-pack: flex-end; -webkit-box-pack: flex-end;
@ -181,10 +194,6 @@
align-items: stretch; align-items: stretch;
} }
&.h-stretch {
min-width: 100%;
}
&.h-center { &.h-center {
///* 09版 */ ///* 09版 */
//-webkit-box-pack: center; //-webkit-box-pack: center;

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

@ -75,6 +75,19 @@
} }
} }
&.f-f {
> .f-s-v-w {
-webkit-flex-shrink: 0;
-moz-flex-shrink: 0;
-ms-flex-shrink: 0;
flex-shrink: 0;
-webkit-flex-grow: 1;
-moz-flex-grow: 1;
-ms-flex-grow: 1;
flex-grow: 1;
}
}
&.h-right { &.h-right {
/* 09版 */ /* 09版 */
-webkit-box-align: flex-end; -webkit-box-align: flex-end;
@ -187,10 +200,6 @@
align-items: stretch; align-items: stretch;
} }
&.v-stretch {
min-height: 100%;
}
&.v-middle { &.v-middle {
///* 09版 */ ///* 09版 */
//-webkit-box-pack: center; //-webkit-box-pack: center;

4
src/less/core/wrapper/inline.center.less

@ -1,4 +1,4 @@
.bi-i-c-a, .bi-inline-center-adapt-layout { .bi-inline-center-adapt-layout {
&:after { &:after {
display: inline-block; display: inline-block;
width: 0; width: 0;
@ -7,7 +7,7 @@
content: ' '; content: ' ';
} }
& > .i-c-a-item, & > .inline-center-adapt-item { & > .inline-center-adapt-item {
display: inline-block; display: inline-block;
&.x-icon { &.x-icon {

4
src/less/core/wrapper/inline.horizontal.less

@ -1,4 +1,4 @@
.bi-i-h-a, .bi-inline-horizontal-adapt-layout { .bi-inline-horizontal-adapt-layout {
&:after { &:after {
display: inline-block; display: inline-block;
width: 0; width: 0;
@ -7,7 +7,7 @@
content: ' '; content: ' ';
} }
& > .i-h-a-item, & > .inline-horizontal-adapt-item { & > .inline-horizontal-adapt-item {
display: inline-block; display: inline-block;
&.x-icon { &.x-icon {

4
src/less/core/wrapper/inline.vertical.less

@ -1,4 +1,4 @@
.bi-i-v-a, .bi-inline-vertical-adapt-layout { .bi-inline-vertical-adapt-layout {
&:after { &:after {
display: inline-block; display: inline-block;
width: 0; width: 0;
@ -7,7 +7,7 @@
content: ' '; content: ' ';
} }
& > .i-v-a-item, & > .inline-vertical-adapt-item { & > .inline-vertical-adapt-item {
display: inline-block; display: inline-block;
&.x-icon { &.x-icon {

Loading…
Cancel
Save