Back to home page

EIC code displayed by LXR

 
 

    


Warning, /firebird/firebird-ng/src/app/services/decorators.ts is written in an unsupported language. File is not indexed.

0001 import 'reflect-metadata';
0002 import { PropertyOptions, SelectOptions, NumberOptions, ColorOptions, BooleanOptions } from './painter-config.interface';
0003 
0004 // Decorator factory functions
0005 export function ConfigProperty(options: PropertyOptions = {}): PropertyDecorator {
0006   return (target: Object, propertyKey: string | symbol) => {
0007     Reflect.defineMetadata('configProperty', options, target, propertyKey);
0008   };
0009 }
0010 
0011 export function SelectField(options: SelectOptions): PropertyDecorator {
0012   return ConfigProperty({ ...options, type: 'select' });
0013 }
0014 
0015 export function NumberField(options: NumberOptions): PropertyDecorator {
0016   return ConfigProperty({ ...options, type: 'number' });
0017 }
0018 
0019 export function ColorField(options: ColorOptions = {}): PropertyDecorator {
0020   return ConfigProperty({ ...options, type: 'color' });
0021 }
0022 
0023 export function BooleanField(options: BooleanOptions = {}): PropertyDecorator {
0024   return ConfigProperty({ ...options, type: 'boolean' });
0025 }