mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 02:54:11 +08:00

Cleanup type symbol usage by consolidating to manage in one spot. This makes them easier to use as well by providing a single rollup of all the common type symbol's used throughout core.
23 lines
840 B
TypeScript
23 lines
840 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: global.isIOS,
|
|
valueConverter: converter,
|
|
});
|
|
orientationProperty.register(StackLayoutBase);
|