createInputControl = (definition, prevValue) => {
  const controlList = [
    { type: 'text', control: 'text', required: ['type', 'name'], initial: '' },
    { type: 'int', control: 'number', required: ['type', 'name'], initial: 0 },
    { type: 'float', control: 'number', required: ['type', 'name'], initial: 0.0 },
    { type: 'number', control: 'number', required: ['type', 'name'], initial: 0.0 },
    { type: 'checkbox', control: 'checkbox', required: ['type', 'name', 'checked'], initial: '' },
    { type: 'radio', control: 'radio', required: ['type', 'name', 'checked'], initial: '' },
    { type: 'color', control: 'color', required: ['type', 'name'], initial: '#000000' },
    { type: 'date', control: 'date', required: ['type', 'name'], initial: '' },
    { type: 'email', control: 'email', required: ['type', 'name'], initial: '' },
    { type: 'password', control: 'password', required: ['type', 'name'], initial: '' },
    { type: 'url', control: 'url', required: ['type', 'name'], initial: '' },
    { type: 'slider', control: 'range', required: ['type', 'name', 'min', 'max'], initial: 0, label: true }
  ]
  const handledAttributes = ['type', 'name', 'checked', 'initial', 'default']

  // check for required parameters
  if (!('type' in definition)) {
    throw new Error(`Parameter definition (${definition.name}) must include a 'type' parameter`)
  }
  let typeData = controlList.filter((x) => definition.type === x.type)
  typeData = (typeData && typeData.length > 0) ? typeData[0] : undefined
  if (!typeData) {
    throw new Error(`Parameter definition (${definition.name}), invalid type "${definition.type}"`)
  }

  // validate fields
  const definitionFields = Object.keys(definition)
  typeData.required.forEach((requiredField) => {
    if (!definitionFields.includes(requiredField)) {
      throw new Error(`Parameter definition of type "${definition.type}" must include a "${requiredField}" parameter`)
    }
  })

  // determine initial value of control
  let controlValue
  if (prevValue !== undefined) {
    controlValue = prevValue
  } else if ('initial' in definition) {
    controlValue = definition.initial
  } else if ('default' in definition) {
    controlValue = definition.default
  } else {
    controlValue = typeData.initial
  }

  const control = html`<input
    type=${typeData.control} 
    value=${controlValue} 
    checked=${'checked' in definition ? controlValue : ''} 
  />`

  // set name and type (used later for obtaining values)
  control.paramName = definition.name
  control.paramType = definition.type
  // set generic HTML attributes
  for (const property in definition) {
    if (Object.prototype.hasOwnProperty.call(definition, property)) {
      if (handledAttributes.indexOf(property) < 0) {
        control.setAttribute(property, definition[property])
      }
    }
  }

  return [control]
}
Creates the DOM elements for general input types.
@param definition
@param prevValue
@returns {[*]}