import { PatternPropertyBase } from './property-base' ; import * as Types from '@meetalva/types' ; export class PatternHrefProperty extends PatternPropertyBase < string | undefined > { public readonly type = Types . PatternPropertyType . Href ; public static from ( serialized ) { return new PatternHrefProperty ( { contextId : serialized . contextId , defaultValue : serialized . defaultValue , description : serialized . description , example : serialized . example , group : serialized . group , hidden : serialized . hidden , id : serialized . id , inputType : serialized . inputType , label : serialized . label , propertyName : serialized . propertyName , required : serialized . required } ) ; } public coerceValue ( value ) { if ( value === null || value === undefined || value === '' ) { return '' ; } else { return String ( value ) ; } } public toJSON ( ) { return { model : this . model , control : this . control , contextId : this . contextId , defaultValue : this . defaultValue , description : this . description , example : this . example || '' , group : this . group , hidden : this . hidden , id : this . id , inputType : this . inputType , label : this . label , propertyName : this . propertyName , required : this . required , type : this . type } ; } public update ( prop ) { this . contextId = prop . getContextId ( ) ; this . control = prop . getControl ( ) ; this . description = prop . getDescription ( ) ; this . defaultValue = prop . getDefaultValue ( ) ; this . example = prop . getExample ( ) ; this . group = prop . getGroup ( ) ; this . hidden = prop . getHidden ( ) ; this . label = prop . getLabel ( ) ; this . propertyName = prop . getPropertyName ( ) ; this . required = prop . getRequired ( ) ; } }