openstack-uicore-foundation 4.1.69 → 4.1.71
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.
- package/lib/components/extra-questions.js +1 -1
- package/lib/components/extra-questions.js.map +1 -1
- package/lib/components/forms/rsvp-form.js +1 -1
- package/lib/components/forms/rsvp-form.js.map +1 -1
- package/lib/components/free-text-search.js +1 -1
- package/lib/components/free-text-search.js.map +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/index.js.map +1 -1
- package/lib/components/inputs/action-dropdown.js +1 -1
- package/lib/components/inputs/action-dropdown.js.map +1 -1
- package/lib/components/inputs/checkbox-list.js +1 -1
- package/lib/components/inputs/checkbox-list.js.map +1 -1
- package/lib/components/inputs/radio-list.js +1 -1
- package/lib/components/inputs/radio-list.js.map +1 -1
- package/lib/css/components/extra-questions.css +1 -1
- package/lib/css/components/extra-questions.css.map +1 -1
- package/lib/css/components/free-text-search.css +1 -1
- package/lib/css/components/free-text-search.css.map +1 -1
- package/lib/css/components/index.css +1 -2
- package/lib/css/components/index.css.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/forms/rsvp-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,8QCUM,MAAMC,UAAqBC,IAAAA,UAEtCC,YAAYC,GACRC,MAAMD,GAEN,IAAIE,IAAaF,EAAMG,OAAQH,EAAMG,MAAMC,MAAMC,IAAML,EAAMM,QAAQC,KAAIC,GAAMA,EAAGL,QAAOM,SAASJ,KAElGT,KAAKc,MAAQ,CACTC,eAAgBT,GAGpBN,KAAKgB,aAAehB,KAAKgB,aAAaC,KA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AgBrG,SAASI,KACnDvB,MAAQA,EAEfP,KAAKgC,SAAS,CAAC4F,WAClB,CAEDK,UAAUS,GACN,IAAI,OAACV,GAAUhI,KAAKc,MACpB,OAAG4H,KAASV,EACDA,EAAOU,GAGX,EACV,CAEDR,aAAarG,GACTA,EAAG8G,iBAEH,IAAI,SAAEC,GAAa5I,KAAKI,OACpB,QAACwH,GAAW5H,KAAKc,MAErB8H,EAAShB,EACZ,CAED3F,SACI,IAAI,UAAE4F,EAAF,SAAae,GAAa5I,KAAKI,MAEnC,OACI,0BAAM+B,UAAU,aACX0F,EAAUlH,KAAImH,GACX,yBAAK3E,IAAK,YAAY2E,EAAEhG,GAAIK,UAAU,kBAClC,yBAAKA,UAAU,aACX,+BACI,kBAAC,UAAD,KAAU2F,EAAEzE,OADhB,IACkCyE,EAAEe,cAAgB,KAEnD7I,KAAKmI,eAAeL,OAIhCc,GACG,yBAAKzG,UAAU,OACX,yBAAKA,UAAU,aACX,4BAAQA,UAAU,kBAAkB2G,QAAS9I,KAAKkI,cAAlD,YAMvB,EAGL,S","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/inputs/checkbox-list.js","webpack://openstack-uicore-foundation/./src/components/inputs/dropdown.js","webpack://openstack-uicore-foundation/./src/components/inputs/radio-list.js","webpack://openstack-uicore-foundation/./src/components/inputs/text-input.js","webpack://openstack-uicore-foundation/./src/components/raw-html/index.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 \"prop-types\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"react-select\"","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/rsvp-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 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 **/\nimport PropTypes from 'prop-types'\nimport React from 'react';\nimport T from 'i18n-react/dist/i18n-react';\nimport RawHTML from '../raw-html';\n\nimport \"awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css\";\n\nexport default class CheckboxList extends React.Component {\n\n constructor(props) {\n super(props);\n\n let otherValue = props.value ? props.value.find( v => !props.options.map(op => op.value).includes(v) ) : false;\n\n this.state = {\n otherChecked: !!otherValue\n };\n\n this.handleChange = this.handleChange.bind(this);\n this.handleOtherCBChange = this.handleOtherCBChange.bind(this);\n }\n\n handleChange(event) {\n let optionValues = this.props.options.map(op => op.value);\n let value = this.props.value ? [...this.props.value] : [];\n\n if (event.target.type === 'checkbox') {\n if (event.target.checked) {\n const theVal = isNaN(event.target.value) ? event.target.value : parseInt(event.target.value);\n value.push(theVal);\n } else {\n value = value.filter( v => v != event.target.value )\n }\n } else {\n value = value.filter(v => optionValues.includes(v));\n value.push(event.target.value);\n }\n\n let ev = {target: {\n id: this.props.id,\n value: value,\n type: 'checkboxlist'\n }};\n\n this.props.onChange(ev);\n }\n\n handleOtherCBChange(event) {\n this.setState({otherChecked: event.target.checked});\n }\n\n render() {\n\n let {onChange, value, className, options, id, children, error, disabled,name, ariaLabelledBy, ...rest} = this.props;\n let { otherChecked } = this.state;\n\n let inline = ( this.props.hasOwnProperty('inline') );\n let html = ( this.props.hasOwnProperty('html') );\n let allowOther = ( this.props.hasOwnProperty('allowOther') );\n let otherValue = value ? value.find( v => !options.map(op => op.value).includes(v) ) : false ;\n let has_error = ( this.props.hasOwnProperty('error') && error !== '' );\n let isDisabled = (this.props.hasOwnProperty('disabled') && disabled == true);\n\n\n let style, label;\n\n if (inline) {\n style = {\n paddingLeft: '22px',\n marginLeft: '20px',\n float: 'left'\n };\n } else {\n style = {\n paddingLeft: '22px',\n marginTop: '7px'\n }\n }\n\n return (\n <div id={`chl_wrapper_${id}`} aria-labelledby={ariaLabelledBy}>\n <div className={\"checkboxes-div\" + (has_error ? ' error' : '') }>\n { options.map(op => {\n let checked = value ? value.includes(op.value) : false;\n return (\n <div className=\"form-check abc-checkbox\" key={\"radio_key_\" + op.value} style={style}>\n <input type=\"checkbox\"\n id={`cb_${id}_${op.value}`}\n name={name? name : id }\n checked={checked}\n disabled={isDisabled}\n onChange={this.handleChange} className=\"form-check-input\" value={op.value} />\n <label className=\"form-check-label\" htmlFor={`cb_${id}_${op.value}` } >\n {html &&\n <RawHTML>{op.label}</RawHTML>\n }\n {!html &&\n op.label\n }\n </label>\n </div>\n )\n })}\n\n {allowOther &&\n <div className=\"form-check abc-checkbox\" style={style}>\n <input type=\"checkbox\" id={\"cb_other\" + id} checked={otherChecked} disabled={isDisabled}\n onChange={this.handleOtherCBChange} className=\"form-check-input\" value=\"other\" />\n <label className=\"form-check-label\" htmlFor={\"cb_other\" + id}>\n {T.translate(\"general.other\")}\n </label>\n </div>\n }\n\n {allowOther && otherChecked &&\n <div style={{paddingLeft: '22px', width: '50%'}}>\n <input className=\"form-control\" disabled={isDisabled} onChange={this.handleChange} value={otherValue} />\n </div>\n }\n\n </div>\n {has_error &&\n <p className=\"error-label\">{error}</p>\n }\n </div>\n );\n\n }\n}\n\nCheckboxList.defaultProps = {\n ariaLabelledBy : null,\n}\n\n\nCheckboxList.propTypes = {\n id: PropTypes.string.isRequired\n};","/**\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';\nimport Select from 'react-select';\n\nexport default class Dropdown extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleChange = this.handleChange.bind(this);\n }\n\n handleChange(selection) {\n\n let value = null;\n if (this.props.isMulti) {\n value = selection ? selection.map(val => val.value) : null;\n } else {\n value = selection ? selection.value : null;\n }\n\n let ev = {target: {\n id: this.props.id,\n value: value,\n type: 'dropdown'\n }};\n\n this.props.onChange(ev);\n }\n\n render() {\n\n let {onChange, value, className, error, clearable, disabled, overrideCSS, ariaLabelledBy, ...rest} = this.props;\n let has_error = ( this.props.hasOwnProperty('error') && error != '' );\n let isClearable = (this.props.hasOwnProperty('clearable'));\n let isDisabled = (this.props.hasOwnProperty('disabled') && disabled == true);\n let theValue = null;\n\n let selectClassName = className;\n\n if (!this.props.hasOwnProperty('overrideCSS') || overrideCSS == false) {\n selectClassName = 'dropdown ' + className + ' ' + (has_error ? 'error' : '');\n }\n\n if (this.props.isMulti) {\n theValue = this.props.options.filter(op => value.includes(op.value));\n } else {\n theValue = (value instanceof Object || value == null) ? value : this.props.options.find(opt => opt.value == value);\n }\n\n const selectStyles = { menu: styles => ({ ...styles, zIndex: 999 }) };\n\n return (\n <div>\n <Select\n className={selectClassName}\n value={theValue}\n onChange={this.handleChange}\n isClearable={isClearable}\n isDisabled={isDisabled}\n styles={selectStyles}\n aria-labelledby={ariaLabelledBy}\n formatOptionLabel={(data) => <span dangerouslySetInnerHTML={{ __html: data.label }} />}\n {...rest}\n />\n {has_error &&\n <p className=\"error-label\">{error}</p>\n }\n </div>\n );\n\n }\n}\n\nDropdown.defaultProps = {\n ariaLabelledBy : null,\n}\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 RawHTML from '../raw-html';\nimport PropTypes from 'prop-types'\n\nimport \"awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css\";\n\nexport default class RadioList extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.state = {\n value: props.value,\n };\n\n this.handleChange = this.handleChange.bind(this);\n }\n\n handleChange(selection) {\n\n let ev = {target: {\n id: this.props.id,\n value: selection.target.value,\n type: 'radio'\n }};\n\n this.props.onChange(ev);\n }\n\n getLabel(option, id, inline, simple, html) {\n if (inline) {\n return (\n <label className=\"form-check-label\" htmlFor={`radio_${id}_${option.value}`} style={{display: 'inline-block'}}>\n {html &&\n <RawHTML>\n {option.label}\n </RawHTML>\n }\n {!html &&\n option.label\n }\n </label>\n );\n } else if (simple) {\n return (\n <label className=\"form-check-label\" htmlFor={`radio_${id}_${option.value}`} >\n {option.label}\n </label>\n );\n } else {\n return (\n <label className=\"form-check-label\" htmlFor={`radio_${id}_${option.value}`} style={{display: 'inline-block'}}>\n <h4 style={{marginTop: '0px'}}>{option.label}</h4>\n <RawHTML>{option.description}</RawHTML>\n </label>\n );\n }\n }\n\n render() {\n\n let {onChange, value, className, error, ariaLabelledBy, disabled, options,id, name,...rest} = this.props;\n let has_error = ( this.props.hasOwnProperty('error') && error != '' );\n let inline = ( this.props.hasOwnProperty('inline') );\n let simple = ( this.props.hasOwnProperty('simple') );\n let html = ( this.props.hasOwnProperty('html') );\n let isDisabled = (this.props.hasOwnProperty('disabled') && disabled == true);\n\n let style, label;\n\n if (inline) {\n style = {\n paddingLeft: '22px',\n marginLeft: '20px',\n float: 'left'\n };\n\n\n } else {\n style = {\n paddingLeft: '22px'\n }\n }\n\n return (\n <div id={`rl_wrapper_${id}`} aria-labelledby={ariaLabelledBy}>\n { options.map(op => {\n let checked = (op.value == value);\n return (\n <div className=\"form-check abc-radio\" key={`radio_key_${id}_${op.value}`} style={style}>\n <input\n className=\"form-check-input\"\n type=\"radio\"\n id={`radio_${id}_${op.value}`}\n value={op.value}\n checked={checked}\n onChange={this.handleChange}\n disabled={isDisabled}\n name={name ? name : `radio_${id}`}\n />\n {this.getLabel(op, id, inline, simple, html)}\n </div>\n )\n })}\n\n {has_error &&\n <p className=\"error-label\">{error}</p>\n }\n </div>\n );\n\n }\n}\n\nRadioList.defaultProps = {\n ariaLabelledBy : null,\n}\n\nRadioList.propTypes = {\n id: PropTypes.string.isRequired\n};","/**\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}","import React from 'react';\n\nconst RawHTML = ({children, replaceNewLine = false, className = \"\", ...rest}) =>\n <span className={className}\n dangerouslySetInnerHTML={{ __html: replaceNewLine ? children?.replace(/\\n/g, '<br />') : children}} {...rest}/>\n\nexport default RawHTML;","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(\"prop-types\");","module.exports = require(\"react\");","module.exports = require(\"react-select\");","// 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 'awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css'\nimport Input from '../inputs/text-input'\nimport Dropdown from '../inputs/dropdown'\nimport RawHTML from '../raw-html'\nimport CheckboxList from '../inputs/checkbox-list'\nimport RadioList from '../inputs/radio-list'\n\n\nclass RsvpForm extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n answers: props.questions.map(q => ({question_id: q.id, value: null})),\n errors: props.errors\n };\n\n this.handleChange = this.handleChange.bind(this);\n this.hasErrors = this.hasErrors.bind(this);\n this.handleSubmit = this.handleSubmit.bind(this);\n }\n\n renderQuestion(q) {\n const {answers} = this.state;\n const value = answers.find(a => a.question_id === q.id).value;\n\n switch(q.class_name) {\n case 'RSVPMemberEmailQuestionTemplate':\n case 'RSVPMemberFirstNameQuestionTemplate':\n case 'RSVPMemberLastNameQuestionTemplate':\n case 'RSVPTextBoxQuestionTemplate':\n return (\n <Input\n id={q.id}\n value={value || ''}\n onChange={this.handleChange}\n className=\"form-control\"\n error={this.hasErrors(q.id)}\n />\n );\n break;\n case 'RSVPTextAreaQuestionTemplate':\n return (\n <textarea\n id={q.id}\n value={value || ''}\n className=\"form-control\"\n onChange={this.handleChange}\n />);\n break;\n case 'RSVPLiteralContentQuestionTemplate':\n return (<div><RawHTML>{q.value}</RawHTML></div>);\n break;\n case 'RSVPCheckBoxListQuestionTemplate':\n return (\n <CheckboxList\n id={q.id}\n value={value}\n options={q.values.map(v => ({value: `${v.id}`, label: v.label}))}\n onChange={this.handleChange}\n error={this.hasErrors(q.id)}\n />\n );\n break;\n case 'RSVPRadioButtonListQuestionTemplate':\n return (\n <RadioList\n id={q.id}\n value={value}\n onChange={this.handleChange}\n options={q.values.map(v => ({value: `${v.id}`, label: v.label}))}\n error={this.hasErrors(q.id)}\n simple\n />\n );\n break;\n case 'RSVPDropDownQuestionTemplate':\n let values = (q.is_country_selector) ? q.values.map(v => ({value:v.id, label: v.value})) : q.values;\n\n return (\n <Dropdown\n id={q.id}\n isMulti={q.is_multiselect}\n value={value}\n onChange={this.handleChange}\n placeholder={q.empty_string}\n options={values}\n />\n );\n break;\n }\n }\n\n handleChange(ev) {\n let answers = [...this.state.answers];\n let {value, id} = ev.target;\n\n if (ev.target.type === 'datetime') {\n value = value.valueOf() / 1000;\n }\n\n let answer = answers.find(a => a.question_id === parseInt(id));\n answer.value = value;\n\n this.setState({answers});\n }\n\n hasErrors(field) {\n let {errors} = this.state;\n if(field in errors) {\n return errors[field];\n }\n\n return '';\n }\n\n handleSubmit(ev) {\n ev.preventDefault();\n\n let { onSubmit } = this.props;\n let {answers} = this.state;\n\n onSubmit(answers);\n }\n\n render() {\n let { questions, onSubmit } = this.props;\n\n return (\n <form className=\"rsvp-form\">\n {questions.map(q =>\n <div key={'question_'+q.id} className=\"row form-group\">\n <div className=\"col-md-12\">\n <label>\n <RawHTML>{q.label}</RawHTML> {q.is_mandatory && '*'}\n </label>\n {this.renderQuestion(q)}\n </div>\n </div>\n )}\n {onSubmit &&\n <div className=\"row\">\n <div className=\"col-md-12\">\n <button className=\"btn btn-primary\" onClick={this.handleSubmit}>Submit</button>\n </div>\n </div>\n }\n </form>\n );\n }\n}\n\nexport default RsvpForm;\n"],"names":["root","factory","exports","module","define","amd","this","CheckboxList","React","constructor","props","super","otherValue","value","find","v","options","map","op","includes","state","otherChecked","handleChange","bind","handleOtherCBChange","event","optionValues","target","type","checked","theVal","isNaN","parseInt","push","filter","ev","id","onChange","setState","render","style","className","children","error","disabled","name","ariaLabelledBy","inline","hasOwnProperty","html","allowOther","has_error","isDisabled","paddingLeft","marginLeft","float","marginTop","key","htmlFor","label","T","width","defaultProps","propTypes","PropTypes","Dropdown","selection","isMulti","val","clearable","overrideCSS","rest","isClearable","theValue","selectClassName","Object","opt","selectStyles","menu","styles","zIndex","formatOptionLabel","data","dangerouslySetInnerHTML","__html","RadioList","getLabel","option","simple","display","description","Input","componentDidUpdate","prevProps","prevState","snapshot","input","containerClassName","class_name","container_class_name","ref","node","defaultValue","replaceNewLine","replace","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","obj","prop","prototype","call","r","Symbol","toStringTag","RsvpForm","answers","questions","q","question_id","errors","hasErrors","handleSubmit","renderQuestion","values","is_country_selector","is_multiselect","placeholder","empty_string","valueOf","field","preventDefault","onSubmit","is_mandatory","onClick"],"sourceRoot":""}
|
|
1
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AAC,UAAD,CACIrG,GAAI+F,EAAE/F,GACN8B,QAASiE,EAAEQ,eACX9H,MAAOA,EACPwB,SAAU/B,KAAKgB,aACfsH,YAAaT,EAAEU,aACf7H,QAASyH,IAK5B,CAEDnH,aAAaa,GACT,IAAI8F,EAAU,IAAI3H,KAAKc,MAAM6G,UACzB,MAACpH,EAAD,GAAQuB,GAAMD,EAAGR,OAEE,aAAnBQ,EAAGR,OAAOC,OACVf,EAAQA,EAAMiI,UAAY,KAGjBb,EAAQnH,MAAKqG,GAAKA,EAAEiB,cAAgBpG,SAASI,KACnDvB,MAAQA,EAEfP,KAAKgC,SAAS,CAAC2F,WAClB,CAEDK,UAAUS,GACN,IAAI,OAACV,GAAU/H,KAAKc,MACpB,OAAG2H,KAASV,EACDA,EAAOU,GAGX,EACV,CAEDR,aAAapG,GACTA,EAAG6G,iBAEH,IAAI,SAAEC,GAAa3I,KAAKI,OACpB,QAACuH,GAAW3H,KAAKc,MAErB6H,EAAShB,EACZ,CAED1F,SACI,IAAI,UAAE2F,EAAF,SAAae,GAAa3I,KAAKI,MAEnC,OACI,0BAAM+B,UAAU,aACXyF,EAAUjH,KAAIkH,GACX,yBAAK3E,IAAK,YAAY2E,EAAE/F,GAAIK,UAAU,kBAClC,yBAAKA,UAAU,aACX,+BACI,kBAAC,UAAD,KAAU0F,EAAEzE,OADhB,IACkCyE,EAAEe,cAAgB,KAEnD5I,KAAKkI,eAAeL,OAIhCc,GACG,yBAAKxG,UAAU,OACX,yBAAKA,UAAU,aACX,4BAAQA,UAAU,kBAAkB0G,QAAS7I,KAAKiI,cAAlD,YAMvB,EAGL,S","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/inputs/checkbox-list.js","webpack://openstack-uicore-foundation/./src/components/inputs/dropdown.js","webpack://openstack-uicore-foundation/./src/components/inputs/radio-list.js","webpack://openstack-uicore-foundation/./src/components/inputs/text-input.js","webpack://openstack-uicore-foundation/./src/components/raw-html/index.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 \"prop-types\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"react-select\"","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/rsvp-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 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 **/\nimport PropTypes from 'prop-types'\nimport React from 'react';\nimport T from 'i18n-react/dist/i18n-react';\nimport RawHTML from '../raw-html';\n\nimport \"awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css\";\n\nexport default class CheckboxList extends React.Component {\n\n constructor(props) {\n super(props);\n\n let otherValue = props.value ? props.value.find( v => !props.options.map(op => op.value).includes(v) ) : false;\n\n this.state = {\n otherChecked: !!otherValue\n };\n\n this.handleChange = this.handleChange.bind(this);\n this.handleOtherCBChange = this.handleOtherCBChange.bind(this);\n }\n\n handleChange(event) {\n let optionValues = this.props.options.map(op => op.value);\n let value = this.props.value ? [...this.props.value] : [];\n\n if (event.target.type === 'checkbox') {\n if (event.target.checked) {\n const theVal = isNaN(event.target.value) ? event.target.value : parseInt(event.target.value);\n value.push(theVal);\n } else {\n value = value.filter( v => v != event.target.value )\n }\n } else {\n value = value.filter(v => optionValues.includes(v));\n value.push(event.target.value);\n }\n\n let ev = {target: {\n id: this.props.id,\n value: value,\n type: 'checkboxlist'\n }};\n\n this.props.onChange(ev);\n }\n\n handleOtherCBChange(event) {\n this.setState({otherChecked: event.target.checked});\n }\n\n render() {\n\n let {onChange, value, className, options, id, children, error, disabled,name, ariaLabelledBy, ...rest} = this.props;\n let { otherChecked } = this.state;\n\n let inline = ( this.props.hasOwnProperty('inline') );\n let allowOther = ( this.props.hasOwnProperty('allowOther') );\n let otherValue = value ? value.find( v => !options.map(op => op.value).includes(v) ) : false ;\n let has_error = ( this.props.hasOwnProperty('error') && error !== '' );\n let isDisabled = (this.props.hasOwnProperty('disabled') && disabled == true);\n\n\n let style, label;\n\n if (inline) {\n style = {\n paddingLeft: '22px',\n marginLeft: '20px',\n float: 'left'\n };\n } else {\n style = {\n paddingLeft: '22px',\n marginTop: '7px'\n }\n }\n\n return (\n <div id={`chl_wrapper_${id}`} aria-labelledby={ariaLabelledBy}>\n <div className={\"checkboxes-div\" + (has_error ? ' error' : '') }>\n { options.map(op => {\n let checked = value ? value.includes(op.value) : false;\n return (\n <div className=\"form-check abc-checkbox\" key={\"radio_key_\" + op.value} style={style}>\n <input type=\"checkbox\"\n id={`cb_${id}_${op.value}`}\n name={name? name : id }\n checked={checked}\n disabled={isDisabled}\n onChange={this.handleChange} className=\"form-check-input\" value={op.value} />\n <label className=\"form-check-label\" htmlFor={`cb_${id}_${op.value}` } >\n <RawHTML>{op.label}</RawHTML>\n </label>\n </div>\n )\n })}\n\n {allowOther &&\n <div className=\"form-check abc-checkbox\" style={style}>\n <input type=\"checkbox\" id={\"cb_other\" + id} checked={otherChecked} disabled={isDisabled}\n onChange={this.handleOtherCBChange} className=\"form-check-input\" value=\"other\" />\n <label className=\"form-check-label\" htmlFor={\"cb_other\" + id}>\n {T.translate(\"general.other\")}\n </label>\n </div>\n }\n\n {allowOther && otherChecked &&\n <div style={{paddingLeft: '22px', width: '50%'}}>\n <input className=\"form-control\" disabled={isDisabled} onChange={this.handleChange} value={otherValue} />\n </div>\n }\n\n </div>\n {has_error &&\n <p className=\"error-label\">{error}</p>\n }\n </div>\n );\n\n }\n}\n\nCheckboxList.defaultProps = {\n ariaLabelledBy : null,\n}\n\n\nCheckboxList.propTypes = {\n id: PropTypes.string.isRequired\n};\n","/**\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';\nimport Select from 'react-select';\n\nexport default class Dropdown extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleChange = this.handleChange.bind(this);\n }\n\n handleChange(selection) {\n\n let value = null;\n if (this.props.isMulti) {\n value = selection ? selection.map(val => val.value) : null;\n } else {\n value = selection ? selection.value : null;\n }\n\n let ev = {target: {\n id: this.props.id,\n value: value,\n type: 'dropdown'\n }};\n\n this.props.onChange(ev);\n }\n\n render() {\n\n let {onChange, value, className, error, clearable, disabled, overrideCSS, ariaLabelledBy, ...rest} = this.props;\n let has_error = ( this.props.hasOwnProperty('error') && error != '' );\n let isClearable = (this.props.hasOwnProperty('clearable'));\n let isDisabled = (this.props.hasOwnProperty('disabled') && disabled == true);\n let theValue = null;\n\n let selectClassName = className;\n\n if (!this.props.hasOwnProperty('overrideCSS') || overrideCSS == false) {\n selectClassName = 'dropdown ' + className + ' ' + (has_error ? 'error' : '');\n }\n\n if (this.props.isMulti) {\n theValue = this.props.options.filter(op => value.includes(op.value));\n } else {\n theValue = (value instanceof Object || value == null) ? value : this.props.options.find(opt => opt.value == value);\n }\n\n const selectStyles = { menu: styles => ({ ...styles, zIndex: 999 }) };\n\n return (\n <div>\n <Select\n className={selectClassName}\n value={theValue}\n onChange={this.handleChange}\n isClearable={isClearable}\n isDisabled={isDisabled}\n styles={selectStyles}\n aria-labelledby={ariaLabelledBy}\n formatOptionLabel={(data) => <span dangerouslySetInnerHTML={{ __html: data.label }} />}\n {...rest}\n />\n {has_error &&\n <p className=\"error-label\">{error}</p>\n }\n </div>\n );\n\n }\n}\n\nDropdown.defaultProps = {\n ariaLabelledBy : null,\n}\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 RawHTML from '../raw-html';\nimport PropTypes from 'prop-types'\n\nimport \"awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css\";\n\nexport default class RadioList extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.state = {\n value: props.value,\n };\n\n this.handleChange = this.handleChange.bind(this);\n }\n\n handleChange(selection) {\n\n let ev = {target: {\n id: this.props.id,\n value: selection.target.value,\n type: 'radio'\n }};\n\n this.props.onChange(ev);\n }\n\n getLabel(option, id, inline, simple) {\n if (inline) {\n return (\n <label className=\"form-check-label\" htmlFor={`radio_${id}_${option.value}`} style={{display: 'inline-block'}}>\n <RawHTML>\n {option.label}\n </RawHTML>\n </label>\n );\n } else if (simple) {\n return (\n <label className=\"form-check-label\" htmlFor={`radio_${id}_${option.value}`} >\n {option.label}\n </label>\n );\n } else {\n return (\n <label className=\"form-check-label\" htmlFor={`radio_${id}_${option.value}`} style={{display: 'inline-block'}}>\n <h4 style={{marginTop: '0px'}}>{option.label}</h4>\n <RawHTML>{option.description}</RawHTML>\n </label>\n );\n }\n }\n\n render() {\n\n let {onChange, value, className, error, ariaLabelledBy, disabled, options,id, name,...rest} = this.props;\n let has_error = ( this.props.hasOwnProperty('error') && error != '' );\n let inline = ( this.props.hasOwnProperty('inline') );\n let simple = ( this.props.hasOwnProperty('simple') );\n let isDisabled = (this.props.hasOwnProperty('disabled') && disabled == true);\n\n let style, label;\n\n if (inline) {\n style = {\n paddingLeft: '22px',\n marginLeft: '20px',\n float: 'left'\n };\n\n\n } else {\n style = {\n paddingLeft: '22px'\n }\n }\n\n return (\n <div id={`rl_wrapper_${id}`} aria-labelledby={ariaLabelledBy}>\n { options.map(op => {\n let checked = (op.value == value);\n return (\n <div className=\"form-check abc-radio\" key={`radio_key_${id}_${op.value}`} style={style}>\n <input\n className=\"form-check-input\"\n type=\"radio\"\n id={`radio_${id}_${op.value}`}\n value={op.value}\n checked={checked}\n onChange={this.handleChange}\n disabled={isDisabled}\n name={name ? name : `radio_${id}`}\n />\n {this.getLabel(op, id, inline, simple)}\n </div>\n )\n })}\n\n {has_error &&\n <p className=\"error-label\">{error}</p>\n }\n </div>\n );\n\n }\n}\n\nRadioList.defaultProps = {\n ariaLabelledBy : null,\n}\n\nRadioList.propTypes = {\n id: PropTypes.string.isRequired\n};\n","/**\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}","import React from 'react';\n\nconst RawHTML = ({children, replaceNewLine = false, className = \"\", ...rest}) =>\n <span className={className}\n dangerouslySetInnerHTML={{ __html: replaceNewLine ? children?.replace(/\\n/g, '<br />') : children}} {...rest}/>\n\nexport default RawHTML;","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(\"prop-types\");","module.exports = require(\"react\");","module.exports = require(\"react-select\");","// 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 'awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css'\nimport Input from '../inputs/text-input'\nimport Dropdown from '../inputs/dropdown'\nimport RawHTML from '../raw-html'\nimport CheckboxList from '../inputs/checkbox-list'\nimport RadioList from '../inputs/radio-list'\n\n\nclass RsvpForm extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n answers: props.questions.map(q => ({question_id: q.id, value: null})),\n errors: props.errors\n };\n\n this.handleChange = this.handleChange.bind(this);\n this.hasErrors = this.hasErrors.bind(this);\n this.handleSubmit = this.handleSubmit.bind(this);\n }\n\n renderQuestion(q) {\n const {answers} = this.state;\n const value = answers.find(a => a.question_id === q.id).value;\n\n switch(q.class_name) {\n case 'RSVPMemberEmailQuestionTemplate':\n case 'RSVPMemberFirstNameQuestionTemplate':\n case 'RSVPMemberLastNameQuestionTemplate':\n case 'RSVPTextBoxQuestionTemplate':\n return (\n <Input\n id={q.id}\n value={value || ''}\n onChange={this.handleChange}\n className=\"form-control\"\n error={this.hasErrors(q.id)}\n />\n );\n break;\n case 'RSVPTextAreaQuestionTemplate':\n return (\n <textarea\n id={q.id}\n value={value || ''}\n className=\"form-control\"\n onChange={this.handleChange}\n />);\n break;\n case 'RSVPLiteralContentQuestionTemplate':\n return (<div><RawHTML>{q.value}</RawHTML></div>);\n break;\n case 'RSVPCheckBoxListQuestionTemplate':\n return (\n <CheckboxList\n id={q.id}\n value={value}\n options={q.values.map(v => ({value: `${v.id}`, label: v.label}))}\n onChange={this.handleChange}\n error={this.hasErrors(q.id)}\n />\n );\n break;\n case 'RSVPRadioButtonListQuestionTemplate':\n return (\n <RadioList\n id={q.id}\n value={value}\n onChange={this.handleChange}\n options={q.values.map(v => ({value: `${v.id}`, label: v.label}))}\n error={this.hasErrors(q.id)}\n simple\n />\n );\n break;\n case 'RSVPDropDownQuestionTemplate':\n let values = (q.is_country_selector) ? q.values.map(v => ({value:v.id, label: v.value})) : q.values;\n\n return (\n <Dropdown\n id={q.id}\n isMulti={q.is_multiselect}\n value={value}\n onChange={this.handleChange}\n placeholder={q.empty_string}\n options={values}\n />\n );\n break;\n }\n }\n\n handleChange(ev) {\n let answers = [...this.state.answers];\n let {value, id} = ev.target;\n\n if (ev.target.type === 'datetime') {\n value = value.valueOf() / 1000;\n }\n\n let answer = answers.find(a => a.question_id === parseInt(id));\n answer.value = value;\n\n this.setState({answers});\n }\n\n hasErrors(field) {\n let {errors} = this.state;\n if(field in errors) {\n return errors[field];\n }\n\n return '';\n }\n\n handleSubmit(ev) {\n ev.preventDefault();\n\n let { onSubmit } = this.props;\n let {answers} = this.state;\n\n onSubmit(answers);\n }\n\n render() {\n let { questions, onSubmit } = this.props;\n\n return (\n <form className=\"rsvp-form\">\n {questions.map(q =>\n <div key={'question_'+q.id} className=\"row form-group\">\n <div className=\"col-md-12\">\n <label>\n <RawHTML>{q.label}</RawHTML> {q.is_mandatory && '*'}\n </label>\n {this.renderQuestion(q)}\n </div>\n </div>\n )}\n {onSubmit &&\n <div className=\"row\">\n <div className=\"col-md-12\">\n <button className=\"btn btn-primary\" onClick={this.handleSubmit}>Submit</button>\n </div>\n </div>\n }\n </form>\n );\n }\n}\n\nexport default RsvpForm;\n"],"names":["root","factory","exports","module","define","amd","this","CheckboxList","React","constructor","props","super","otherValue","value","find","v","options","map","op","includes","state","otherChecked","handleChange","bind","handleOtherCBChange","event","optionValues","target","type","checked","theVal","isNaN","parseInt","push","filter","ev","id","onChange","setState","render","style","className","children","error","disabled","name","ariaLabelledBy","inline","hasOwnProperty","allowOther","has_error","isDisabled","paddingLeft","marginLeft","float","marginTop","key","htmlFor","label","T","width","defaultProps","propTypes","PropTypes","Dropdown","selection","isMulti","val","clearable","overrideCSS","rest","isClearable","theValue","selectClassName","Object","opt","selectStyles","menu","styles","zIndex","formatOptionLabel","data","dangerouslySetInnerHTML","__html","RadioList","getLabel","option","simple","display","description","Input","componentDidUpdate","prevProps","prevState","snapshot","input","containerClassName","class_name","container_class_name","ref","node","defaultValue","replaceNewLine","replace","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","obj","prop","prototype","call","r","Symbol","toStringTag","RsvpForm","answers","questions","q","question_id","errors","hasErrors","handleSubmit","renderQuestion","values","is_country_selector","is_multiselect","placeholder","empty_string","valueOf","field","preventDefault","onSubmit","is_mandatory","onClick"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={3932:(e,t,a)=>{var r=a(8213),n=a.n(r),l=a(3838),s=a.n(l),i=a(6689),o=a.n(i),u=a(580),c=a.n(u),d=a(418),m=a(1833),h=a(401),p=a(7027),b=a(2230),g=a(1995);const v=require("react-final-form");var f=a(6793);const y="CheckBox",_="RadioButton";a(6471);const E=["input","meta","question","className","isDisabled","isRequired"],C=["input","meta","question","isDisabled","isRequired"],q=["input","meta","question","isDisabled","isRequired"],w=["input","meta","question","isDisabled","isRequired","maxValues"],N=e=>{let{input:t,meta:a,question:r,className:l,isDisabled:i,isRequired:u}=e,c=s()(e,E);return o().createElement(m.default,n()({},t,c,{containerClassName:l,name:(0,f.toSlug)(r.name),ariaLabelledBy:`${(0,f.toSlug)(r.name)} label`,id:(0,f.toSlug)(r.name),value:t.value,disabled:i,required:u,onChange:t.onChange,placeholder:r.placeholder}))},S=e=>{let{input:t,meta:a,question:r,isDisabled:l,isRequired:i}=e,u=s()(e,C);return o().createElement(p.default,n()({},t,u,{name:(0,f.toSlug)(r.name),ariaLabelledBy:`${(0,f.toSlug)(r.name)} label`,id:(0,f.toSlug)(r.name),overrideCSS:!0,value:t.value,disabled:l,required:i,onChange:t.onChange}))},k=e=>{let{input:t,meta:a,question:r,isDisabled:l,isRequired:i}=e,u=s()(e,q);return o().createElement(h.default,n()({},t,u,{name:(0,f.toSlug)(r.name),ariaLabelledBy:`${(0,f.toSlug)(r.name)} label`,id:(0,f.toSlug)(r.name),overrideCSS:!0,className:"ddl-extra-questions-container",classNamePrefix:"ddl-extra-questions",value:t.value,disabled:l,required:i,onChange:t.onChange}))},x=e=>{let{input:t,meta:a,question:r,isDisabled:l,isRequired:i,maxValues:u}=e,c=s()(e,w);return o().createElement(b.default,n()({},t,c,{id:(0,f.toSlug)(r.name),name:(0,f.toSlug)(r.name),ariaLabelledBy:`${(0,f.toSlug)(r.name)} label`,value:t.value,disabled:l,required:i,onChange:e=>{const a=e.target.value;return u>0&&a.length>u?null:t.onChange(e)}}))},O=e=>e?e=>e?void 0:"Required":()=>{},P=o().forwardRef((({extraQuestions:e,userAnswers:t,onAnswerChanges:a,className:r="questions-form",questionContainerClassName:n="question-container",questionLabelContainerClassName:l="question-label-container",questionControlContainerClassName:s="question-control-container",readOnly:u=!1,debug:c=!1,buttonText:m="Submit",RequiredErrorMessage:h="Required",ValidationErrorClassName:p="extra-question-error",allowExtraQuestionsEdit:b=!0,onError:E=(e=>console.log("form errors: ",e)),shouldScroll2FirstError:C=!0},q)=>{let w=null;const P=(0,i.useRef)({}),L=(0,i.useRef)(null),[B,F]=(0,i.useState)({});(0,i.useEffect)((()=>{$()}),[e]),(0,i.useImperativeHandle)(q,(()=>({doSubmit(){L.current.dispatchEvent(new Event("submit",{cancelable:!0,bubbles:!0}))},scroll2QuestionById(e){if(P.current.hasOwnProperty(e)){const t=P.current[e];t.focus(),t.scrollIntoView({behavior:"smooth",block:"center"})}}})));const $=()=>{const a=new g.default(e,t);F(a.formatAnswers())},j=({when:e,rule:t,children:a})=>o().createElement(v.Field,{name:e,subscription:{value:!0}},(({input:{value:e}})=>D(t,A(e,t),a))),R=({name:e})=>o().createElement(v.Field,{name:e,subscription:{error:!0,touched:!0}},(({meta:{error:e,touched:t}})=>e&&t?o().createElement("div",{className:p},e):null)),A=(e,t)=>{let a=t.answer_values;if(Array.isArray(e)){if(!e.length)return!1;let r="And"===t.answer_values_operator;return a.forEach((a=>{r="And"===t.answer_values_operator?r&&e.includes(parseInt(a)):r||e.includes(parseInt(a))})),r}return a.includes(e.toString())},D=(e,t,a)=>"Visible"===e.visibility?"Equal"===e.visibility_condition?t?a:(delete P.current[e.sub_question.id],null):t?(delete P.current[e.sub_question.id],null):a:"Equal"===e.visibility_condition?t?(delete P.current[e.sub_question.id],null):a:t?a:(delete P.current[e.sub_question.id],null),V=e=>{const t=String.fromCharCode(160),a=document.createElement("div");a.innerHTML=e.label;const r=a.innerText||a.textContent||"",n=[y,_],l=e.mandatory&&!n.includes(e.type)?`${r}${t}<b>*</b>`:r;return`<label id="${(0,f.toSlug)(e.name)} label" htmlFor="${(0,f.toSlug)(e.name)}">${l}</label>`},I=e=>{let t=e.values;const a=!b&&((e,t)=>{const a=(0,f.toSlug)(e.name);if(!t.hasOwnProperty(a))return!1;const r=t[a];return Array.isArray(r)||"string"==typeof r?r.length>0:"number"==typeof r?r>0:"boolean"==typeof r&&r})(e,B);var r,u,c,m;if("Text"===e.type)return o().createElement(i.Fragment,{key:(0,f.toSlug)(e.name)},o().createElement("div",{ref:t=>P.current[e.id]=t,className:n},o().createElement(d.default,{replaceNewLine:!0,className:l},V(e)),o().createElement("div",{className:s},o().createElement(v.Field,{name:(0,f.toSlug)(e.name),question:e,isDisabled:a,isRequired:e.mandatory,validate:O(e.mandatory),component:N}),o().createElement(R,{name:(0,f.toSlug)(e.name)}))),(null===(r=e.sub_question_rules)||void 0===r?void 0:r.length)>0&&e.sub_question_rules.map((t=>o().createElement(j,{key:t.id,when:(0,f.toSlug)(e.name),rule:t},I(t.sub_question)))));if("TextArea"===e.type)return o().createElement(i.Fragment,{key:(0,f.toSlug)(e.name)},o().createElement("div",{ref:t=>P.current[e.id]=t,className:n},o().createElement(d.default,{replaceNewLine:!0,className:l},V(e)),o().createElement("div",{className:s},o().createElement(v.Field,{validate:O(e.mandatory),name:(0,f.toSlug)(e.name),id:(0,f.toSlug)(e.name),disabled:a,required:e.mandatory,component:"textarea"}),o().createElement(R,{name:(0,f.toSlug)(e.name)}))),(null===(u=e.sub_question_rules)||void 0===u?void 0:u.length)>0&&e.sub_question_rules.map((t=>o().createElement(j,{key:t.id,when:(0,f.toSlug)(e.name),rule:t},I(t.sub_question)))));if(e.type===y)return o().createElement(i.Fragment,{key:(0,f.toSlug)(e.name)},o().createElement("div",{ref:t=>P.current[e.id]=t,className:`${n} checkbox-wrapper`},o().createElement("div",{className:`${s} input-wrapper`},o().createElement("div",{className:"form-check abc-checkbox"},o().createElement(v.Field,{name:(0,f.toSlug)(e.name),id:(0,f.toSlug)(e.name),validate:O(e.mandatory),disabled:a,required:e.mandatory,type:"checkbox",className:"form-check-input",component:"input"}),o().createElement("label",{className:"form-check-label",htmlFor:(0,f.toSlug)(e.name)}),e.mandatory&&o().createElement("span",{className:"checkbox-mandatory"},o().createElement("b",null,"*")))),o().createElement(d.default,{replaceNewLine:!0,className:`eq-checkbox-label ${l}`},V(e))),o().createElement(R,{name:(0,f.toSlug)(e.name)}),(null===(c=e.sub_question_rules)||void 0===c?void 0:c.length)>0&&e.sub_question_rules.map((t=>o().createElement(j,{key:t.id,when:(0,f.toSlug)(e.name),rule:t},I(t.sub_question)))));if(e.type===_)return o().createElement(i.Fragment,{key:(0,f.toSlug)(e.name)},o().createElement("div",{ref:t=>P.current[e.id]=t,className:`${n} checkbox-wrapper`},o().createElement("div",{className:`${s} input-wrapper`},o().createElement("div",{className:"form-check abc-radio"},o().createElement(v.Field,{name:(0,f.toSlug)(e.name),id:(0,f.toSlug)(e.name),validate:O(e.mandatory),disabled:a,required:e.mandatory,type:"radio",className:"form-check-input",value:"true",component:"input"}),o().createElement("label",{className:"form-check-label",htmlFor:(0,f.toSlug)(e.name)}),e.mandatory&&o().createElement("span",{className:"checkbox-mandatory"},o().createElement("b",null,"*")))),o().createElement(d.default,{replaceNewLine:!0,className:`eq-checkbox-label ${l}`},V(e))),o().createElement(R,{name:(0,f.toSlug)(e.name)}),(null===(m=e.sub_question_rules)||void 0===m?void 0:m.length)>0&&e.sub_question_rules.map((t=>o().createElement(j,{key:t.id,when:(0,f.toSlug)(e.name),rule:t},I(t.sub_question)))));if("RadioButtonList"===e.type){var h;const r=t.map((e=>({label:e.label,value:e.id})));return o().createElement(i.Fragment,{key:(0,f.toSlug)(e.name)},o().createElement("div",{key:(0,f.toSlug)(e.name),ref:t=>P.current[e.id]=t,className:n},o().createElement(d.default,{replaceNewLine:!0,className:l},V(e)),o().createElement("div",{className:s},o().createElement(v.Field,{name:(0,f.toSlug)(e.name),options:r,question:e,validate:O(e.mandatory),isDisabled:a,isRequired:e.mandatory,component:S}),o().createElement(R,{name:(0,f.toSlug)(e.name)}))),(null===(h=e.sub_question_rules)||void 0===h?void 0:h.length)>0&&e.sub_question_rules.map((t=>o().createElement(j,{key:t.id,when:(0,f.toSlug)(e.name),rule:t},I(t.sub_question)))))}if("ComboBox"===e.type||"CountryComboBox"===e.type){var p;const r=t.map((e=>({label:e.label,value:e.id})));return o().createElement(i.Fragment,{key:(0,f.toSlug)(e.name)},o().createElement("div",{ref:t=>P.current[e.id]=t,className:n},o().createElement(d.default,{replaceNewLine:!0,className:l},V(e)),o().createElement("div",{className:`${s} reactSelectDropdown`},o().createElement(v.Field,{name:(0,f.toSlug)(e.name),options:r,question:e,validate:O(e.mandatory),isDisabled:a,isRequired:e.mandatory,component:k}),o().createElement(R,{name:(0,f.toSlug)(e.name)}))),(null===(p=e.sub_question_rules)||void 0===p?void 0:p.length)>0&&e.sub_question_rules.map((t=>o().createElement(j,{key:t.id,when:(0,f.toSlug)(e.name),rule:t},I(t.sub_question)))))}if("CheckBoxList"===e.type){var g;const r=t.map((e=>({label:e.label,value:e.id})));return o().createElement(i.Fragment,{key:(0,f.toSlug)(e.name)},o().createElement("div",{ref:t=>P.current[e.id]=t,className:n},o().createElement(d.default,{replaceNewLine:!0,className:l},V(e)),o().createElement("div",{className:s},o().createElement(v.Field,{name:(0,f.toSlug)(e.name),className:s,validate:O(e.mandatory),options:r,question:e,maxValues:e.max_selected_values,isDisabled:a,isRequired:e.mandatory,component:x}),o().createElement(R,{name:(0,f.toSlug)(e.name)}))),(null===(g=e.sub_question_rules)||void 0===g?void 0:g.length)>0&&e.sub_question_rules.map((t=>o().createElement(j,{key:t.id,when:(0,f.toSlug)(e.name),rule:t},I(t.sub_question)))))}return null},Q=(e,t,a)=>{var r;if(e.mandatory&&(e=>!!P.current[e.id])(e)){const r=(0,f.toSlug)(e.name);t.hasOwnProperty((0,f.toSlug)(r))&&""!==t[(0,f.toSlug)(r)]&&0!==t[r].length||(a[r]=h)}null===(r=e.sub_question_rules)||void 0===r||r.forEach((e=>{Q(e.sub_question,t,a)}))};if(!Object.keys(B).length)return null;const T=(e,t,a)=>{var r;t.includes((0,f.toSlug)(e.name))&&a.push(e),null===(r=e.sub_question_rules)||void 0===r||r.forEach((e=>{T(e.sub_question,t,a)}))},M=t=>{const a=[];return e.forEach((e=>{T(e,t,a)})),a.sort(((e,t)=>e.order>t.order))[0]};return Object.keys(B).length?o().createElement("div",{className:r},o().createElement(v.Form,{validate:t=>{const a={};return e.forEach((e=>{Q(e,t,a)})),a},onSubmit:e=>{a(e)},initialValues:B},(({handleSubmit:t,form:a,submitting:r,pristine:n,values:l})=>(w=t,o().createElement("form",{onSubmit:e=>{const r=a.getRegisteredFields().filter((e=>a.getFieldState(e).invalid));if(r.length>0){const e=M(r);E(r,P.current[e.id],e.id),C&&(e=>{const t=M(e);P.current[t.id].scrollIntoView({behavior:"smooth",block:"center"})})(r)}t(e)},ref:L},u?o().createElement("fieldset",{disabled:"disabled"},e.map((e=>I(e)))):e.map((e=>I(e))),c&&o().createElement("pre",null,JSON.stringify(l,0,2)))))),!q&&o().createElement("button",{type:"submit",onClick:e=>{w(e)},style:{marginTop:10}},m)):null}));P.propTypes={extraQuestions:c().array.isRequired,userAnswers:c().array.isRequired,onAnswerChanges:c().func.isRequired,className:c().string,debug:c().bool,buttonText:c().string,questionContainerClassName:c().string,questionLabelContainerClassName:c().string,questionControlContainerClassName:c().string,RequiredErrorMessage:c().string,ValidationErrorClassName:c().string,allowExtraQuestionsEdit:c().bool,shouldScroll2FirstError:c().bool,readOnly:c().bool}},2230:(e,t,a)=>{a.d(t,{default:()=>h});var r=a(3838),n=a.n(r),l=a(580),s=a.n(l),i=a(6689),o=a.n(i),u=a(4656),c=a.n(u),d=a(418);a(6471);const m=["onChange","value","className","options","id","children","error","disabled","name","ariaLabelledBy"];class h extends o().Component{constructor(e){super(e);let t=!!e.value&&e.value.find((t=>!e.options.map((e=>e.value)).includes(t)));this.state={otherChecked:!!t},this.handleChange=this.handleChange.bind(this),this.handleOtherCBChange=this.handleOtherCBChange.bind(this)}handleChange(e){let t=this.props.options.map((e=>e.value)),a=this.props.value?[...this.props.value]:[];if("checkbox"===e.target.type)if(e.target.checked){const t=isNaN(e.target.value)?e.target.value:parseInt(e.target.value);a.push(t)}else a=a.filter((t=>t!=e.target.value));else a=a.filter((e=>t.includes(e))),a.push(e.target.value);let r={target:{id:this.props.id,value:a,type:"checkboxlist"}};this.props.onChange(r)}handleOtherCBChange(e){this.setState({otherChecked:e.target.checked})}render(){let e,t=this.props,{onChange:a,value:r,className:l,options:s,id:i,children:u,error:h,disabled:p,name:b,ariaLabelledBy:g}=t,{otherChecked:v}=(n()(t,m),this.state),f=this.props.hasOwnProperty("inline"),y=this.props.hasOwnProperty("html"),_=this.props.hasOwnProperty("allowOther"),E=!!r&&r.find((e=>!s.map((e=>e.value)).includes(e))),C=this.props.hasOwnProperty("error")&&""!==h,q=this.props.hasOwnProperty("disabled")&&1==p;return e=f?{paddingLeft:"22px",marginLeft:"20px",float:"left"}:{paddingLeft:"22px",marginTop:"7px"},o().createElement("div",{id:`chl_wrapper_${i}`,"aria-labelledby":g},o().createElement("div",{className:"checkboxes-div"+(C?" error":"")},s.map((t=>{let a=!!r&&r.includes(t.value);return o().createElement("div",{className:"form-check abc-checkbox",key:"radio_key_"+t.value,style:e},o().createElement("input",{type:"checkbox",id:`cb_${i}_${t.value}`,name:b||i,checked:a,disabled:q,onChange:this.handleChange,className:"form-check-input",value:t.value}),o().createElement("label",{className:"form-check-label",htmlFor:`cb_${i}_${t.value}`},y&&o().createElement(d.default,null,t.label),!y&&t.label))})),_&&o().createElement("div",{className:"form-check abc-checkbox",style:e},o().createElement("input",{type:"checkbox",id:"cb_other"+i,checked:v,disabled:q,onChange:this.handleOtherCBChange,className:"form-check-input",value:"other"}),o().createElement("label",{className:"form-check-label",htmlFor:"cb_other"+i},c().translate("general.other"))),_&&v&&o().createElement("div",{style:{paddingLeft:"22px",width:"50%"}},o().createElement("input",{className:"form-control",disabled:q,onChange:this.handleChange,value:E}))),C&&o().createElement("p",{className:"error-label"},h))}}h.defaultProps={ariaLabelledBy:null},h.propTypes={id:s().string.isRequired}},401:(e,t,a)=>{a.d(t,{default:()=>g});var r=a(8213),n=a.n(r),l=a(8779),s=a.n(l),i=a(3838),o=a.n(i),u=a(6689),c=a.n(u),d=a(1929),m=a.n(d);const h=["onChange","value","className","error","clearable","disabled","overrideCSS","ariaLabelledBy"];function p(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function b(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?p(Object(a),!0).forEach((function(t){s()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):p(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}class g extends c().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}handleChange(e){let t=null;t=this.props.isMulti?e?e.map((e=>e.value)):null:e?e.value:null;let a={target:{id:this.props.id,value:t,type:"dropdown"}};this.props.onChange(a)}render(){let e=this.props,{onChange:t,value:a,className:r,error:l,clearable:s,disabled:i,overrideCSS:u,ariaLabelledBy:d}=e,p=o()(e,h),g=this.props.hasOwnProperty("error")&&""!=l,v=this.props.hasOwnProperty("clearable"),f=this.props.hasOwnProperty("disabled")&&1==i,y=null,_=r;this.props.hasOwnProperty("overrideCSS")&&0!=u||(_="dropdown "+r+" "+(g?"error":"")),y=this.props.isMulti?this.props.options.filter((e=>a.includes(e.value))):a instanceof Object||null==a?a:this.props.options.find((e=>e.value==a));const E={menu:e=>b(b({},e),{},{zIndex:999})};return c().createElement("div",null,c().createElement(m(),n()({className:_,value:y,onChange:this.handleChange,isClearable:v,isDisabled:f,styles:E,"aria-labelledby":d,formatOptionLabel:e=>c().createElement("span",{dangerouslySetInnerHTML:{__html:e.label}})},p)),g&&c().createElement("p",{className:"error-label"},l))}}g.defaultProps={ariaLabelledBy:null}},7027:(e,t,a)=>{a.d(t,{default:()=>d});var r=a(3838),n=a.n(r),l=a(6689),s=a.n(l),i=a(418),o=a(580),u=a.n(o);a(6471);const c=["onChange","value","className","error","ariaLabelledBy","disabled","options","id","name"];class d extends s().Component{constructor(e){super(e),this.state={value:e.value},this.handleChange=this.handleChange.bind(this)}handleChange(e){let t={target:{id:this.props.id,value:e.target.value,type:"radio"}};this.props.onChange(t)}getLabel(e,t,a,r,n){return a?s().createElement("label",{className:"form-check-label",htmlFor:`radio_${t}_${e.value}`,style:{display:"inline-block"}},n&&s().createElement(i.default,null,e.label),!n&&e.label):r?s().createElement("label",{className:"form-check-label",htmlFor:`radio_${t}_${e.value}`},e.label):s().createElement("label",{className:"form-check-label",htmlFor:`radio_${t}_${e.value}`,style:{display:"inline-block"}},s().createElement("h4",{style:{marginTop:"0px"}},e.label),s().createElement(i.default,null,e.description))}render(){let e,t=this.props,{onChange:a,value:r,className:l,error:i,ariaLabelledBy:o,disabled:u,options:d,id:m,name:h}=t,p=(n()(t,c),this.props.hasOwnProperty("error")&&""!=i),b=this.props.hasOwnProperty("inline"),g=this.props.hasOwnProperty("simple"),v=this.props.hasOwnProperty("html"),f=this.props.hasOwnProperty("disabled")&&1==u;return e=b?{paddingLeft:"22px",marginLeft:"20px",float:"left"}:{paddingLeft:"22px"},s().createElement("div",{id:`rl_wrapper_${m}`,"aria-labelledby":o},d.map((t=>{let a=t.value==r;return s().createElement("div",{className:"form-check abc-radio",key:`radio_key_${m}_${t.value}`,style:e},s().createElement("input",{className:"form-check-input",type:"radio",id:`radio_${m}_${t.value}`,value:t.value,checked:a,onChange:this.handleChange,disabled:f,name:h||`radio_${m}`}),this.getLabel(t,m,b,g,v))})),p&&s().createElement("p",{className:"error-label"},i))}}d.defaultProps={ariaLabelledBy:null},d.propTypes={id:u().string.isRequired}},1833:(e,t,a)=>{a.d(t,{default:()=>c});var r=a(8213),n=a.n(r),l=a(3838),s=a.n(l),i=a(6689),o=a.n(i);const u=["onChange","value","className","error","ariaLabelledBy","containerClassName"];class c extends o().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}componentDidUpdate(e,t,a){this.props.value!==e.value&&(this.input.value=this.props.value)}handleChange(e){this.props.onChange(e)}render(){let e=this.props,{onChange:t,value:a,className:r,error:l,ariaLabelledBy:i,containerClassName:c}=e,d=s()(e,u),m=this.props.hasOwnProperty("error")&&""!==l,h=this.props.hasOwnProperty("className")?r:"form-control",p=this.props.hasOwnProperty("containerClassName")?c:"container-form-control";return o().createElement("div",{className:p},o().createElement("input",n()({className:`${h} ${m?"error":""}`,ref:e=>{this.input=e},defaultValue:a,"aria-labelledby":i,onChange:this.handleChange},d)),m&&o().createElement("p",{className:"error-label"},l))}}c.defaultProps={ariaLabelledBy:null}},418:(e,t,a)=>{a.d(t,{default:()=>c});var r=a(8213),n=a.n(r),l=a(3838),s=a.n(l),i=a(6689),o=a.n(i);const u=["children","replaceNewLine","className"],c=e=>{let{children:t,replaceNewLine:a=!1,className:r=""}=e,l=s()(e,u);return o().createElement("span",n()({className:r,dangerouslySetInnerHTML:{__html:a?null==t?void 0:t.replace(/\n/g,"<br />"):t}},l))}},6793:(e,t,a)=>{a.d(t,{toSlug:()=>r});a(8362),a(6530);const r=e=>(e=e.toLowerCase()).replace(/[^a-zA-Z0-9]+/g,"_")},1995:(e,t,a)=>{a.d(t,{default:()=>p});var r=a(8779),n=a.n(r),l=a(6793);function s(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function i(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?s(Object(a),!0).forEach((function(t){n()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):s(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}const o="ComboBox",u="CheckBoxList",c="RadioButtonList",d=[o,u,c],m="And",h="Equal";class p{constructor(e,t=[]){n()(this,"_parseQuestion",(e=>{if(this.questionByName[(0,l.toSlug)(e.name)]=e,this.questionById[parseInt(e.id)]=e,e.hasOwnProperty("sub_question_rules"))for(let t of e.sub_question_rules)this.rules[parseInt(t.id)]=t,this._parseQuestion(t.sub_question)})),n()(this,"_parseQuestions",(()=>{for(let e of this.questions)this._parseQuestion(e)})),n()(this,"_allowsValues",(e=>d.includes(e.type))),n()(this,"_allowsValue",((e,t)=>{let a=t.value.split(",").map((e=>parseInt(e)));for(let t of a)if(!e.values.map((e=>e.id)).includes(t))return!1;return!0})),n()(this,"_getAnswerFor",(e=>{let t=Number.isInteger(e)?e:e.id,a=this.answers[t]||null;return a||null})),n()(this,"_hasValue",(e=>""!==e.value)),n()(this,"_answerContains",((e,t)=>e.value.split(",").includes(t))),n()(this,"_isSubQuestionVisible",(e=>{let t=e.answer_values_operator===m;const a=this._getAnswerFor(e.parent_question_id);if(a)switch(e.visibility_condition){case h:for(let r of e.answer_values)t=e.answer_values_operator===m?t&&this._answerContains(a,r):t||this._answerContains(a,r);break;case"NotEqual":for(let r of e.answer_values)t=e.answer_values_operator===m?t&&!this._answerContains(a,r):t||!this._answerContains(a,r)}else t=e.visibility_condition!==h;return"Visible"===e.visibility?t:!t})),n()(this,"_isAnswered",(e=>{const t=this._getAnswerFor(e);if("MainQuestion"===e.class)return!e.mandatory||!!t&&(!!this._hasValue(t)&&!(this._allowsValues(e)&&!this._allowsValue(e,t)));for(let a of e.parent_rules)if(this._isSubQuestionVisible(this.rules[a]))return!e.mandatory||!!t&&(!!this._hasValue(t)&&!(this._allowsValues(e)&&!this._allowsValue(e,t)));return!0})),n()(this,"_checkQuestion",(e=>{let t=this._isAnswered(e);if(e.hasOwnProperty("sub_question_rules"))for(let a of e.sub_question_rules)t=t&&this._checkQuestion(a.sub_question);return t})),n()(this,"_formatQuestionAnswer",(e=>{var t,a;let r={};const n=(0,l.toSlug)(e.name);let s=null===(t=this.originalAnswers.find((t=>t.question_id===e.id)))||void 0===t?void 0:t.value;if(!s&&(null==e||null===(a=e.values)||void 0===a?void 0:a.length)>0){const t=e.values.find((e=>e.is_default));t&&(s=t.id.toString())}if(s&&("CheckBox"===e.type&&(s="false"!==s&&!!s),e.type!==c&&e.type!==o||(s=parseInt(s)),e.type===u&&(s=s.split(",").map((e=>parseInt(e)))||[])),r[n]=s||"",e.type===u&&""===r[n]&&(r[n]=[]),e.hasOwnProperty("sub_question_rules"))for(let t of e.sub_question_rules){let e=this._formatQuestionAnswer(t.sub_question);r=i(i({},r),e)}return r})),n()(this,"formatAnswers",(()=>{let e={};return this.questions.forEach((t=>{let a=this._formatQuestionAnswer(t);e=i(i({},e),a)})),e})),n()(this,"completed",(()=>{let e=!0;for(let t of this.questions)e=e&&this._checkQuestion(t);return e})),n()(this,"getQuestionByName",(e=>{const t=(0,l.toSlug)(e);return this.questionByName[e]||this.questionByName[t]||null})),n()(this,"getQuestionById",(e=>this.questionById[parseInt(e)]||null)),this.questions=e,this.originalAnswers=t,this.answers=[];for(let e of this.originalAnswers)this.answers[e.question_id]=e;this.questionByName={},this.questionById={},this.rules={},this._parseQuestions()}}},8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},6471:e=>{e.exports=require("awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},8362:e=>{e.exports=require("moment-timezone")},580:e=>{e.exports=require("prop-types")},6689:e=>{e.exports=require("react")},1929:e=>{e.exports=require("react-select")},6530:e=>{e.exports=require("urijs")}},t={};function a(r){var n=t[r];if(void 0!==n)return n.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,a),l.exports}(()=>{a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t}})(),(()=>{a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{a.r(r),a.d(r,{default:()=>u});var e=a(6689),t=a.n(e),n=a(4656),l=a.n(n),s=(a(3932),a(580)),i=a.n(s);class o extends t().Component{constructor(e){super(e),this.onSearchClick=this.onSearchClick.bind(this),this.onClearClick=this.onClearClick.bind(this),this.onKeyPressed=this.onKeyPressed.bind(this),this.onChange=this.onChange.bind(this),this.state={value:e.value}}onSearchClick(e){let{preventEvents:t}=this.props;t&&e.preventDefault(),this.doFiltering(this.state.value)}onClearClick(e){let{preventEvents:t}=this.props;t&&e.preventDefault(),this.doFiltering(""),this.setState({value:""})}doFiltering(e){this.props.onSearch(e.trim())}onKeyPressed(e){13===(e.keyCode||e.which)&&this.doFiltering(this.state.value)}onChange(e){this.setState({value:e.target.value}),this.props.onChange&&this.props.onChange(e.target.value)}render(){let{value:e}=this.state;return t().createElement("div",{className:"row search-container"},t().createElement("div",{className:"col-md-12"},t().createElement("div",{className:"input-group"},t().createElement("input",{type:"text",value:e,className:"form-control",placeholder:this.props.placeholder,onKeyPress:this.onKeyPressed,onChange:this.onChange}),t().createElement("span",{className:"input-group-btn",style:{width:"5%"}},t().createElement("button",{onClick:this.onSearchClick,className:"btn btn-default",title:l().translate("general.search")},t().createElement("i",{className:"fa fa-search"})),t().createElement("button",{onClick:this.onClearClick,className:"btn btn-default",title:l().translate("general.clear")},t().createElement("i",{className:"fa fa-times"}))))))}}o.defaultProps={preventEvents:!1,onChange:null},o.propTypes={preventEvents:i().bool,onChange:i().func};const u=o})(),r})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={3932:(e,t,a)=>{var r=a(8213),n=a.n(r),l=a(3838),s=a.n(l),i=a(6689),o=a.n(i),u=a(580),c=a.n(u),d=a(418),m=a(1833),h=a(401),p=a(7027),b=a(2230),g=a(1995);const v=require("react-final-form");var f=a(6793);const y="CheckBox",_="RadioButton";a(6471);const E=["input","meta","question","className","isDisabled","isRequired"],C=["input","meta","question","isDisabled","isRequired"],q=["input","meta","question","isDisabled","isRequired"],w=["input","meta","question","isDisabled","isRequired","maxValues"],N=e=>{let{input:t,meta:a,question:r,className:l,isDisabled:i,isRequired:u}=e,c=s()(e,E);return o().createElement(m.default,n()({},t,c,{containerClassName:l,name:(0,f.toSlug)(r.name),ariaLabelledBy:`${(0,f.toSlug)(r.name)} label`,id:(0,f.toSlug)(r.name),value:t.value,disabled:i,required:u,onChange:t.onChange,placeholder:r.placeholder}))},S=e=>{let{input:t,meta:a,question:r,isDisabled:l,isRequired:i}=e,u=s()(e,C);return o().createElement(p.default,n()({},t,u,{name:(0,f.toSlug)(r.name),ariaLabelledBy:`${(0,f.toSlug)(r.name)} label`,id:(0,f.toSlug)(r.name),overrideCSS:!0,value:t.value,disabled:l,required:i,onChange:t.onChange}))},k=e=>{let{input:t,meta:a,question:r,isDisabled:l,isRequired:i}=e,u=s()(e,q);return o().createElement(h.default,n()({},t,u,{name:(0,f.toSlug)(r.name),ariaLabelledBy:`${(0,f.toSlug)(r.name)} label`,id:(0,f.toSlug)(r.name),overrideCSS:!0,className:"ddl-extra-questions-container",classNamePrefix:"ddl-extra-questions",value:t.value,disabled:l,required:i,onChange:t.onChange}))},x=e=>{let{input:t,meta:a,question:r,isDisabled:l,isRequired:i,maxValues:u}=e,c=s()(e,w);return o().createElement(b.default,n()({},t,c,{id:(0,f.toSlug)(r.name),name:(0,f.toSlug)(r.name),ariaLabelledBy:`${(0,f.toSlug)(r.name)} label`,value:t.value,disabled:l,required:i,onChange:e=>{const a=e.target.value;return u>0&&a.length>u?null:t.onChange(e)}}))},O=e=>e?e=>e?void 0:"Required":()=>{},P=o().forwardRef((({extraQuestions:e,userAnswers:t,onAnswerChanges:a,className:r="questions-form",questionContainerClassName:n="question-container",questionLabelContainerClassName:l="question-label-container",questionControlContainerClassName:s="question-control-container",readOnly:u=!1,debug:c=!1,buttonText:m="Submit",RequiredErrorMessage:h="Required",ValidationErrorClassName:p="extra-question-error",allowExtraQuestionsEdit:b=!0,onError:E=(e=>console.log("form errors: ",e)),shouldScroll2FirstError:C=!0},q)=>{let w=null;const P=(0,i.useRef)({}),L=(0,i.useRef)(null),[B,F]=(0,i.useState)({});(0,i.useEffect)((()=>{$()}),[e]),(0,i.useImperativeHandle)(q,(()=>({doSubmit(){L.current.dispatchEvent(new Event("submit",{cancelable:!0,bubbles:!0}))},scroll2QuestionById(e){if(P.current.hasOwnProperty(e)){const t=P.current[e];t.focus(),t.scrollIntoView({behavior:"smooth",block:"center"})}}})));const $=()=>{const a=new g.default(e,t);F(a.formatAnswers())},j=({when:e,rule:t,children:a})=>o().createElement(v.Field,{name:e,subscription:{value:!0}},(({input:{value:e}})=>D(t,A(e,t),a))),R=({name:e})=>o().createElement(v.Field,{name:e,subscription:{error:!0,touched:!0}},(({meta:{error:e,touched:t}})=>e&&t?o().createElement("div",{className:p},e):null)),A=(e,t)=>{let a=t.answer_values;if(Array.isArray(e)){if(!e.length)return!1;let r="And"===t.answer_values_operator;return a.forEach((a=>{r="And"===t.answer_values_operator?r&&e.includes(parseInt(a)):r||e.includes(parseInt(a))})),r}return a.includes(e.toString())},D=(e,t,a)=>"Visible"===e.visibility?"Equal"===e.visibility_condition?t?a:(delete P.current[e.sub_question.id],null):t?(delete P.current[e.sub_question.id],null):a:"Equal"===e.visibility_condition?t?(delete P.current[e.sub_question.id],null):a:t?a:(delete P.current[e.sub_question.id],null),V=e=>{const t=String.fromCharCode(160),a=document.createElement("div");a.innerHTML=e.label;const r=a.innerText||a.textContent||"",n=[y,_],l=e.mandatory&&!n.includes(e.type)?`${r}${t}<b>*</b>`:r;return`<label id="${(0,f.toSlug)(e.name)} label" htmlFor="${(0,f.toSlug)(e.name)}">${l}</label>`},I=e=>{let t=e.values;const a=!b&&((e,t)=>{const a=(0,f.toSlug)(e.name);if(!t.hasOwnProperty(a))return!1;const r=t[a];return Array.isArray(r)||"string"==typeof r?r.length>0:"number"==typeof r?r>0:"boolean"==typeof r&&r})(e,B);var r,u,c,m;if("Text"===e.type)return o().createElement(i.Fragment,{key:(0,f.toSlug)(e.name)},o().createElement("div",{ref:t=>P.current[e.id]=t,className:n},o().createElement(d.default,{replaceNewLine:!0,className:l},V(e)),o().createElement("div",{className:s},o().createElement(v.Field,{name:(0,f.toSlug)(e.name),question:e,isDisabled:a,isRequired:e.mandatory,validate:O(e.mandatory),component:N}),o().createElement(R,{name:(0,f.toSlug)(e.name)}))),(null===(r=e.sub_question_rules)||void 0===r?void 0:r.length)>0&&e.sub_question_rules.map((t=>o().createElement(j,{key:t.id,when:(0,f.toSlug)(e.name),rule:t},I(t.sub_question)))));if("TextArea"===e.type)return o().createElement(i.Fragment,{key:(0,f.toSlug)(e.name)},o().createElement("div",{ref:t=>P.current[e.id]=t,className:n},o().createElement(d.default,{replaceNewLine:!0,className:l},V(e)),o().createElement("div",{className:s},o().createElement(v.Field,{validate:O(e.mandatory),name:(0,f.toSlug)(e.name),id:(0,f.toSlug)(e.name),disabled:a,required:e.mandatory,component:"textarea"}),o().createElement(R,{name:(0,f.toSlug)(e.name)}))),(null===(u=e.sub_question_rules)||void 0===u?void 0:u.length)>0&&e.sub_question_rules.map((t=>o().createElement(j,{key:t.id,when:(0,f.toSlug)(e.name),rule:t},I(t.sub_question)))));if(e.type===y)return o().createElement(i.Fragment,{key:(0,f.toSlug)(e.name)},o().createElement("div",{ref:t=>P.current[e.id]=t,className:`${n} checkbox-wrapper`},o().createElement("div",{className:`${s} input-wrapper`},o().createElement("div",{className:"form-check abc-checkbox"},o().createElement(v.Field,{name:(0,f.toSlug)(e.name),id:(0,f.toSlug)(e.name),validate:O(e.mandatory),disabled:a,required:e.mandatory,type:"checkbox",className:"form-check-input",component:"input"}),o().createElement("label",{className:"form-check-label",htmlFor:(0,f.toSlug)(e.name)}),e.mandatory&&o().createElement("span",{className:"checkbox-mandatory"},o().createElement("b",null,"*")))),o().createElement(d.default,{replaceNewLine:!0,className:`eq-checkbox-label ${l}`},V(e))),o().createElement(R,{name:(0,f.toSlug)(e.name)}),(null===(c=e.sub_question_rules)||void 0===c?void 0:c.length)>0&&e.sub_question_rules.map((t=>o().createElement(j,{key:t.id,when:(0,f.toSlug)(e.name),rule:t},I(t.sub_question)))));if(e.type===_)return o().createElement(i.Fragment,{key:(0,f.toSlug)(e.name)},o().createElement("div",{ref:t=>P.current[e.id]=t,className:`${n} checkbox-wrapper`},o().createElement("div",{className:`${s} input-wrapper`},o().createElement("div",{className:"form-check abc-radio"},o().createElement(v.Field,{name:(0,f.toSlug)(e.name),id:(0,f.toSlug)(e.name),validate:O(e.mandatory),disabled:a,required:e.mandatory,type:"radio",className:"form-check-input",value:"true",component:"input"}),o().createElement("label",{className:"form-check-label",htmlFor:(0,f.toSlug)(e.name)}),e.mandatory&&o().createElement("span",{className:"checkbox-mandatory"},o().createElement("b",null,"*")))),o().createElement(d.default,{replaceNewLine:!0,className:`eq-checkbox-label ${l}`},V(e))),o().createElement(R,{name:(0,f.toSlug)(e.name)}),(null===(m=e.sub_question_rules)||void 0===m?void 0:m.length)>0&&e.sub_question_rules.map((t=>o().createElement(j,{key:t.id,when:(0,f.toSlug)(e.name),rule:t},I(t.sub_question)))));if("RadioButtonList"===e.type){var h;const r=t.map((e=>({label:e.label,value:e.id})));return o().createElement(i.Fragment,{key:(0,f.toSlug)(e.name)},o().createElement("div",{key:(0,f.toSlug)(e.name),ref:t=>P.current[e.id]=t,className:n},o().createElement(d.default,{replaceNewLine:!0,className:l},V(e)),o().createElement("div",{className:s},o().createElement(v.Field,{name:(0,f.toSlug)(e.name),options:r,question:e,validate:O(e.mandatory),isDisabled:a,isRequired:e.mandatory,component:S}),o().createElement(R,{name:(0,f.toSlug)(e.name)}))),(null===(h=e.sub_question_rules)||void 0===h?void 0:h.length)>0&&e.sub_question_rules.map((t=>o().createElement(j,{key:t.id,when:(0,f.toSlug)(e.name),rule:t},I(t.sub_question)))))}if("ComboBox"===e.type||"CountryComboBox"===e.type){var p;const r=t.map((e=>({label:e.label,value:e.id})));return o().createElement(i.Fragment,{key:(0,f.toSlug)(e.name)},o().createElement("div",{ref:t=>P.current[e.id]=t,className:n},o().createElement(d.default,{replaceNewLine:!0,className:l},V(e)),o().createElement("div",{className:`${s} reactSelectDropdown`},o().createElement(v.Field,{name:(0,f.toSlug)(e.name),options:r,question:e,validate:O(e.mandatory),isDisabled:a,isRequired:e.mandatory,component:k}),o().createElement(R,{name:(0,f.toSlug)(e.name)}))),(null===(p=e.sub_question_rules)||void 0===p?void 0:p.length)>0&&e.sub_question_rules.map((t=>o().createElement(j,{key:t.id,when:(0,f.toSlug)(e.name),rule:t},I(t.sub_question)))))}if("CheckBoxList"===e.type){var g;const r=t.map((e=>({label:e.label,value:e.id})));return o().createElement(i.Fragment,{key:(0,f.toSlug)(e.name)},o().createElement("div",{ref:t=>P.current[e.id]=t,className:n},o().createElement(d.default,{replaceNewLine:!0,className:l},V(e)),o().createElement("div",{className:s},o().createElement(v.Field,{name:(0,f.toSlug)(e.name),className:s,validate:O(e.mandatory),options:r,question:e,maxValues:e.max_selected_values,isDisabled:a,isRequired:e.mandatory,component:x}),o().createElement(R,{name:(0,f.toSlug)(e.name)}))),(null===(g=e.sub_question_rules)||void 0===g?void 0:g.length)>0&&e.sub_question_rules.map((t=>o().createElement(j,{key:t.id,when:(0,f.toSlug)(e.name),rule:t},I(t.sub_question)))))}return null},Q=(e,t,a)=>{var r;if(e.mandatory&&(e=>!!P.current[e.id])(e)){const r=(0,f.toSlug)(e.name);t.hasOwnProperty((0,f.toSlug)(r))&&""!==t[(0,f.toSlug)(r)]&&0!==t[r].length||(a[r]=h)}null===(r=e.sub_question_rules)||void 0===r||r.forEach((e=>{Q(e.sub_question,t,a)}))};if(!Object.keys(B).length)return null;const T=(e,t,a)=>{var r;t.includes((0,f.toSlug)(e.name))&&a.push(e),null===(r=e.sub_question_rules)||void 0===r||r.forEach((e=>{T(e.sub_question,t,a)}))},M=t=>{const a=[];return e.forEach((e=>{T(e,t,a)})),a.sort(((e,t)=>e.order>t.order))[0]};return Object.keys(B).length?o().createElement("div",{className:r},o().createElement(v.Form,{validate:t=>{const a={};return e.forEach((e=>{Q(e,t,a)})),a},onSubmit:e=>{a(e)},initialValues:B},(({handleSubmit:t,form:a,submitting:r,pristine:n,values:l})=>(w=t,o().createElement("form",{onSubmit:e=>{const r=a.getRegisteredFields().filter((e=>a.getFieldState(e).invalid));if(r.length>0){const e=M(r);E(r,P.current[e.id],e.id),C&&(e=>{const t=M(e);P.current[t.id].scrollIntoView({behavior:"smooth",block:"center"})})(r)}t(e)},ref:L},u?o().createElement("fieldset",{disabled:"disabled"},e.map((e=>I(e)))):e.map((e=>I(e))),c&&o().createElement("pre",null,JSON.stringify(l,0,2)))))),!q&&o().createElement("button",{type:"submit",onClick:e=>{w(e)},style:{marginTop:10}},m)):null}));P.propTypes={extraQuestions:c().array.isRequired,userAnswers:c().array.isRequired,onAnswerChanges:c().func.isRequired,className:c().string,debug:c().bool,buttonText:c().string,questionContainerClassName:c().string,questionLabelContainerClassName:c().string,questionControlContainerClassName:c().string,RequiredErrorMessage:c().string,ValidationErrorClassName:c().string,allowExtraQuestionsEdit:c().bool,shouldScroll2FirstError:c().bool,readOnly:c().bool}},2230:(e,t,a)=>{a.d(t,{default:()=>h});var r=a(3838),n=a.n(r),l=a(580),s=a.n(l),i=a(6689),o=a.n(i),u=a(4656),c=a.n(u),d=a(418);a(6471);const m=["onChange","value","className","options","id","children","error","disabled","name","ariaLabelledBy"];class h extends o().Component{constructor(e){super(e);let t=!!e.value&&e.value.find((t=>!e.options.map((e=>e.value)).includes(t)));this.state={otherChecked:!!t},this.handleChange=this.handleChange.bind(this),this.handleOtherCBChange=this.handleOtherCBChange.bind(this)}handleChange(e){let t=this.props.options.map((e=>e.value)),a=this.props.value?[...this.props.value]:[];if("checkbox"===e.target.type)if(e.target.checked){const t=isNaN(e.target.value)?e.target.value:parseInt(e.target.value);a.push(t)}else a=a.filter((t=>t!=e.target.value));else a=a.filter((e=>t.includes(e))),a.push(e.target.value);let r={target:{id:this.props.id,value:a,type:"checkboxlist"}};this.props.onChange(r)}handleOtherCBChange(e){this.setState({otherChecked:e.target.checked})}render(){let e,t=this.props,{onChange:a,value:r,className:l,options:s,id:i,children:u,error:h,disabled:p,name:b,ariaLabelledBy:g}=t,{otherChecked:v}=(n()(t,m),this.state),f=this.props.hasOwnProperty("inline"),y=this.props.hasOwnProperty("allowOther"),_=!!r&&r.find((e=>!s.map((e=>e.value)).includes(e))),E=this.props.hasOwnProperty("error")&&""!==h,C=this.props.hasOwnProperty("disabled")&&1==p;return e=f?{paddingLeft:"22px",marginLeft:"20px",float:"left"}:{paddingLeft:"22px",marginTop:"7px"},o().createElement("div",{id:`chl_wrapper_${i}`,"aria-labelledby":g},o().createElement("div",{className:"checkboxes-div"+(E?" error":"")},s.map((t=>{let a=!!r&&r.includes(t.value);return o().createElement("div",{className:"form-check abc-checkbox",key:"radio_key_"+t.value,style:e},o().createElement("input",{type:"checkbox",id:`cb_${i}_${t.value}`,name:b||i,checked:a,disabled:C,onChange:this.handleChange,className:"form-check-input",value:t.value}),o().createElement("label",{className:"form-check-label",htmlFor:`cb_${i}_${t.value}`},o().createElement(d.default,null,t.label)))})),y&&o().createElement("div",{className:"form-check abc-checkbox",style:e},o().createElement("input",{type:"checkbox",id:"cb_other"+i,checked:v,disabled:C,onChange:this.handleOtherCBChange,className:"form-check-input",value:"other"}),o().createElement("label",{className:"form-check-label",htmlFor:"cb_other"+i},c().translate("general.other"))),y&&v&&o().createElement("div",{style:{paddingLeft:"22px",width:"50%"}},o().createElement("input",{className:"form-control",disabled:C,onChange:this.handleChange,value:_}))),E&&o().createElement("p",{className:"error-label"},h))}}h.defaultProps={ariaLabelledBy:null},h.propTypes={id:s().string.isRequired}},401:(e,t,a)=>{a.d(t,{default:()=>g});var r=a(8213),n=a.n(r),l=a(8779),s=a.n(l),i=a(3838),o=a.n(i),u=a(6689),c=a.n(u),d=a(1929),m=a.n(d);const h=["onChange","value","className","error","clearable","disabled","overrideCSS","ariaLabelledBy"];function p(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function b(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?p(Object(a),!0).forEach((function(t){s()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):p(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}class g extends c().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}handleChange(e){let t=null;t=this.props.isMulti?e?e.map((e=>e.value)):null:e?e.value:null;let a={target:{id:this.props.id,value:t,type:"dropdown"}};this.props.onChange(a)}render(){let e=this.props,{onChange:t,value:a,className:r,error:l,clearable:s,disabled:i,overrideCSS:u,ariaLabelledBy:d}=e,p=o()(e,h),g=this.props.hasOwnProperty("error")&&""!=l,v=this.props.hasOwnProperty("clearable"),f=this.props.hasOwnProperty("disabled")&&1==i,y=null,_=r;this.props.hasOwnProperty("overrideCSS")&&0!=u||(_="dropdown "+r+" "+(g?"error":"")),y=this.props.isMulti?this.props.options.filter((e=>a.includes(e.value))):a instanceof Object||null==a?a:this.props.options.find((e=>e.value==a));const E={menu:e=>b(b({},e),{},{zIndex:999})};return c().createElement("div",null,c().createElement(m(),n()({className:_,value:y,onChange:this.handleChange,isClearable:v,isDisabled:f,styles:E,"aria-labelledby":d,formatOptionLabel:e=>c().createElement("span",{dangerouslySetInnerHTML:{__html:e.label}})},p)),g&&c().createElement("p",{className:"error-label"},l))}}g.defaultProps={ariaLabelledBy:null}},7027:(e,t,a)=>{a.d(t,{default:()=>d});var r=a(3838),n=a.n(r),l=a(6689),s=a.n(l),i=a(418),o=a(580),u=a.n(o);a(6471);const c=["onChange","value","className","error","ariaLabelledBy","disabled","options","id","name"];class d extends s().Component{constructor(e){super(e),this.state={value:e.value},this.handleChange=this.handleChange.bind(this)}handleChange(e){let t={target:{id:this.props.id,value:e.target.value,type:"radio"}};this.props.onChange(t)}getLabel(e,t,a,r){return a?s().createElement("label",{className:"form-check-label",htmlFor:`radio_${t}_${e.value}`,style:{display:"inline-block"}},s().createElement(i.default,null,e.label)):r?s().createElement("label",{className:"form-check-label",htmlFor:`radio_${t}_${e.value}`},e.label):s().createElement("label",{className:"form-check-label",htmlFor:`radio_${t}_${e.value}`,style:{display:"inline-block"}},s().createElement("h4",{style:{marginTop:"0px"}},e.label),s().createElement(i.default,null,e.description))}render(){let e,t=this.props,{onChange:a,value:r,className:l,error:i,ariaLabelledBy:o,disabled:u,options:d,id:m,name:h}=t,p=(n()(t,c),this.props.hasOwnProperty("error")&&""!=i),b=this.props.hasOwnProperty("inline"),g=this.props.hasOwnProperty("simple"),v=this.props.hasOwnProperty("disabled")&&1==u;return e=b?{paddingLeft:"22px",marginLeft:"20px",float:"left"}:{paddingLeft:"22px"},s().createElement("div",{id:`rl_wrapper_${m}`,"aria-labelledby":o},d.map((t=>{let a=t.value==r;return s().createElement("div",{className:"form-check abc-radio",key:`radio_key_${m}_${t.value}`,style:e},s().createElement("input",{className:"form-check-input",type:"radio",id:`radio_${m}_${t.value}`,value:t.value,checked:a,onChange:this.handleChange,disabled:v,name:h||`radio_${m}`}),this.getLabel(t,m,b,g))})),p&&s().createElement("p",{className:"error-label"},i))}}d.defaultProps={ariaLabelledBy:null},d.propTypes={id:u().string.isRequired}},1833:(e,t,a)=>{a.d(t,{default:()=>c});var r=a(8213),n=a.n(r),l=a(3838),s=a.n(l),i=a(6689),o=a.n(i);const u=["onChange","value","className","error","ariaLabelledBy","containerClassName"];class c extends o().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}componentDidUpdate(e,t,a){this.props.value!==e.value&&(this.input.value=this.props.value)}handleChange(e){this.props.onChange(e)}render(){let e=this.props,{onChange:t,value:a,className:r,error:l,ariaLabelledBy:i,containerClassName:c}=e,d=s()(e,u),m=this.props.hasOwnProperty("error")&&""!==l,h=this.props.hasOwnProperty("className")?r:"form-control",p=this.props.hasOwnProperty("containerClassName")?c:"container-form-control";return o().createElement("div",{className:p},o().createElement("input",n()({className:`${h} ${m?"error":""}`,ref:e=>{this.input=e},defaultValue:a,"aria-labelledby":i,onChange:this.handleChange},d)),m&&o().createElement("p",{className:"error-label"},l))}}c.defaultProps={ariaLabelledBy:null}},418:(e,t,a)=>{a.d(t,{default:()=>c});var r=a(8213),n=a.n(r),l=a(3838),s=a.n(l),i=a(6689),o=a.n(i);const u=["children","replaceNewLine","className"],c=e=>{let{children:t,replaceNewLine:a=!1,className:r=""}=e,l=s()(e,u);return o().createElement("span",n()({className:r,dangerouslySetInnerHTML:{__html:a?null==t?void 0:t.replace(/\n/g,"<br />"):t}},l))}},6793:(e,t,a)=>{a.d(t,{toSlug:()=>r});a(8362),a(6530);const r=e=>(e=e.toLowerCase()).replace(/[^a-zA-Z0-9]+/g,"_")},1995:(e,t,a)=>{a.d(t,{default:()=>p});var r=a(8779),n=a.n(r),l=a(6793);function s(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function i(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?s(Object(a),!0).forEach((function(t){n()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):s(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}const o="ComboBox",u="CheckBoxList",c="RadioButtonList",d=[o,u,c],m="And",h="Equal";class p{constructor(e,t=[]){n()(this,"_parseQuestion",(e=>{if(this.questionByName[(0,l.toSlug)(e.name)]=e,this.questionById[parseInt(e.id)]=e,e.hasOwnProperty("sub_question_rules"))for(let t of e.sub_question_rules)this.rules[parseInt(t.id)]=t,this._parseQuestion(t.sub_question)})),n()(this,"_parseQuestions",(()=>{for(let e of this.questions)this._parseQuestion(e)})),n()(this,"_allowsValues",(e=>d.includes(e.type))),n()(this,"_allowsValue",((e,t)=>{let a=t.value.split(",").map((e=>parseInt(e)));for(let t of a)if(!e.values.map((e=>e.id)).includes(t))return!1;return!0})),n()(this,"_getAnswerFor",(e=>{let t=Number.isInteger(e)?e:e.id,a=this.answers[t]||null;return a||null})),n()(this,"_hasValue",(e=>""!==e.value)),n()(this,"_answerContains",((e,t)=>e.value.split(",").includes(t))),n()(this,"_isSubQuestionVisible",(e=>{let t=e.answer_values_operator===m;const a=this._getAnswerFor(e.parent_question_id);if(a)switch(e.visibility_condition){case h:for(let r of e.answer_values)t=e.answer_values_operator===m?t&&this._answerContains(a,r):t||this._answerContains(a,r);break;case"NotEqual":for(let r of e.answer_values)t=e.answer_values_operator===m?t&&!this._answerContains(a,r):t||!this._answerContains(a,r)}else t=e.visibility_condition!==h;return"Visible"===e.visibility?t:!t})),n()(this,"_isAnswered",(e=>{const t=this._getAnswerFor(e);if("MainQuestion"===e.class)return!e.mandatory||!!t&&(!!this._hasValue(t)&&!(this._allowsValues(e)&&!this._allowsValue(e,t)));for(let a of e.parent_rules)if(this._isSubQuestionVisible(this.rules[a]))return!e.mandatory||!!t&&(!!this._hasValue(t)&&!(this._allowsValues(e)&&!this._allowsValue(e,t)));return!0})),n()(this,"_checkQuestion",(e=>{let t=this._isAnswered(e);if(e.hasOwnProperty("sub_question_rules"))for(let a of e.sub_question_rules)t=t&&this._checkQuestion(a.sub_question);return t})),n()(this,"_formatQuestionAnswer",(e=>{var t,a;let r={};const n=(0,l.toSlug)(e.name);let s=null===(t=this.originalAnswers.find((t=>t.question_id===e.id)))||void 0===t?void 0:t.value;if(!s&&(null==e||null===(a=e.values)||void 0===a?void 0:a.length)>0){const t=e.values.find((e=>e.is_default));t&&(s=t.id.toString())}if(s&&("CheckBox"===e.type&&(s="false"!==s&&!!s),e.type!==c&&e.type!==o||(s=parseInt(s)),e.type===u&&(s=s.split(",").map((e=>parseInt(e)))||[])),r[n]=s||"",e.type===u&&""===r[n]&&(r[n]=[]),e.hasOwnProperty("sub_question_rules"))for(let t of e.sub_question_rules){let e=this._formatQuestionAnswer(t.sub_question);r=i(i({},r),e)}return r})),n()(this,"formatAnswers",(()=>{let e={};return this.questions.forEach((t=>{let a=this._formatQuestionAnswer(t);e=i(i({},e),a)})),e})),n()(this,"completed",(()=>{let e=!0;for(let t of this.questions)e=e&&this._checkQuestion(t);return e})),n()(this,"getQuestionByName",(e=>{const t=(0,l.toSlug)(e);return this.questionByName[e]||this.questionByName[t]||null})),n()(this,"getQuestionById",(e=>this.questionById[parseInt(e)]||null)),this.questions=e,this.originalAnswers=t,this.answers=[];for(let e of this.originalAnswers)this.answers[e.question_id]=e;this.questionByName={},this.questionById={},this.rules={},this._parseQuestions()}}},8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},6471:e=>{e.exports=require("awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},8362:e=>{e.exports=require("moment-timezone")},580:e=>{e.exports=require("prop-types")},6689:e=>{e.exports=require("react")},1929:e=>{e.exports=require("react-select")},6530:e=>{e.exports=require("urijs")}},t={};function a(r){var n=t[r];if(void 0!==n)return n.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,a),l.exports}(()=>{a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t}})(),(()=>{a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{a.r(r),a.d(r,{default:()=>u});var e=a(6689),t=a.n(e),n=a(4656),l=a.n(n),s=(a(3932),a(580)),i=a.n(s);class o extends t().Component{constructor(e){super(e),this.onSearchClick=this.onSearchClick.bind(this),this.onClearClick=this.onClearClick.bind(this),this.onKeyPressed=this.onKeyPressed.bind(this),this.onChange=this.onChange.bind(this),this.state={value:e.value}}onSearchClick(e){let{preventEvents:t}=this.props;t&&e.preventDefault(),this.doFiltering(this.state.value)}onClearClick(e){let{preventEvents:t}=this.props;t&&e.preventDefault(),this.doFiltering(""),this.setState({value:""})}doFiltering(e){this.props.onSearch(e.trim())}onKeyPressed(e){13===(e.keyCode||e.which)&&this.doFiltering(this.state.value)}onChange(e){this.setState({value:e.target.value}),this.props.onChange&&this.props.onChange(e.target.value)}render(){let{value:e}=this.state;return t().createElement("div",{className:"row search-container"},t().createElement("div",{className:"col-md-12"},t().createElement("div",{className:"input-group"},t().createElement("input",{type:"text",value:e,className:"form-control",placeholder:this.props.placeholder,onKeyPress:this.onKeyPressed,onChange:this.onChange}),t().createElement("span",{className:"input-group-btn",style:{width:"5%"}},t().createElement("button",{onClick:this.onSearchClick,className:"btn btn-default",title:l().translate("general.search")},t().createElement("i",{className:"fa fa-search"})),t().createElement("button",{onClick:this.onClearClick,className:"btn btn-default",title:l().translate("general.clear")},t().createElement("i",{className:"fa fa-times"}))))))}}o.defaultProps={preventEvents:!1,onChange:null},o.propTypes={preventEvents:i().bool,onChange:i().func};const u=o})(),r})()));
|
|
2
2
|
//# sourceMappingURL=free-text-search.js.map
|