class Playbook::PbDropdown::Dropdown

def classname

def classname
  generate_classname("pb_dropdown")
end

def data

def data
  Hash(prop(:data)).merge(pb_dropdown: true)
end

def error_class

def error_class
  error.present? ? " error" : ""
end

def input_default_value

def input_default_value
  default_value.present? ? default_value.transform_keys(&:to_s)["id"] : ""
end

def options_with_blank

def options_with_blank
  blank_selection.present? ? [{ id: "", value: "", label: blank_selection }] + options : options
end