Files
NativeScript/nativescript-core/ui/layouts/stack-layout/stack-layout-common.ts
Nathan Walker da3c0b973d chore: format
2020-07-11 11:01:40 -07:00

26 lines
802 B
TypeScript

import { StackLayout as StackLayoutDefinition, Orientation } from ".";
import { LayoutBase } from "../layout-base";
import { CSSType } from "../../core/view";
import { Property, makeParser, makeValidator } from "../../core/properties";
import { isIOS } from "../../../platform";
@CSSType("StackLayout")
export class StackLayoutBase extends LayoutBase
implements StackLayoutDefinition {
public orientation: Orientation;
}
StackLayoutBase.prototype.recycleNativeView = "auto";
const converter = makeParser<Orientation>(
makeValidator("horizontal", "vertical")
);
export const orientationProperty = new Property<StackLayoutBase, Orientation>({
name: "orientation",
defaultValue: "vertical",
affectsLayout: isIOS,
valueConverter: converter,
});
orientationProperty.register(StackLayoutBase);