Files
NativeScript/tns-core-modules/ui/layouts/stack-layout/stack-layout-common.ts
Hristo Deshev 629eb6e683 Use relative imports in tns-core-modules.
Use tns-core-modules/* imports in outside code (apps, tests, etc)
2017-03-13 14:37:59 +02:00

21 lines
721 B
TypeScript

import { StackLayout as StackLayoutDefinition } from ".";
import { LayoutBase, Property, isIOS } from "../layout-base";
export * from "../layout-base";
export class StackLayoutBase extends LayoutBase implements StackLayoutDefinition {
public orientation: "horizontal" | "vertical";
}
export const orientationProperty = new Property<StackLayoutBase, "horizontal" | "vertical">({
name: "orientation", defaultValue: "vertical", affectsLayout: isIOS,
valueConverter: (v) => {
if (v === "horizontal" || v === "vertical") {
return <"horizontal" | "vertical">v;
}
throw new Error(`Invalid orientation value: ${v}`);
}
});
orientationProperty.register(StackLayoutBase);