Files
NativeScript/packages/core/ui/layouts/stack-layout/stack-layout-common.ts
farfromrefuge 40b2a6a6db chore: use __ANDROID__ and __IOS__ throughout (#10446)
Standardizes usage for more macro style removal during bundling for target platforms.
[skip ci]
2023-11-25 08:34:25 -08:00

23 lines
835 B
TypeScript

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