// eslint-disable-next-line @typescript-eslint/no-unused-vars namespace OSFramework.OSUI.Patterns.MonthPicker { /** * Class that represents the custom configurations received by the MonthPicker. */ export abstract class AbstractMonthPickerConfig extends Patterns.AbstractProviderConfiguration { /** Display format of the selected month (e.g. MM/YYYY). */ public DateFormat: string; /** Month selected when the picker is built ({ Month, Year }). */ public InitialMonth: MonthYear; /** Latest selectable month ({ Month, Year }). */ public MaxMonth: MonthYear; /** Earliest selectable month ({ Month, Year }). */ public MinMonth: MonthYear; constructor(config: JSON) { super(config); } /** * Method that will check if a given property (key) value is the type expected! * * @param key property name * @param value value to be check * @returns value */ public validateDefault(key: string, value: unknown): unknown { let validatedValue = undefined; switch (key) { case Enum.Properties.DateFormat: validatedValue = this.validateString(value as string, 'MM/YYYY'); break; case Enum.Properties.InitialMonth: case Enum.Properties.MinMonth: case Enum.Properties.MaxMonth: validatedValue = value as MonthYear; break; default: validatedValue = super.validateDefault(key, value); break; } return validatedValue; } } }