src/js/form-builder.js
function inputUserAttrs(name, inputAttrs) {
    const { class: classname, className, ...attrs } = inputAttrs
    let textAttrs = {
      id: name + '-' + data.lastID,
      title: attrs.description || attrs.label || name.toUpperCase(),
      name: name,
      type: attrs.type || 'text',
      className: [`fld-${name}`, (classname || className || '').trim()],
    }
    const label = `<label for="${textAttrs.id}">${i18n[name] || ''}</label>`

    const optionInputs = ['checkbox', 'checkbox-group', 'radio-group']
    if (!optionInputs.includes(textAttrs.type)) {
      textAttrs.className.push('form-control')
    }

    textAttrs = Object.assign({}, attrs, textAttrs)
    const textInput = `<input ${attrString(textAttrs)}>`
    const inputWrap = `<div class="input-wrap">${textInput}</div>`
    return `<div class="form-group ${name}-wrap">${label}${inputWrap}</div>`
  }
function inputUserAttrs(name, inputAttrs) {
    const { class: classname, className, ...attrs } = inputAttrs
    let textAttrs = {
      id: name + '-' + data.lastID,
      title: attrs.description || attrs.label || name.toUpperCase(),
      name: name,
      type: attrs.type || 'text',
      className: [`fld-${name}`, (classname || className || '').trim()],
    }
    const label = `<label for="${textAttrs.id}">${i18n[name] || ''}</label>`

    const optionInputs = ['checkbox', 'checkbox-group', 'radio-group']
    if (!optionInputs.includes(textAttrs.type)) {
      textAttrs.className.push('form-control')
    }

    textAttrs = Object.assign({}, attrs, textAttrs)
    const textInput = `<input ${attrString(textAttrs)}>`
    const inputWrap = `<div class="input-wrap">${textInput}</div>`
    return `<div class="form-group ${name}-wrap">${label}${inputWrap}</div>`
  }
function inputUserAttrs ( name , inputAttrs ) { const { class : classname , className , ... attrs } = inputAttrs let textAttrs = { id : name + '-' + data . lastID , title : attrs . description || attrs . label || name . toUpperCase ( ) , name : name , type : attrs . type || 'text' , className : [ ` ${ name } ` , ( classname || className || '' ) . trim ( ) ] , } const label = ` ${ textAttrs . id } ${ i18n [ name ] || '' } ` const optionInputs = [ 'checkbox' , 'checkbox-group' , 'radio-group' ] if ( ! optionInputs . includes ( textAttrs . type ) ) { textAttrs . className . push ( 'form-control' ) } textAttrs = Object . assign ( { } , attrs , textAttrs ) const textInput = ` ${ attrString ( textAttrs ) } ` const inputWrap = ` ${ textInput } ` return ` ${ name } ${ label } ${ inputWrap } ` }
Text input value for attribute
@param  {String} name
@param  {Object} inputAttrs also known as values
@return {String}       input markup
Text input value for attribute