<commit_before>class KDSelectBox extends KDInputView

  constructor:(options = {})->

    options.type = "select"

    super options

  setDomElement:(cssClass)->
    @inputName  = @getOption name
    name        = "name='#{@options.name}'"
    @domElement = $ """
        <div class='kdselectbox #{cssClass}'>
          <select #{name}></select>
          <span class='title'></span>
          <span class='arrows'></span>
        </div>"
      """
    @_$select = @$("select").eq(0)
    @_$title  = @$("span.title").eq(0)
    @domElement

  bindEvents:()->
    @_$select.bind "blur change focus",(event)=>
      # log "kdselectbox change" if event.type is "change"
      @getCallback()? @getValue() if event.type is "change"
      @emit event.type, event, @getValue()
      @handleEvent event
    super

  setDefaultValue:(value)->
    @getDomElement().val value if value isnt ""
    @_$select.val value
    @_$title.text @_$select.find("option[value=\"#{value}\"]").text()
    @inputDefaultValue = value
  getDefaultValue:()-> @inputDefaultValue

  getValue:()-> @_$select.val()
  setValue:(value)->
    @_$select.val value<commit_msg>fix a regression so KDSelectBox values end up in the aggregated form data<commit_after>class KDSelectBox extends KDInputView

  constructor:(options = {})->

    options.type = "select"

    super options

  setDomElement:(cssClass)->
    @inputName  = @getOption "name"
    name        = "name='#{@options.name}'"
    @domElement = $ """
        <div class='kdselectbox #{cssClass}'>
          <select #{name}></select>
          <span class='title'></span>
          <span class='arrows'></span>
        </div>"
      """
    @_$select = @$("select").eq(0)
    @_$title  = @$("span.title").eq(0)
    @domElement

  bindEvents:()->
    @_$select.bind "blur change focus",(event)=>
      # log "kdselectbox change" if event.type is "change"
      @getCallback()? @getValue() if event.type is "change"
      @emit event.type, event, @getValue()
      @handleEvent event
    super

  setDefaultValue:(value)->
    @getDomElement().val value if value isnt ""
    @_$select.val value
    @_$title.text @_$select.find("option[value=\"#{value}\"]").text()
    @inputDefaultValue = value
  getDefaultValue:()-> @inputDefaultValue

  getValue:()-> @_$select.val()
  setValue:(value)->
    @_$select.val value
{'fraction_non_alphanumeric': 0.17792985457656116, 'fraction_numerical': 0.001710863986313088, 'mean_word_length': 3.0397236614853194, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6870605', 'n_tokens_mistral': 774, 'n_tokens_neox': 744, 'n_words': 161}