createChoiceControl = (definition, prevValue) => {
  if (!('values' in definition)) {
    throw new Error('Definition of choice parameter (' + definition.name + ") should include a 'values' parameter")
  }
  const values = definition.values
  const captions = 'captions' in definition ? definition.captions : definition.values

  if (captions.length !== values.length) {
    throw new Error('Definition of choice parameter (' + definition.name + ") should have the same number of items for 'captions' and 'values'")
  }

  const options = captions.map((caption, index) => {
    const value = values[index]
    let selected = false
    if (prevValue !== undefined) {
      selected = (prevValue === value)
    } else if ('default' in definition) {
      selected = (definition.default === value)
    } else if ('initial' in definition) {
      selected = (definition.initial === value)
    }
    return html`<option value=${value} selected=${selected}>
      ${caption}
    </option>`
  })

  const control = html`<select>
    ${options}
  </select`
  control.paramName = definition.name
  control.paramType = definition.type

  return [control]
}
Create the input elements for a Choice (select) parameter
@param definition
@param prevValue
@returns {[*]}