// eslint-disable-next-line @typescript-eslint/no-unused-vars namespace OSFramework.OSUI.Patterns.BottomSheet { /** * Class that represents the custom configurations received by the BottomSheet. */ export class BottomSheetConfig extends AbstractConfiguration { /** Corner shape of the sheet: SoftRounded (default), Rounded or Sharp. */ public Shape: GlobalEnum.ShapeTypes; /** Shows the drag handler bar at the top of the sheet. */ public ShowHandler: boolean; constructor(config: JSON) { super(config); } /** * Override, Validate configs key values * * @param key Name of the configuration property being validated * @param value Value to validate */ public validateDefault(key: string, value: unknown): unknown { let validatedValue = undefined; switch (key) { case Enum.Properties.Shape: validatedValue = this.validateInRange( value, GlobalEnum.ShapeTypes.SoftRounded, GlobalEnum.ShapeTypes.Sharp, GlobalEnum.ShapeTypes.Rounded ); break; case Enum.Properties.ShowHandler: validatedValue = this.validateBoolean(value as boolean, false); break; default: validatedValue = super.validateDefault(key, value); break; } return validatedValue; } } }