export var LayoutSpec;
(function (LayoutSpec) {
/**
* Depends on what's been set on width or height.
*/
LayoutSpec[LayoutSpec["JUST"] = 0] = "JUST";
* Depends on it's content.
LayoutSpec[LayoutSpec["FIT"] = 1] = "FIT";
* Extend as much as parent let it take.
LayoutSpec[LayoutSpec["MOST"] = 2] = "MOST";
})(LayoutSpec || (LayoutSpec = {}));
export class LayoutConfigImpl {
fit() {
this.widthSpec = LayoutSpec.FIT;
this.heightSpec = LayoutSpec.FIT;
return this;
}
most() {
this.widthSpec = LayoutSpec.MOST;
this.heightSpec = LayoutSpec.MOST;
just() {
this.widthSpec = LayoutSpec.JUST;
this.heightSpec = LayoutSpec.JUST;
configWidth(w) {
this.widthSpec = w;
configHeight(h) {
this.heightSpec = h;
configMargin(m) {
this.margin = m;
configAlignment(a) {
this.alignment = a;
configWeight(w) {
this.weight = w;
configMaxWidth(v) {
this.maxWidth = v;
configMaxHeight(v) {
this.maxHeight = v;
configMinWidth(v) {
this.minWidth = v;
configMinHeight(v) {
this.minHeight = v;
toModel() {
return {
widthSpec: this.widthSpec,
heightSpec: this.heightSpec,
margin: this.margin,
alignment: this.alignment ? this.alignment.toModel() : undefined,
weight: this.weight,
};
export function layoutConfig() {
return new LayoutConfigImpl;