add support with amd, add onSelect, hideOnSelect options