{"version":3,"names":["DropdownErrors","DropdownItemTypes"],"sources":["src/components/ads-dropdown/ads-dropdown.types.ts"],"sourcesContent":["import { Hyperlink } from '../core/interfaces/Hyperlink';\nimport { Icon, SVGIcon } from '../core/interfaces/Icon';\nimport { PositionLeft, PositionRight } from '../core/types/globalTypes';\n\nexport enum DropdownErrors {\n INVALID_DATA = 'Data is unspecified, empty or invalid',\n}\n/**\n * A collection of dropdown item types\n */\nexport enum DropdownItemTypes {\n ACTION = 'action',\n ACTIONGROUP = 'actionGroup',\n DIVIDER = 'divider',\n}\n\nexport type DropdownItemTypeAction = 'action';\nexport type DropdownItemTypeActionGroup = 'actionGroup';\nexport type DropdownItemTypeDivider = 'divider';\n\n/**\n * The base interface for a dropdown item (group or option)\n */\nexport interface DropdownItemBase {\n text: string;\n disabled?: boolean;\n icon?: Icon | SVGIcon;\n}\n\n/**\n * Describes a dropdown divider object\n * @docs\n */\nexport type DropdownDivider = {\n type: DropdownItemTypeDivider;\n};\n\n/**\n * Describes a dropdown action object\n * @docs\n */\nexport type DropdownOption = {\n type: DropdownItemTypeAction;\n value: string | number;\n link?: Hyperlink;\n} & DropdownItemBase;\n\n/**\n * Describes a dropdown group object\n * @docs\n */\nexport type DropdownOptionGroup = {\n type: DropdownItemTypeActionGroup;\n items: (DropdownOption | DropdownDivider)[];\n} & DropdownItemBase;\n\n/**\n * General type for all dropdown cases\n * Type is hardcoded by design so it's impossible to mix a type with the wrong payload\n * @docs\n */\nexport type DropdownItem = DropdownDivider | DropdownOptionGroup | DropdownOption;\n\nexport type DropdownAlignment = PositionLeft | PositionRight;\n\n/**\n * An interface for the custom `dropdownBlur` event\n * @docs\n */\nexport interface DropdownBlurEvent {\n evt: FocusEvent;\n value: string | number;\n}\n\n/**\n * An interface for the custom `dropdownChange` event\n * @docs\n */\nexport interface DropdownChangeEvent {\n evt: Event;\n value: string | number;\n}\n\n/**\n * An interface for the custom `dropdownFocus` event\n * @docs\n */\nexport interface DropdownFocusEvent {\n evt: FocusEvent;\n value: string | number;\n}\n\n/**\n * An interface for the custom `openChange` event for the dropdown\n * @docs\n */\nexport interface OpenChangeEvent {\n isOpen: boolean;\n}\n\nexport type DropdownBlurHandler = (evt: DropdownBlurEvent) => void;\n\nexport type DropdownChangeHandler = (evt: DropdownChangeEvent) => void;\n\nexport type DropdownFocusHandler = (evt: DropdownFocusEvent) => void;\n\nexport type OpenChangeHandler = (evt: OpenChangeEvent) => void;\n"],"mappings":"IAIYA,GAAZ,SAAYA,GACVA,EAAA,uDACD,EAFD,CAAYA,MAAc,K,IAMdC,GAAZ,SAAYA,GACVA,EAAA,mBACAA,EAAA,6BACAA,EAAA,oBACD,EAJD,CAAYA,MAAiB,Y","ignoreList":[]}