You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.7 KiB
70 lines
1.7 KiB
import { shortcut } from "@/core/decorator"; |
|
import { extend } from "@/core/2.base"; |
|
import { HorizontalAlign, VerticalAlign } from "@/core/constant"; |
|
import { Layout } from "../../layout"; |
|
|
|
/** |
|
*自适应水平和垂直方向都居中容器 |
|
* Created by GUY on 2016/12/2. |
|
* |
|
* @class FlexVerticalCenter |
|
* @extends Layout |
|
*/ |
|
@shortcut() |
|
export class FlexVerticalCenter extends Layout { |
|
static xtype = "bi.flex_vertical_adapt"; |
|
|
|
props() { |
|
return extend(super.props(...arguments), { |
|
baseCls: "bi-f-v-c", |
|
horizontalAlign: HorizontalAlign.Left, |
|
verticalAlign: VerticalAlign.Middle, |
|
columnSize: [], |
|
scrollx: false, |
|
hgap: 0, |
|
vgap: 0, |
|
lgap: 0, |
|
rgap: 0, |
|
tgap: 0, |
|
bgap: 0, |
|
}); |
|
} |
|
|
|
render() { |
|
const o = this.options; |
|
|
|
return { |
|
type: "bi.flex_horizontal", |
|
ref: _ref => { |
|
this.layout = _ref; |
|
}, |
|
verticalAlign: o.verticalAlign, |
|
horizontalAlign: o.horizontalAlign, |
|
columnSize: o.columnSize, |
|
rowSize: o.rowSize, |
|
scrollx: o.scrollx, |
|
scrolly: o.scrolly, |
|
scrollable: o.scrollable, |
|
vgap: o.vgap, |
|
lgap: o.lgap, |
|
rgap: o.rgap, |
|
hgap: o.hgap, |
|
innerHgap: o.innerHgap, |
|
innerVgap: o.innerVgap, |
|
items: o.items, |
|
}; |
|
} |
|
|
|
resize() { |
|
this.layout.resize(); |
|
} |
|
|
|
populate(items) { |
|
this.layout.populate(items); |
|
} |
|
} |
|
|
|
@shortcut() |
|
export class FlexVerticalCenterAdapt extends FlexVerticalCenter { |
|
static xtype = "bi.flex_vertical_center_adapt" |
|
}
|
|
|