openstack-uicore-foundation 5.0.3 → 5.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/lib/components/attendance-tracker.js.map +1 -1
  2. package/lib/components/clock.js.map +1 -1
  3. package/lib/components/extra-questions.js.map +1 -1
  4. package/lib/components/forms/simple-form.js.map +1 -1
  5. package/lib/components/free-text-search.js.map +1 -1
  6. package/lib/components/google-map.js.map +1 -1
  7. package/lib/components/index.js +1 -1
  8. package/lib/components/index.js.map +1 -1
  9. package/lib/components/inputs/access-levels-input.js.map +1 -1
  10. package/lib/components/inputs/attendee-input.js.map +1 -1
  11. package/lib/components/inputs/company-input-v2.js.map +1 -1
  12. package/lib/components/inputs/company-input.js.map +1 -1
  13. package/lib/components/inputs/country-dropdown.js.map +1 -1
  14. package/lib/components/inputs/country-input.js.map +1 -1
  15. package/lib/components/inputs/event-input.js.map +1 -1
  16. package/lib/components/inputs/group-input.js.map +1 -1
  17. package/lib/components/inputs/language-input.js.map +1 -1
  18. package/lib/components/inputs/member-input.js.map +1 -1
  19. package/lib/components/inputs/organization-input.js.map +1 -1
  20. package/lib/components/inputs/promocode-input.js.map +1 -1
  21. package/lib/components/inputs/registration-company-input.js.map +1 -1
  22. package/lib/components/inputs/speaker-input.js.map +1 -1
  23. package/lib/components/inputs/sponsor-input.js.map +1 -1
  24. package/lib/components/inputs/summit-input.js.map +1 -1
  25. package/lib/components/inputs/tag-input.js.map +1 -1
  26. package/lib/components/inputs/ticket-types-input.js.map +1 -1
  27. package/lib/components/inputs/upload-input-v2.js.map +1 -1
  28. package/lib/components/inputs/upload-input-v3.js.map +1 -1
  29. package/lib/components/mui/dropdown-checkbox.js +1 -1
  30. package/lib/components/mui/dropdown-checkbox.js.map +1 -1
  31. package/lib/components/mui/editable-table.js +1 -1
  32. package/lib/components/mui/editable-table.js.map +1 -1
  33. package/lib/components/mui/formik-inputs/additional-input-list.js +1 -1
  34. package/lib/components/mui/formik-inputs/additional-input-list.js.map +1 -1
  35. package/lib/components/mui/formik-inputs/additional-input.js +1 -1
  36. package/lib/components/mui/formik-inputs/additional-input.js.map +1 -1
  37. package/lib/components/mui/formik-inputs/company-input.js.map +1 -1
  38. package/lib/components/mui/formik-inputs/item-price-tiers.js.map +1 -1
  39. package/lib/components/mui/formik-inputs/sponsor-input.js.map +1 -1
  40. package/lib/components/mui/formik-inputs/sponsorship-input.js.map +1 -1
  41. package/lib/components/mui/formik-inputs/sponsorship-summit-select.js.map +1 -1
  42. package/lib/components/mui/formik-inputs/summit-addon-select.js.map +1 -1
  43. package/lib/components/mui/formik-inputs/upload.js.map +1 -1
  44. package/lib/components/mui/show-confirm-dialog.js +1 -1
  45. package/lib/components/mui/show-confirm-dialog.js.map +1 -1
  46. package/lib/components/mui/snackbar-notification.js +1 -1
  47. package/lib/components/mui/snackbar-notification.js.map +1 -1
  48. package/lib/components/mui/sortable-table.js +1 -1
  49. package/lib/components/mui/sortable-table.js.map +1 -1
  50. package/lib/components/mui/sponsor-addon-select.js.map +1 -1
  51. package/lib/components/mui/summit-addon-select.js.map +1 -1
  52. package/lib/components/mui/summits-dropdown.js.map +1 -1
  53. package/lib/components/mui/table.js +1 -1
  54. package/lib/components/mui/table.js.map +1 -1
  55. package/lib/components/schedule-builder-view.js.map +1 -1
  56. package/lib/components/sponsored-project-input.js.map +1 -1
  57. package/lib/components/summit-dropdown.js +1 -1
  58. package/lib/components/summit-dropdown.js.map +1 -1
  59. package/lib/components/table-editable.js.map +1 -1
  60. package/lib/i18n.js.map +1 -1
  61. package/lib/security/abstract-auth-callback-route-v2.js.map +1 -1
  62. package/lib/security/abstract-auth-callback-route.js.map +1 -1
  63. package/lib/security/actions.js.map +1 -1
  64. package/lib/security/methods.js.map +1 -1
  65. package/lib/security/reducers.js.map +1 -1
  66. package/lib/security/session-checker.js.map +1 -1
  67. package/lib/utils/actions.js.map +1 -1
  68. package/lib/utils/methods.js +1 -1
  69. package/lib/utils/methods.js.map +1 -1
  70. package/lib/utils/query-actions.js.map +1 -1
  71. package/lib/utils/questions-set.js.map +1 -1
  72. package/package.json +2 -3
