{"version":3,"file":"Radio-DGCLGsVj.js","sources":["../../Client/legacy/Components/FormGroups/Radio.tsx"],"sourcesContent":["import * as React from 'react';\r\n\r\nimport { InlineError } from '../../FormFields';\r\n\r\nimport { IFormGroupProps } from './Base';\r\n\r\nexport interface IRadioFormGroupProps extends IFormGroupProps {\r\n /** A flag indicating whether the radio control is selected. */\r\n selected: boolean;\r\n\r\n /** The change handler responsible for returning selected status to the caller. */\r\n onSelect: () => void;\r\n\r\n /** An optional prop to indicate readOnly state. */\r\n disabled?: boolean;\r\n\r\n /** Optional, pass in a a Value class error to indicate error state. */\r\n error?: string | null;\r\n\r\n /** Optional, pass in a boolean value to hide the tooltip on error state. */\r\n hideErrorTooltip?: boolean;\r\n\r\n /** Optional, add text to display in the error highlight box for Inline Errors. */\r\n errorHighlightBox?: string;\r\n\r\n /** Optional. A smaller label located underneath the primary label. */\r\n sublabel?: string;\r\n\r\n /** Optional. The CSS class name for the sublabel component. */\r\n sublabelClassName?: string;\r\n}\r\n\r\nexport class RadioFormGroup extends React.Component<IRadioFormGroupProps, {}> {\r\n render() {\r\n const {\r\n id,\r\n label,\r\n sublabel,\r\n selected,\r\n labelClassName,\r\n sublabelClassName,\r\n className,\r\n error,\r\n hideErrorTooltip = false,\r\n errorHighlightBox,\r\n onSelect,\r\n disabled,\r\n homeownersStyle,\r\n } = this.props;\r\n\r\n const disabledClass = disabled ? ' disabled' : '';\r\n\r\n const onClick = () => {\r\n if (this.props.disabled) return;\r\n onSelect();\r\n };\r\n\r\n return (\r\n <div\r\n className={\r\n `form-group-cp${homeownersStyle ? ' ho-radio-wrapper-cp' : ' form-group-radio-wrapper-cp'}${className ? ` ${className}` : ''}` +\r\n disabledClass\r\n }\r\n onClick={onClick}\r\n >\r\n <div\r\n id={id}\r\n className={`${homeownersStyle ? 'ho-radio-cp' : 'form-group-radio-cp'}${selected ? ' form-group-radio-selected-cp ' : ''}${error ? ' form-group-radio-error-cp' : ''}`}\r\n >\r\n <div />\r\n </div>\r\n <label\r\n className={`${homeownersStyle ? 'ho-radio-label-cp' : ' form-group-label-cp'}${selected ? ' form-group-label-selected-cp' : ''}${error ? ' form-group-label-error-cp' : ''}${labelClassName ? ` ${labelClassName}` : ''}`}\r\n >\r\n {label}\r\n {error && <InlineError {...{ error, errorHighlightBox }} noToolTip={hideErrorTooltip} />}\r\n </label>\r\n <label className={`${sublabelClassName || ''} sublabel`}>{sublabel}</label>\r\n <div className='clearfix'></div>\r\n </div>\r\n );\r\n }\r\n}\r\n"],"names":["RadioFormGroup","React.Component","id","label","sublabel","selected","labelClassName","sublabelClassName","className","error","hideErrorTooltip","errorHighlightBox","onSelect","disabled","homeownersStyle","disabledClass","onClick","jsxs","jsx","InlineError"],"mappings":"4FAgCa,MAAAA,UAAuBC,EAAAA,SAA0C,CAC1E,QAAS,CACC,KAAA,CACF,GAAAC,EACA,MAAAC,EACA,SAAAC,EACA,SAAAC,EACA,eAAAC,EACA,kBAAAC,EACA,UAAAC,EACA,MAAAC,EACA,iBAAAC,EAAmB,GACnB,kBAAAC,EACA,SAAAC,EACA,SAAAC,EACA,gBAAAC,GACA,KAAK,MAEHC,EAAgBF,EAAW,YAAc,GAEzCG,EAAU,IAAM,CACd,KAAK,MAAM,UACNJ,EAAA,CACb,EAGI,OAAAK,EAAA,KAAC,MAAA,CACG,UACI,gBAAgBH,EAAkB,uBAAyB,8BAA8B,GAAGN,EAAY,IAAIA,CAAS,GAAK,EAAE,GAC5HO,EAEJ,QAAAC,EAEA,SAAA,CAAAE,EAAA,IAAC,MAAA,CACG,GAAAhB,EACA,UAAW,GAAGY,EAAkB,cAAgB,qBAAqB,GAAGT,EAAW,iCAAmC,EAAE,GAAGI,EAAQ,6BAA+B,EAAE,GAEpK,eAAC,MAAI,CAAA,CAAA,CAAA,CACT,EACAQ,EAAA,KAAC,QAAA,CACG,UAAW,GAAGH,EAAkB,oBAAsB,sBAAsB,GAAGT,EAAW,gCAAkC,EAAE,GAAGI,EAAQ,6BAA+B,EAAE,GAAGH,EAAiB,IAAIA,CAAc,GAAK,EAAE,GAEtN,SAAA,CAAAH,EACAM,SAAUU,EAAa,CAAK,MAAAV,EAAO,kBAAAE,EAAqB,UAAWD,CAAkB,CAAA,CAAA,CAAA,CAC1F,QACC,QAAM,CAAA,UAAW,GAAGH,GAAqB,EAAE,YAAc,SAASH,EAAA,EACnEc,EAAAA,IAAC,MAAI,CAAA,UAAU,UAAW,CAAA,CAAA,CAAA,CAC9B,CAAA,CAGZ"}