{"version":3,"sources":["src\\FormControl.js"],"names":["propTypes","componentClass","oneOfType","element","string","type","PropTypes","id","defaultProps","className","contextTypes","$bs_formGroup","object","FormControl","render","formGroup","context","controlId","props","Component","others","classes","Static"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AAEA;;;;;;;;;;;;;;;;AACA;;AAEA,IAAMA,YAAY;AAChBC,kBAAgB,iBAAUC,SAAV,CAAoB,CACpC,iBAAUC,OAD0B,EAEpC,iBAAUC,MAF0B,CAApB,CADA;AAKhB;;;AAGAC,QAAM,mBAAMC,SAAN,CAAgBF,MARN;AAShB;;;AAGAG,MAAI,mBAAMD,SAAN,CAAgBF;AAZJ,CAAlB;;AAeA,IAAMI,eAAe;AACnBP,kBAAgB,OADG;AAEnBQ,aAAW,SAFQ;AAGnBJ,QAAM;AAHa,CAArB;;AAMA,IAAMK,eAAe;AACnBC,iBAAe,mBAAML,SAAN,CAAgBM;AADZ,CAArB;;IAIMC,W;;;;;;;;;wBACJC,M,qBAAS;AACP,QAAMC,YAAY,KAAKC,OAAL,CAAaL,aAA/B;AACA,QAAMM,YAAYF,aAAaA,UAAUE,SAAzC;;AAFO,iBAUH,KAAKC,KAVF;AAAA,QAKWC,SALX,UAKLlB,cALK;AAAA,QAMLI,IANK,UAMLA,IANK;AAAA,2BAOLE,EAPK;AAAA,QAOLA,EAPK,6BAOAU,SAPA;AAAA,QAQLR,SARK,UAQLA,SARK;;AAAA,QASFW,MATE;;AAYP;;AAEA,8BACEH,aAAa,IAAb,IAAqBV,OAAOU,SAD9B,EAEE,mEAFF;;AAKA;AACA,QAAII,UAAQ,EAAZ;AACA,QAAIhB,SAAS,MAAb,EAAqB;AACnBgB,gCAA0B,IAA1B;AACD;;AAED,WACE,iCAAC,SAAD,eACMD,MADN;AAEE,YAAMf,IAFR;AAGE,UAAIE,EAHN;AAIE,iBAAW,6BAAWE,SAAX,EAAsBY,OAAtB;AAJb,OADF;AAQD,G;;;EAlCuB,mBAAMF,S;;AAqChCN,YAAYb,SAAZ,GAAwBA,SAAxB;AACAa,YAAYL,YAAZ,GAA2BA,YAA3B;AACAK,YAAYH,YAAZ,GAA2BA,YAA3B;;AAEAG,YAAYS,MAAZ;;qBAEeT,W","file":"FormControl.js","sourceRoot":"E:/New/tinper/react-comp/form-control","sourcesContent":["import React, { Component,PropTypes } from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport classNames from 'classnames';\r\nimport warning from 'warning';\r\n\r\nimport FormControlStatic from './FormControlStatic';\r\n// import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';\r\n\r\nconst propTypes = {\r\n  componentClass: PropTypes.oneOfType([\r\n\t\tPropTypes.element,\r\n\t\tPropTypes.string\r\n\t]),\r\n  /**\r\n   * Only relevant if `componentClass` is `'input'`.\r\n   */\r\n  type: React.PropTypes.string,\r\n  /**\r\n   * Uses `controlId` from `<FormGroup>` if not explicitly specified.\r\n   */\r\n  id: React.PropTypes.string,\r\n};\r\n\r\nconst defaultProps = {\r\n  componentClass: 'input',\r\n  className: 'u-input',\r\n  type: 'text'\r\n};\r\n\r\nconst contextTypes = {\r\n  $bs_formGroup: React.PropTypes.object,\r\n};\r\n\r\nclass FormControl extends React.Component {\r\n  render() {\r\n    const formGroup = this.context.$bs_formGroup;\r\n    const controlId = formGroup && formGroup.controlId;\r\n\r\n    const {\r\n      componentClass: Component,\r\n      type,\r\n      id = controlId,\r\n      className,\r\n      ...others\r\n    } = this.props;\r\n\r\n    // const [bsProps, elementProps] = splitBsProps(props);\r\n\r\n    warning(\r\n      controlId == null || id === controlId,\r\n      '`controlId` is ignored on `<FormControl>` when `id` is specified.'\r\n    );\r\n\r\n    // input[type=\"file\"] should not have .form-control.\r\n    let classes={};\r\n    if (type !== 'file') {\r\n      classes[`form-control`] = true;\r\n    }\r\n\r\n    return (\r\n      <Component\r\n        {...others}\r\n        type={type}\r\n        id={id}\r\n        className={classNames(className, classes)}\r\n      />\r\n    );\r\n  }\r\n}\r\n\r\nFormControl.propTypes = propTypes;\r\nFormControl.defaultProps = defaultProps;\r\nFormControl.contextTypes = contextTypes;\r\n\r\nFormControl.Static = FormControlStatic;\r\n\r\nexport default FormControl;"]}