@@ -1 +1 @@
1
- {"version":3,"file":"components/forms/simple-form.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,oNCMM,MAAMC,UAAcC,IAAAA,UAE/BC,WAAAA,CAAYC,GACRC,MAAMD,GAENJ,KAAKM,aAAeN,KAAKM,aAAaC,KAAKP,KAC9C,CAEDQ,kBAAAA,CAAmBC,EAAWC,EAAWC,GACjCX,KAAKI,MAAMQ,QAAUH,EAAUG,QAC/BZ,KAAKa,MAAMD,MAAQZ,KAAKI,MAAMQ,MAErC,CAEDN,YAAAA,CAAaQ,GACTd,KAAKI,MAAMW,SAASD,EACvB,CAEDE,MAAAA,GAEI,IAAI,EAAkFhB,KAAKI,OAAvF,SAACW,EAAD,MAAWH,EAAX,UAAkBK,EAAlB,MAA6BC,EAA7B,eAAoCC,EAApC,mBAAoDC,GAAxD,EAA8EC,EAA9E,SACIC,EAActB,KAAKI,MAAMmB,eAAe,UAAsB,KAAVL,EACpDM,EAAaxB,KAAKI,MAAMmB,eAAe,aAAeN,EAAY,eAClEQ,EAAuBzB,KAAKI,MAAMmB,eAAe,sBAAwBH,EAAqB,yBAClG,OACI,yBAAKH,UAAWQ,GACZ,+BACIR,UAAY,GAAEO,KAAcF,EAAY,QAAU,KAClDI,IAAKC,IAAS3B,KAAKa,MAAQc,CAAb,EACdC,aAAchB,EACd,kBAAiBO,EACjBJ,SAAUf,KAAKM,cACXe,IAEPC,GACD,uBAAGL,UAAU,eAAeC,GAKvC,EAGLjB,EAAM4B,aAAe,CACjBV,eAAiB,K,+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UAAU,2BACX,2BAAOoE,KAAK,WAAWH,GAAInC,EAAM2C,KAAMJ,QAASN,EAAOjC,EAAM2C,MACtD3E,SAAUf,KAAKM,aAAcW,UAAU,qBAC9C,2BAAOA,UAAU,mBAAmB2E,QAAS7C,EAAM2C,MAC9C3C,EAAM4C,UAStC,CAED3E,MAAAA,GACI,IAAI,OAACgE,GAAUhF,KAAK+E,OAChB,OAACc,GAAU7F,KAAKI,MAEpB,OACI,0BAAMa,UAAU,eACZ,2BAAOoE,KAAK,SAASH,GAAG,KAAKtE,MAAOoE,EAAOE,KAE1CW,EAAOC,KAAIC,GACD/F,KAAKyF,YAAYM,KAG5B,yBAAK9E,UAAU,OACX,yBAAKA,UAAU,4BACX,2BAAOoE,KAAK,SAASW,QAAShG,KAAKiF,aAC5BhE,UAAU,6BAA6BL,MAAOqF,IAAAA,UAAY,oBAKpF,EAGL,U","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/inputs/text-input.js","webpack://openstack-uicore-foundation/./src/utils/methods.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://openstack-uicore-foundation/external commonjs \"awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react/dist/i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"moment-timezone\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"urijs\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/forms/simple-form.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\n\nexport default class Input extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleChange = this.handleChange.bind(this);\n }\n\n componentDidUpdate(prevProps, prevState, snapshot) {\n if (this.props.value !== prevProps.value) {\n this.input.value = this.props.value;\n }\n }\n\n handleChange(ev) {\n this.props.onChange(ev);\n }\n\n render() {\n\n let {onChange, value, className, error, ariaLabelledBy, containerClassName,...rest} = this.props;\n let has_error = ( this.props.hasOwnProperty('error') && error !== '' );\n let class_name = this.props.hasOwnProperty('className') ? className : 'form-control';\n let container_class_name = this.props.hasOwnProperty('containerClassName') ? containerClassName : 'container-form-control';\n return (\n <div className={container_class_name}>\n <input\n className={`${class_name} ${has_error ? 'error' : ''}`}\n ref={node => {this.input = node}}\n defaultValue={value}\n aria-labelledby={ariaLabelledBy}\n onChange={this.handleChange}\n {...rest}\n />\n {has_error &&\n <p className=\"error-label\">{error}</p>\n }\n </div>\n );\n\n }\n}\n\nInput.defaultProps = {\n ariaLabelledBy : null,\n}","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport moment from 'moment-timezone';\nimport URI from \"urijs\";\n\nexport const findElementPos = (obj) => {\n var curtop = -70;\n if (obj.offsetParent) {\n do {\n curtop += obj.offsetTop;\n } while (obj = obj.offsetParent);\n return [curtop];\n }\n};\n\nexport const epochToMoment = (atime) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime);\n};\n\nexport const epochToMomentTimeZone = (atime, time_zone) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime).tz(time_zone);\n};\n\nexport const formatEpoch = (atime, format = 'M/D/YYYY h:mm a') => {\n if(!atime) return atime;\n return epochToMoment(atime).format(format);\n};\n\nexport const parseLocationHour = (hour) => {\n let parsedHour = hour.toString();\n if(parsedHour.length < 4) parsedHour = `0${parsedHour}`;\n parsedHour = parsedHour.match(/.{2}/g);\n parsedHour = parsedHour.join(':');\n return parsedHour;\n}\n\nexport const objectToQueryString = (obj) => {\n var str = \"\";\n for (var key in obj) {\n if (str != \"\") {\n str += \"&\";\n }\n str += key + \"=\" + encodeURIComponent(obj[key]);\n }\n\n return str;\n};\n\nexport const getBackURL = () => {\n let url = URI(window.location.href);\n let query = url.search(true);\n let fragment = url.fragment();\n let backUrl = query.hasOwnProperty('BackUrl') ? query['BackUrl'] : null;\n if(backUrl != null && fragment != null && fragment != ''){\n backUrl += `#${fragment}`;\n }\n return backUrl;\n};\n\nexport const toSlug = (text) =>{\n text = text.toLowerCase();\n return text.replace(/[^a-zA-Z0-9]+/g,'_');\n}\n\nexport const getAuthCallback = () => {\n if(typeof window !== 'undefined') {\n return `${window.location.origin}/auth/callback`;\n }\n return null;\n};\n\nexport const getCurrentLocation = () => {\n let location = '';\n if(typeof window !== 'undefined') {\n location = window.location;\n // check if we are on iframe\n if (window.top)\n location = window.top.location;\n }\n return location;\n};\n\nexport const getOrigin = () => {\n if(typeof window !== 'undefined') {\n return window.location.origin;\n }\n return null;\n};\n\nexport const getCurrentPathName = () => {\n if(typeof window !== 'undefined') {\n return window.location.pathname;\n }\n return null;\n};\n\nexport const getCurrentHref = () => {\n if(typeof window !== 'undefined') {\n return window.location.href;\n }\n return null;\n};\n\nexport const getAllowedUserGroups = () => {\n if(typeof window !== 'undefined') {\n return window.ALLOWED_USER_GROUPS || '';\n }\n return null;\n};\n\nexport const buildAPIBaseUrl = (relativeUrl) => {\n if(typeof window !== 'undefined'){\n return `${window.API_BASE_URL}${relativeUrl}`;\n }\n return null``;\n};\n\nexport const putOnLocalStorage = (key, value) => {\n if(typeof window !== 'undefined') {\n window.localStorage.setItem(key, value);\n }\n};\n\nexport const getFromLocalStorage = (key, removeIt) => {\n if(typeof window !== 'undefined') {\n let val = window.localStorage.getItem(key);\n if(removeIt){\n console.log(`getFromLocalStorage removing key ${key}`);\n removeFromLocalStorage(key);\n }\n return val;\n }\n return null;\n};\n\nexport const removeFromLocalStorage = (key) => {\n if(typeof window !== 'undefined') {\n window.localStorage.removeItem(key);\n }\n}\n\nexport const isClearingSessionState = () => {\n if(typeof window !== 'undefined') {\n return window.clearing_session_state;\n }\n return false;\n};\n\nexport const setSessionClearingState = (val) => {\n if(typeof window !== 'undefined') {\n window.clearing_session_state = val;\n }\n};\n\nexport const getCurrentUserLanguage = () => {\n let language = 'en';\n if(typeof navigator !== 'undefined') {\n language = (navigator.languages && navigator.languages[0]) || navigator.language || navigator.userLanguage;\n }\n return language;\n};\n\nexport const scrollToError = (errors) => {\n if(Object.keys(errors).length > 0) {\n const firstError = Object.keys(errors)[0];\n const firstNode = document.getElementById(firstError);\n if (firstNode) window.scrollTo(0, findElementPos(firstNode));\n }\n};\n\nexport const hasErrors = (field, errors) => {\n if(field in errors) {\n return errors[field];\n }\n return '';\n};\n\nexport const shallowEqual = (object1, object2) => {\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (let key of keys1) {\n if (object1[key] !== object2[key]) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const arraysEqual = (a1, a2) =>\n a1.length === a2.length && a1.every((o, idx) => shallowEqual(o, a2[idx]));\n\nexport const isEmpty = (obj) => {\n return Object.keys(obj).length === 0;\n};\n\n\nexport const base64URLEncode = (str) => {\n return str\n .toString('base64')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '')\n}\n\nexport const retryPromise = async (\n cb,\n maxNumberOfRetries = 3\n) => {\n for (let i = 0; i < maxNumberOfRetries; i++) {\n if (await cb()) {\n return true;\n }\n }\n\n return false;\n}\n\nexport const getTimeServiceUrl = () => {\n if(typeof window !== 'undefined') {\n return window.TIMEINTERVALSINCE1970_API_URL || process.env.TIMEINTERVALSINCE1970_API_URL;\n }\n return null;\n};\n\nexport const getEventLocation = (event, summitVenueCount, summitShowLocDate = null, nowUtc = null) => {\n const shouldShowVenues = (summitShowLocDate && nowUtc) ? summitShowLocDate * 1000 < nowUtc : true;\n const locationName = [];\n const { location } = event;\n\n if (!shouldShowVenues) return 'TBA';\n\n if (!location) return 'TBA';\n\n if (summitVenueCount > 1 && location.venue?.name) locationName.push(location.venue.name);\n if (location.floor?.name) locationName.push(location.floor.name);\n if (location.name) locationName.push(location.name);\n\n return locationName.length > 0 ? locationName.join(' - ') : 'TBA';\n};\n\nexport const getEventHosts = (event) => {\n let hosts = [];\n if (event.speakers?.length > 0) {\n hosts = [...event.speakers];\n }\n if (event.moderator) hosts.push(event.moderator);\n\n return hosts;\n};\n\nconst loadImage = async url => {\n const img = document.createElement('img')\n img.src = url\n img.crossOrigin = 'anonymous'\n\n return new Promise((resolve, reject) => {\n img.onload = () => resolve(img)\n img.onerror = reject\n })\n}\n\nexport const convertSVGtoImg = async (svgUrl) => {\n const img = await loadImage(svgUrl)\n const newWidth = 100\n const newHeight = Math.floor(img.naturalHeight * 100 / img.naturalWidth)\n\n const canvas = document.createElement('canvas')\n canvas.width = newWidth\n canvas.height = newHeight\n canvas.getContext('2d').drawImage(img, 0, 0, newWidth, newHeight)\n\n const url = await canvas.toDataURL(`image/png`, 1.0)\n console.log(url, newWidth, newHeight);\n return {url, width: newWidth, height: newHeight}\n}\n\nexport const isRateEnabled = (value) =>\n value !== null && value !== undefined && value !== \"\";\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css\");","module.exports = require(\"i18n-react/dist/i18n-react\");","module.exports = require(\"moment-timezone\");","module.exports = require(\"react\");","module.exports = require(\"urijs\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react'\nimport T from 'i18n-react/dist/i18n-react'\nimport 'awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css'\nimport Input from '../inputs/text-input'\nimport { scrollToError, isEmpty, shallowEqual, hasErrors } from '../../utils/methods'\n\n\nclass SimpleForm extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n entity: {...props.entity},\n errors: props.errors\n };\n\n this.handleChange = this.handleChange.bind(this);\n this.handleSubmit = this.handleSubmit.bind(this);\n }\n\n componentDidUpdate(prevProps, prevState, snapshot) {\n const state = {};\n scrollToError(this.props.errors);\n\n if(prevProps.entity.id !== this.props.entity.id) {\n state.entity = {...this.props.entity};\n state.errors = {};\n }\n\n if (!shallowEqual(prevProps.errors, this.props.errors)) {\n state.errors = {...this.props.errors};\n }\n\n if (!isEmpty(state)) {\n this.setState({...this.state, ...state})\n }\n }\n\n handleChange(ev) {\n let entity = {...this.state.entity};\n let errors = {...this.state.errors};\n let {value, id} = ev.target;\n\n if (ev.target.type === 'checkbox') {\n value = ev.target.checked;\n }\n\n errors[id] = '';\n entity[id] = value;\n this.setState({entity: entity, errors: errors});\n }\n\n handleSubmit(ev) {\n let entity = {...this.state.entity};\n ev.preventDefault();\n\n this.props.onSubmit(this.state.entity);\n }\n\n createField(field) {\n let {entity, errors} = this.state;\n\n switch (field.type) {\n case 'text':\n return (\n <div key={\"field_\"+field.name} className=\"row form-group\">\n <div className=\"col-md-6\">\n <label> {field.label} </label>\n <Input\n id={field.name}\n value={entity[field.name]}\n onChange={this.handleChange}\n className=\"form-control\"\n error={hasErrors(field.name, errors)}\n />\n </div>\n </div>\n );\n break;\n case 'textarea':\n return (\n <div key={\"field_\"+field.name} className=\"row form-group\">\n <div className=\"col-md-6\">\n <label> {field.label} </label>\n <textarea\n id={field.name}\n value={entity[field.name]}\n onChange={this.handleChange}\n className=\"form-control\"\n />\n </div>\n </div>\n );\n break;\n case 'checkbox':\n return (\n <div key={\"field_\"+field.name} className=\"row form-group\">\n <div className=\"col-md-6\">\n <div className=\"form-check abc-checkbox\">\n <input type=\"checkbox\" id={field.name} checked={entity[field.name]}\n onChange={this.handleChange} className=\"form-check-input\" />\n <label className=\"form-check-label\" htmlFor={field.name}>\n {field.label}\n </label>\n </div>\n </div>\n </div>\n );\n break;\n\n }\n }\n\n render() {\n let {entity} = this.state;\n let {fields} = this.props;\n\n return (\n <form className=\"simple-form\">\n <input type=\"hidden\" id=\"id\" value={entity.id} />\n\n {fields.map(f => {\n return this.createField(f);\n })}\n\n <div className=\"row\">\n <div className=\"col-md-12 submit-buttons\">\n <input type=\"button\" onClick={this.handleSubmit}\n className=\"btn btn-primary pull-right\" value={T.translate(\"general.save\")}/>\n </div>\n </div>\n </form>\n );\n }\n}\n\nexport default SimpleForm;\n"],"names":["root","factory","exports","module","define","amd","this","Input","React","constructor","props","super","handleChange","bind","componentDidUpdate","prevProps","prevState","snapshot","value","input","ev","onChange","render","className","error","ariaLabelledBy","containerClassName","rest","has_error","hasOwnProperty","class_name","container_class_name","ref","node","defaultValue","defaultProps","scrollToError","errors","Object","keys","length","firstError","firstNode","document","getElementById","window","scrollTo","obj","curtop","offsetParent","offsetTop","findElementPos","hasErrors","field","shallowEqual","object1","object2","keys1","keys2","key","isEmpty","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","prop","prototype","call","r","Symbol","toStringTag","SimpleForm","state","entity","handleSubmit","id","setState","target","type","checked","preventDefault","onSubmit","createField","name","label","htmlFor","fields","map","f","onClick","T"],"sourceRoot":""}
1
+ {"version":3,"file":"components/forms/simple-form.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,oNCMM,MAAMC,UAAcC,IAAAA,UAE/BC,WAAAA,CAAYC,GACRC,MAAMD,GAENJ,KAAKM,aAAeN,KAAKM,aAAaC,KAAKP,KAC9C,CAEDQ,kBAAAA,CAAmBC,EAAWC,EAAWC,GACjCX,KAAKI,MAAMQ,QAAUH,EAAUG,QAC/BZ,KAAKa,MAAMD,MAAQZ,KAAKI,MAAMQ,MAErC,CAEDN,YAAAA,CAAaQ,GACTd,KAAKI,MAAMW,SAASD,EACvB,CAEDE,MAAAA,GAEI,IAAI,EAAkFhB,KAAKI,OAAvF,SAACW,EAAD,MAAWH,EAAX,UAAkBK,EAAlB,MAA6BC,EAA7B,eAAoCC,EAApC,mBAAoDC,GAAxD,EAA8EC,EAA9E,SACIC,EAActB,KAAKI,MAAMmB,eAAe,UAAsB,KAAVL,EACpDM,EAAaxB,KAAKI,MAAMmB,eAAe,aAAeN,EAAY,eAClEQ,EAAuBzB,KAAKI,MAAMmB,eAAe,sBAAwBH,EAAqB,yBAClG,OACI,yBAAKH,UAAWQ,GACZ,+BACIR,UAAY,GAAEO,KAAcF,EAAY,QAAU,KAClDI,IAAKC,IAAS3B,KAAKa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AOjC,EAAM2C,MACpB3E,SAAUf,KAAKM,aACfW,UAAU,mBAM9B,IAAK,WACD,OACI,yBAAKoC,IAAK,SAASN,EAAM2C,KAAMzE,UAAU,kBACrC,yBAAKA,UAAU,YACX,yBAAKA,UAAU,2BACX,2BAAOoE,KAAK,WAAWH,GAAInC,EAAM2C,KAAMJ,QAASN,EAAOjC,EAAM2C,MACtD3E,SAAUf,KAAKM,aAAcW,UAAU,qBAC9C,2BAAOA,UAAU,mBAAmB2E,QAAS7C,EAAM2C,MAC9C3C,EAAM4C,UAStC,CAED3E,MAAAA,GACI,IAAI,OAACgE,GAAUhF,KAAK+E,OAChB,OAACc,GAAU7F,KAAKI,MAEpB,OACI,0BAAMa,UAAU,eACZ,2BAAOoE,KAAK,SAASH,GAAG,KAAKtE,MAAOoE,EAAOE,KAE1CW,EAAOC,KAAIC,GACD/F,KAAKyF,YAAYM,KAG5B,yBAAK9E,UAAU,OACX,yBAAKA,UAAU,4BACX,2BAAOoE,KAAK,SAASW,QAAShG,KAAKiF,aAC5BhE,UAAU,6BAA6BL,MAAOqF,IAAAA,UAAY,oBAKpF,EAGL,U","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/inputs/text-input.js","webpack://openstack-uicore-foundation/./src/utils/methods.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://openstack-uicore-foundation/external commonjs \"awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react/dist/i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"moment-timezone\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"urijs\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/forms/simple-form.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\n\nexport default class Input extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleChange = this.handleChange.bind(this);\n }\n\n componentDidUpdate(prevProps, prevState, snapshot) {\n if (this.props.value !== prevProps.value) {\n this.input.value = this.props.value;\n }\n }\n\n handleChange(ev) {\n this.props.onChange(ev);\n }\n\n render() {\n\n let {onChange, value, className, error, ariaLabelledBy, containerClassName,...rest} = this.props;\n let has_error = ( this.props.hasOwnProperty('error') && error !== '' );\n let class_name = this.props.hasOwnProperty('className') ? className : 'form-control';\n let container_class_name = this.props.hasOwnProperty('containerClassName') ? containerClassName : 'container-form-control';\n return (\n <div className={container_class_name}>\n <input\n className={`${class_name} ${has_error ? 'error' : ''}`}\n ref={node => {this.input = node}}\n defaultValue={value}\n aria-labelledby={ariaLabelledBy}\n onChange={this.handleChange}\n {...rest}\n />\n {has_error &&\n <p className=\"error-label\">{error}</p>\n }\n </div>\n );\n\n }\n}\n\nInput.defaultProps = {\n ariaLabelledBy : null,\n}","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport moment from 'moment-timezone';\nimport URI from \"urijs\";\n\nexport const findElementPos = (obj) => {\n var curtop = -70;\n if (obj.offsetParent) {\n do {\n curtop += obj.offsetTop;\n } while (obj = obj.offsetParent);\n return [curtop];\n }\n};\n\nexport const epochToMoment = (atime) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime);\n};\n\nexport const epochToMomentTimeZone = (atime, time_zone) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime).tz(time_zone);\n};\n\nexport const formatEpoch = (atime, format = 'M/D/YYYY h:mm a') => {\n if(!atime) return atime;\n return epochToMoment(atime).format(format);\n};\n\nexport const parseLocationHour = (hour) => {\n let parsedHour = hour.toString();\n if(parsedHour.length < 4) parsedHour = `0${parsedHour}`;\n parsedHour = parsedHour.match(/.{2}/g);\n parsedHour = parsedHour.join(':');\n return parsedHour;\n}\n\nexport const objectToQueryString = (obj) => {\n var str = \"\";\n for (var key in obj) {\n if (str != \"\") {\n str += \"&\";\n }\n str += key + \"=\" + encodeURIComponent(obj[key]);\n }\n\n return str;\n};\n\nexport const getBackURL = () => {\n let url = URI(window.location.href);\n let query = url.search(true);\n let fragment = url.fragment();\n let backUrl = query.hasOwnProperty('BackUrl') ? query['BackUrl'] : null;\n if(backUrl != null && fragment != null && fragment != ''){\n backUrl += `#${fragment}`;\n }\n return backUrl;\n};\n\nexport const toSlug = (text) =>{\n text = text.toLowerCase();\n return text.replace(/[^a-zA-Z0-9]+/g,'_');\n}\n\nexport const getAuthCallback = () => {\n if(typeof window !== 'undefined') {\n return `${window.location.origin}/auth/callback`;\n }\n return null;\n};\n\nexport const getCurrentLocation = () => {\n let location = '';\n if(typeof window !== 'undefined') {\n location = window.location;\n // check if we are on iframe\n if (window.top)\n location = window.top.location;\n }\n return location;\n};\n\nexport const getOrigin = () => {\n if(typeof window !== 'undefined') {\n return window.location.origin;\n }\n return null;\n};\n\nexport const getCurrentPathName = () => {\n if(typeof window !== 'undefined') {\n return window.location.pathname;\n }\n return null;\n};\n\nexport const getCurrentHref = () => {\n if(typeof window !== 'undefined') {\n return window.location.href;\n }\n return null;\n};\n\nexport const getAllowedUserGroups = () => {\n if(typeof window !== 'undefined') {\n return window.ALLOWED_USER_GROUPS || '';\n }\n return null;\n};\n\nexport const buildAPIBaseUrl = (relativeUrl) => {\n if(typeof window !== 'undefined'){\n return `${window.API_BASE_URL}${relativeUrl}`;\n }\n return null``;\n};\n\nexport const putOnLocalStorage = (key, value) => {\n if(typeof window !== 'undefined') {\n window.localStorage.setItem(key, value);\n }\n};\n\nexport const getFromLocalStorage = (key, removeIt) => {\n if(typeof window !== 'undefined') {\n let val = window.localStorage.getItem(key);\n if(removeIt){\n console.log(`getFromLocalStorage removing key ${key}`);\n removeFromLocalStorage(key);\n }\n return val;\n }\n return null;\n};\n\nexport const removeFromLocalStorage = (key) => {\n if(typeof window !== 'undefined') {\n window.localStorage.removeItem(key);\n }\n}\n\nexport const isClearingSessionState = () => {\n if(typeof window !== 'undefined') {\n return window.clearing_session_state;\n }\n return false;\n};\n\nexport const setSessionClearingState = (val) => {\n if(typeof window !== 'undefined') {\n window.clearing_session_state = val;\n }\n};\n\nexport const getCurrentUserLanguage = () => {\n let language = 'en';\n if(typeof navigator !== 'undefined') {\n language = (navigator.languages && navigator.languages[0]) || navigator.language || navigator.userLanguage;\n }\n return language;\n};\n\nexport const scrollToError = (errors) => {\n if(Object.keys(errors).length > 0) {\n const firstError = Object.keys(errors)[0];\n const firstNode = document.getElementById(firstError);\n if (firstNode) window.scrollTo(0, findElementPos(firstNode));\n }\n};\n\nexport const hasErrors = (field, errors) => {\n if(field in errors) {\n return errors[field];\n }\n return '';\n};\n\nexport const shallowEqual = (object1, object2) => {\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (let key of keys1) {\n if (object1[key] !== object2[key]) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const arraysEqual = (a1, a2) =>\n a1.length === a2.length && a1.every((o, idx) => shallowEqual(o, a2[idx]));\n\nexport const isEmpty = (obj) => {\n return Object.keys(obj).length === 0;\n};\n\n\nexport const base64URLEncode = (str) => {\n return str\n .toString('base64')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '')\n}\n\nexport const retryPromise = async (\n cb,\n maxNumberOfRetries = 3\n) => {\n for (let i = 0; i < maxNumberOfRetries; i++) {\n if (await cb()) {\n return true;\n }\n }\n\n return false;\n}\n\nexport const getTimeServiceUrl = () => {\n if(typeof window !== 'undefined') {\n return window.TIMEINTERVALSINCE1970_API_URL || process.env.TIMEINTERVALSINCE1970_API_URL;\n }\n return null;\n};\n\nexport const getEventLocation = (event, summitVenueCount, summitShowLocDate = null, nowUtc = null) => {\n const shouldShowVenues = (summitShowLocDate && nowUtc) ? summitShowLocDate * 1000 < nowUtc : true;\n const locationName = [];\n const { location } = event;\n\n if (!shouldShowVenues) return 'TBA';\n\n if (!location) return 'TBA';\n\n if (summitVenueCount > 1 && location.venue?.name) locationName.push(location.venue.name);\n if (location.floor?.name) locationName.push(location.floor.name);\n if (location.name) locationName.push(location.name);\n\n return locationName.length > 0 ? locationName.join(' - ') : 'TBA';\n};\n\nexport const getEventHosts = (event) => {\n let hosts = [];\n if (event.speakers?.length > 0) {\n hosts = [...event.speakers];\n }\n if (event.moderator) hosts.push(event.moderator);\n\n return hosts;\n};\n\nconst loadImage = async url => {\n const img = document.createElement('img')\n img.src = url\n img.crossOrigin = 'anonymous'\n\n return new Promise((resolve, reject) => {\n img.onload = () => resolve(img)\n img.onerror = reject\n })\n}\n\nexport const convertSVGtoImg = async (svgUrl) => {\n const img = await loadImage(svgUrl)\n const newWidth = 100\n const newHeight = Math.floor(img.naturalHeight * 100 / img.naturalWidth)\n\n const canvas = document.createElement('canvas')\n canvas.width = newWidth\n canvas.height = newHeight\n canvas.getContext('2d').drawImage(img, 0, 0, newWidth, newHeight)\n\n const url = await canvas.toDataURL(`image/png`, 1.0)\n console.log(url, newWidth, newHeight);\n return {url, width: newWidth, height: newHeight}\n}\n\nexport const isRateEnabled = (value) =>\n value !== null && value !== undefined && value !== \"\";\n\n/**\n * Returns true if value is null, undefined, empty/whitespace string,\n * empty array, or empty object.\n */\nexport const empty = (value) => {\n if (value === null || value === undefined) return true;\n if (typeof value === \"string\") return value.trim().length === 0;\n if (Array.isArray(value)) return value.length === 0;\n if (typeof value === \"object\") return Object.keys(value).length === 0;\n return false;\n};\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css\");","module.exports = require(\"i18n-react/dist/i18n-react\");","module.exports = require(\"moment-timezone\");","module.exports = require(\"react\");","module.exports = require(\"urijs\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react'\nimport T from 'i18n-react/dist/i18n-react'\nimport 'awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css'\nimport Input from '../inputs/text-input'\nimport { scrollToError, isEmpty, shallowEqual, hasErrors } from '../../utils/methods'\n\n\nclass SimpleForm extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n entity: {...props.entity},\n errors: props.errors\n };\n\n this.handleChange = this.handleChange.bind(this);\n this.handleSubmit = this.handleSubmit.bind(this);\n }\n\n componentDidUpdate(prevProps, prevState, snapshot) {\n const state = {};\n scrollToError(this.props.errors);\n\n if(prevProps.entity.id !== this.props.entity.id) {\n state.entity = {...this.props.entity};\n state.errors = {};\n }\n\n if (!shallowEqual(prevProps.errors, this.props.errors)) {\n state.errors = {...this.props.errors};\n }\n\n if (!isEmpty(state)) {\n this.setState({...this.state, ...state})\n }\n }\n\n handleChange(ev) {\n let entity = {...this.state.entity};\n let errors = {...this.state.errors};\n let {value, id} = ev.target;\n\n if (ev.target.type === 'checkbox') {\n value = ev.target.checked;\n }\n\n errors[id] = '';\n entity[id] = value;\n this.setState({entity: entity, errors: errors});\n }\n\n handleSubmit(ev) {\n let entity = {...this.state.entity};\n ev.preventDefault();\n\n this.props.onSubmit(this.state.entity);\n }\n\n createField(field) {\n let {entity, errors} = this.state;\n\n switch (field.type) {\n case 'text':\n return (\n <div key={\"field_\"+field.name} className=\"row form-group\">\n <div className=\"col-md-6\">\n <label> {field.label} </label>\n <Input\n id={field.name}\n value={entity[field.name]}\n onChange={this.handleChange}\n className=\"form-control\"\n error={hasErrors(field.name, errors)}\n />\n </div>\n </div>\n );\n break;\n case 'textarea':\n return (\n <div key={\"field_\"+field.name} className=\"row form-group\">\n <div className=\"col-md-6\">\n <label> {field.label} </label>\n <textarea\n id={field.name}\n value={entity[field.name]}\n onChange={this.handleChange}\n className=\"form-control\"\n />\n </div>\n </div>\n );\n break;\n case 'checkbox':\n return (\n <div key={\"field_\"+field.name} className=\"row form-group\">\n <div className=\"col-md-6\">\n <div className=\"form-check abc-checkbox\">\n <input type=\"checkbox\" id={field.name} checked={entity[field.name]}\n onChange={this.handleChange} className=\"form-check-input\" />\n <label className=\"form-check-label\" htmlFor={field.name}>\n {field.label}\n </label>\n </div>\n </div>\n </div>\n );\n break;\n\n }\n }\n\n render() {\n let {entity} = this.state;\n let {fields} = this.props;\n\n return (\n <form className=\"simple-form\">\n <input type=\"hidden\" id=\"id\" value={entity.id} />\n\n {fields.map(f => {\n return this.createField(f);\n })}\n\n <div className=\"row\">\n <div className=\"col-md-12 submit-buttons\">\n <input type=\"button\" onClick={this.handleSubmit}\n className=\"btn btn-primary pull-right\" value={T.translate(\"general.save\")}/>\n </div>\n </div>\n </form>\n );\n }\n}\n\nexport default SimpleForm;\n"],"names":["root","factory","exports","module","define","amd","this","Input","React","constructor","props","super","handleChange","bind","componentDidUpdate","prevProps","prevState","snapshot","value","input","ev","onChange","render","className","error","ariaLabelledBy","containerClassName","rest","has_error","hasOwnProperty","class_name","container_class_name","ref","node","defaultValue","defaultProps","scrollToError","errors","Object","keys","length","firstError","firstNode","document","getElementById","window","scrollTo","obj","curtop","offsetParent","offsetTop","findElementPos","hasErrors","field","shallowEqual","object1","object2","keys1","keys2","key","isEmpty","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","prop","prototype","call","r","Symbol","toStringTag","SimpleForm","state","entity","handleSubmit","id","setState","target","type","checked","preventDefault","onSubmit","createField","name","label","htmlFor","fields","map","f","onClick","T"],"sourceRoot":""}