openstack-uicore-foundation 4.1.44 → 4.1.46
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/checkbox-list.js +1 -1
- package/lib/components/inputs/checkbox-list.js.map +1 -1
- package/lib/components/inputs/country-dropdown.js +1 -1
- package/lib/components/inputs/country-dropdown.js.map +1 -1
- package/lib/components/inputs/dropdown.js +1 -1
- package/lib/components/inputs/dropdown.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 +2 -1
- package/lib/css/components/index.css.map +1 -1
- package/package.json +1 -1
|
@@ -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={418:(e,t,a)=>{a.d(t,{default:()=>
|
|
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={418:(e,t,a)=>{a.d(t,{default:()=>o});var r=a(6689),l=a.n(r);const o=({children:e,replaceNewLine:t=!1,className:a=""})=>l().createElement("span",{className:a,dangerouslySetInnerHTML:{__html:t?null==e?void 0:e.replace(/\n/g,"<br />"):e}})},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")},580:e=>{e.exports=require("prop-types")},6689:e=>{e.exports=require("react")}},t={};function a(r){var l=t[r];if(void 0!==l)return l.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,a),o.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:()=>d});var e=a(3838),t=a.n(e),l=a(580),o=a.n(l),n=a(6689),s=a.n(n),i=a(4656),c=a.n(i),p=a(418);a(6471);const h=["onChange","value","className","options","id","children","error","disabled","name","ariaLabelledBy"];class d extends s().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,a=this.props,{onChange:r,value:l,className:o,options:n,id:i,children:d,error:u,disabled:m,name:b,ariaLabelledBy:f}=a,{otherChecked:v}=(t()(a,h),this.state),g=this.props.hasOwnProperty("inline"),y=this.props.hasOwnProperty("html"),x=this.props.hasOwnProperty("allowOther"),k=!!l&&l.find((e=>!n.map((e=>e.value)).includes(e))),C=this.props.hasOwnProperty("error")&&""!==u,N=this.props.hasOwnProperty("disabled")&&1==m;return e=g?{paddingLeft:"22px",marginLeft:"20px",float:"left"}:{paddingLeft:"22px",marginTop:"7px"},s().createElement("div",{id:`chl_wrapper_${i}`,"aria-labelledby":f},s().createElement("div",{className:"checkboxes-div"+(C?" error":"")},n.map((t=>{let a=!!l&&l.includes(t.value);return s().createElement("div",{className:"form-check abc-checkbox",key:"radio_key_"+t.value,style:e},s().createElement("input",{type:"checkbox",id:`cb_${i}_${t.value}`,name:b||i,checked:a,disabled:N,onChange:this.handleChange,className:"form-check-input",value:t.value}),s().createElement("label",{className:"form-check-label",htmlFor:`cb_${i}_${t.value}`},y&&s().createElement(p.default,null,t.label),!y&&t.label))})),x&&s().createElement("div",{className:"form-check abc-checkbox",style:e},s().createElement("input",{type:"checkbox",id:"cb_other"+i,checked:v,disabled:N,onChange:this.handleOtherCBChange,className:"form-check-input",value:"other"}),s().createElement("label",{className:"form-check-label",htmlFor:"cb_other"+i},c().translate("general.other"))),x&&v&&s().createElement("div",{style:{paddingLeft:"22px",width:"50%"}},s().createElement("input",{className:"form-control",disabled:N,onChange:this.handleChange,value:k}))),C&&s().createElement("p",{className:"error-label"},u))}}d.defaultProps={ariaLabelledBy:null},d.propTypes={id:o().string.isRequired}})(),r})()));
|
|
2
2
|
//# sourceMappingURL=checkbox-list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/inputs/checkbox-list.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,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AAU,mBAAmB+B,MAAM,UAC9E,2BAAO/B,UAAU,mBAAmB8E,QAAS,WAAalB,GACrDoB,IAAAA,UAAY,mBAKpBT,GAAc1B,GACf,yBAAKmB,MAAO,CAACU,YAAa,OAAQO,MAAO,QACrC,2BAAOjF,UAAU,eAAekE,SAAUO,EAAYZ,SAAUhE,KAAKiD,aAAcf,MAAOM,MAKjGmC,GACD,uBAAGxE,UAAU,eAAeiE,GAKvC,EAGLjC,EAAakD,aAAe,CACxBd,eAAiB,MAIrBpC,EAAamD,UAAY,CACrBvB,GAAIwB,IAAAA,OAAAA,W","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/raw-html/index.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","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/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/inputs/checkbox-list.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 ","import React from 'react';\n\nconst RawHTML = ({children, replaceNewLine = false, className = \"\"}) =>\n <span className={className}\n dangerouslySetInnerHTML={{ __html: replaceNewLine ? children?.replace(/\\n/g, '<br />') : children}} />\n\nexport default RawHTML;","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"i18n-react/dist/i18n-react\");","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","// 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 **/\nimport PropTypes from 'prop-types'\nimport React from 'react';\nimport T from 'i18n-react/dist/i18n-react';\nimport RawHTML from '../raw-html';\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};"],"names":["root","factory","exports","module","define","amd","this","children","replaceNewLine","className","dangerouslySetInnerHTML","__html","replace","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","CheckboxList","React","constructor","props","super","otherValue","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","error","disabled","name","ariaLabelledBy","inline","html","allowOther","has_error","isDisabled","paddingLeft","marginLeft","float","marginTop","htmlFor","label","T","width","defa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T,GACF5B,EAAGqC,OAbf,IAoBHR,GACD,yBAAKvE,UAAU,0BAA0BgE,MAAOA,GAC5C,2BAAOZ,KAAK,WAAWQ,GAAI,WAAaA,EAAIP,QAASR,EAAcqB,SAAUO,EACtEZ,SAAUhE,KAAKmD,oBAAqBhD,UAAU,mBAAmB+B,MAAM,UAC9E,2BAAO/B,UAAU,mBAAmB8E,QAAS,WAAalB,GACrDoB,IAAAA,UAAY,mBAKpBT,GAAc1B,GACf,yBAAKmB,MAAO,CAACU,YAAa,OAAQO,MAAO,QACrC,2BAAOjF,UAAU,eAAekE,SAAUO,EAAYZ,SAAUhE,KAAKiD,aAAcf,MAAOM,MAKjGmC,GACD,uBAAGxE,UAAU,eAAeiE,GAKvC,EAGLjC,EAAakD,aAAe,CACxBd,eAAiB,MAIrBpC,EAAamD,UAAY,CACrBvB,GAAIwB,IAAAA,OAAAA,W","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/raw-html/index.js","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/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/inputs/checkbox-list.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 ","import React from 'react';\n\nconst RawHTML = ({children, replaceNewLine = false, className = \"\"}) =>\n <span className={className}\n dangerouslySetInnerHTML={{ __html: replaceNewLine ? children?.replace(/\\n/g, '<br />') : children}} />\n\nexport default RawHTML;","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\");","// 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 **/\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};"],"names":["root","factory","exports","module","define","amd","this","children","replaceNewLine","className","dangerouslySetInnerHTML","__html","replace","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","CheckboxList","React","constructor","props","super","otherValue","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","error","disabled","name","ariaLabelledBy","inline","html","allowOther","has_error","isDisabled","paddingLeft","marginLeft","float","marginTop","htmlFor","label","T","width","defaultProps","propTypes","PropTypes"],"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={401:(e,t,n)=>{n.d(t,{default:()=>_});var r=n(8213),a=n.n(r),o=n(8779),s=n.n(o),c=n(3838),l=n.n(c),i=n(6689),d=n.n(i),p=n(1929),u=n.n(p);const h=["onChange","value","className","error","clearable","disabled","overrideCSS","ariaLabelledBy"];function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}class _ extends d().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 n={target:{id:this.props.id,value:t,type:"dropdown"}};this.props.onChange(n)}render(){let e=this.props,{onChange:t,value:n,className:r,error:o,clearable:s,disabled:c,overrideCSS:i,ariaLabelledBy:p}=e,f=l()(e,h),_=this.props.hasOwnProperty("error")&&""!=o,m=this.props.hasOwnProperty("clearable"),E=this.props.hasOwnProperty("disabled")&&1==c,y=null,w=r;this.props.hasOwnProperty("overrideCSS")&&0!=i||(w="dropdown "+r+" "+(_?"error":"")),y=this.props.isMulti?this.props.options.filter((e=>n.includes(e.value))):n instanceof Object||null==n?n:this.props.options.find((e=>e.value==n));const g={menu:e=>R(R({},e),{},{zIndex:999})};return d().createElement("div",null,d().createElement(u(),a()({className:w,value:y,onChange:this.handleChange,isClearable:m,isDisabled:E,styles:g,"aria-labelledby":p},f)),_&&d().createElement("p",{className:"error-label"},o))}}_.defaultProps={ariaLabelledBy:null}},4341:(e,t,n)=>{n(8779),n(4656),n(4054),n(6793),n(8576)},1593:(e,t,n)=>{n.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>r,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>a,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const r="AUTH_ERROR_MISSING_AUTH_INFO",a="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>i});var r=n(6793);n(2691);const a=require("browser-tabs-lock");var o=n.n(a);n(6530),n(3856),n(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=n(1593);const Lock=new(o()),GET_TOKEN_SILENTLY_LOCK_KEY="openstackuicore.lock.getTokenSilently",c="code",l="authInfo",i=async()=>{if(await(0,r.retryPromise)((()=>Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY,6e3)),10))try{let e=u();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=R(),l=Math.floor(Date.now()/1e3);return n-=20,l-r>n||null==t?(console.log("getAccessToken access token expired"),(async(e,t)=>{if(e===c&&_()){if(!t)throw h(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await d(t),{access_token:n,expires_in:r,refresh_token:a}=e;return void 0===a&&(a=null),p(n,r,a),n}throw h(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)})(o,a)):t}finally{await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},d=async e=>{let t=m(),n=f();const a={grant_type:"refresh_token",client_id:encodeURI(n),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then((e=>{if(400===e.status){(0,r.getCurrentPathName)();throw(0,r.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:c,expires_in:l}=n;return{access_token:o,refresh_token:c,expires_in:l}}catch(e){throw console.log(e),e}},p=(e,t,n=null,a=null)=>{let o=u(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===n&&o&&(n=o.refreshToken),null===a&&o&&(a=o.idToken),n&&(s.refreshToken=n),a&&(s.idToken=a),(0,r.putOnLocalStorage)(l,JSON.stringify(s))},u=()=>{try{let e=(0,r.getFromLocalStorage)(l,!1);return e?JSON.parse(e):null}catch(e){return null}},h=()=>{"undefined"!=typeof window&&(0,r.removeFromLocalStorage)(l)},f=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,R=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",_=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),m=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,n)=>{n.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>l,fetchResponseHandler:()=>i});n(3838),n(2691),n(6530);var r=n(271),a=n.n(r),o=n(4656),s=n.n(o);n(6793),n(4341),n(8576);const c=e=>t=>({type:e,payload:t}),l=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,n=e.statusText;switch(t){case 403:a().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:a().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:a().fire("ERROR",n,"warning");case 500:a().fire("ERROR",s().translate("errors.server_error"),"error")}}),i=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,n)=>{n.d(t,{buildAPIBaseUrl:()=>a,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>i,setSessionClearingState:()=>l});n(8362),n(6530);const r=()=>"undefined"!=typeof window?window.location.pathname:null,a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),n}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},l=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},i=async(e,t=3)=>{for(let n=0;n<t;n++)if(await e())return!0;return!1}},9142:(e,t,n)=>{n.d(t,{getCountryList:()=>p});var r=n(4054),a=n(8576),o=n(6793),s=n(6517),c=n.n(s),l=n(6530),i=n.n(l);const d=500,p=(c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`full_name@@${e},first_name@@${e},last_name@@${e},email@@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name@@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name@@${t},first_name@@${t},last_name@@${t},email@@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1",l=encodeURIComponent(`tag@@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${l}&expand=tag,track_tag_group`:`/tags?filter=${l}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((t=>{let r=[...t.data];e&&(r=r.map((e=>e.tag))),n(r)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name@@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();let c=(t=(0,r.escapeFilterValue)(t))?encodeURIComponent(`filter=name@@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n=!1,s)=>{const c=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let l=`/api/v1/summits/${e}/events`+(n?"/published":""),i=encodeURIComponent(`title@@${t}`);fetch((0,o.buildAPIBaseUrl)(`${l}?filter=${i}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,a.getAccessToken)()}`;if(t=(0,r.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name@@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();let s=encodeURIComponent(`title@@${e},code@@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name@@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let c=i()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`company_name@@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name@@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name@@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),(e,t)=>fetch((0,o.buildAPIBaseUrl)("/api/public/v1/countries"),{signal:t}).then(r.fetchResponseHandler).then((t=>{e(t.data)})).catch(r.fetchErrorHandler));c().debounce((async(e,t={},n,s="v1",c=5)=>{const l=await(0,a.getAccessToken)();let d=i()(`/api/${s}/summits/${e}/ticket-types`);if(d.addQuery("access_token",l),d.addQuery("order","name"),d.addQuery("per_page",c),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);d.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);d.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(d.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)(),s=i()("/api/v1/sponsored-projects");s.addQuery("access_token",n),e&&(e=(0,r.escapeFilterValue)(e),s.addQuery("filter[]",`name@@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`code@@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d)},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")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},6517:e=>{e.exports=require("lodash")},8362:e=>{e.exports=require("moment-timezone")},6689:e=>{e.exports=require("react")},1929:e=>{e.exports=require("react-select")},2691:e=>{e.exports=require("superagent/lib/client")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{n.r(r),n.d(r,{default:()=>l});var e=n(8213),t=n.n(e),a=n(6689),o=n.n(a),s=n(401),c=n(9142);class l extends o().Component{constructor(e){super(e),this.state={options:[]},this.handleChange=this.handleChange.bind(this),this.setOptions=this.setOptions.bind(this),this.abortController=new AbortController}componentDidMount(){let{options:e}=this.state;0==e.length&&(0,c.getCountryList)(this.setOptions,this.abortController.signal)}componentWillUnmount(){this.abortController.abort()}handleChange(e){let t={target:{id:this.props.id,value:e,type:"countryddl"}};this.props.onChange(t)}setOptions(e){let t=e.map((e=>({label:e.name,value:e.iso_code})));this.setState({options:t})}render(){let{options:e}=this.state;return o().createElement(s.default,t()({options:e},this.props))}}})(),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={401:(e,t,n)=>{n.d(t,{default:()=>_});var r=n(8213),a=n.n(r),o=n(8779),s=n.n(o),c=n(3838),l=n.n(c),i=n(6689),d=n.n(i),p=n(1929),u=n.n(p);const h=["onChange","value","className","error","clearable","disabled","overrideCSS","ariaLabelledBy"];function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}class _ extends d().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 n={target:{id:this.props.id,value:t,type:"dropdown"}};this.props.onChange(n)}render(){let e=this.props,{onChange:t,value:n,className:r,error:o,clearable:s,disabled:c,overrideCSS:i,ariaLabelledBy:p}=e,f=l()(e,h),_=this.props.hasOwnProperty("error")&&""!=o,m=this.props.hasOwnProperty("clearable"),E=this.props.hasOwnProperty("disabled")&&1==c,y=null,b=r;this.props.hasOwnProperty("overrideCSS")&&0!=i||(b="dropdown "+r+" "+(_?"error":"")),y=this.props.isMulti?this.props.options.filter((e=>n.includes(e.value))):n instanceof Object||null==n?n:this.props.options.find((e=>e.value==n));const g={menu:e=>R(R({},e),{},{zIndex:999})};return d().createElement("div",null,d().createElement(u(),a()({className:b,value:y,onChange:this.handleChange,isClearable:m,isDisabled:E,styles:g,"aria-labelledby":p,formatOptionLabel:e=>d().createElement("span",{dangerouslySetInnerHTML:{__html:e.label}})},f)),_&&d().createElement("p",{className:"error-label"},o))}}_.defaultProps={ariaLabelledBy:null}},4341:(e,t,n)=>{n(8779),n(4656),n(4054),n(6793),n(8576)},1593:(e,t,n)=>{n.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>r,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>a,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const r="AUTH_ERROR_MISSING_AUTH_INFO",a="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>i});var r=n(6793);n(2691);const a=require("browser-tabs-lock");var o=n.n(a);n(6530),n(3856),n(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=n(1593);const Lock=new(o()),GET_TOKEN_SILENTLY_LOCK_KEY="openstackuicore.lock.getTokenSilently",c="code",l="authInfo",i=async()=>{if(await(0,r.retryPromise)((()=>Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY,6e3)),10))try{let e=u();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=R(),l=Math.floor(Date.now()/1e3);return n-=20,l-r>n||null==t?(console.log("getAccessToken access token expired"),(async(e,t)=>{if(e===c&&_()){if(!t)throw h(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await d(t),{access_token:n,expires_in:r,refresh_token:a}=e;return void 0===a&&(a=null),p(n,r,a),n}throw h(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)})(o,a)):t}finally{await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},d=async e=>{let t=m(),n=f();const a={grant_type:"refresh_token",client_id:encodeURI(n),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then((e=>{if(400===e.status){(0,r.getCurrentPathName)();throw(0,r.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:c,expires_in:l}=n;return{access_token:o,refresh_token:c,expires_in:l}}catch(e){throw console.log(e),e}},p=(e,t,n=null,a=null)=>{let o=u(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===n&&o&&(n=o.refreshToken),null===a&&o&&(a=o.idToken),n&&(s.refreshToken=n),a&&(s.idToken=a),(0,r.putOnLocalStorage)(l,JSON.stringify(s))},u=()=>{try{let e=(0,r.getFromLocalStorage)(l,!1);return e?JSON.parse(e):null}catch(e){return null}},h=()=>{"undefined"!=typeof window&&(0,r.removeFromLocalStorage)(l)},f=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,R=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",_=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),m=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,n)=>{n.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>l,fetchResponseHandler:()=>i});n(3838),n(2691),n(6530);var r=n(271),a=n.n(r),o=n(4656),s=n.n(o);n(6793),n(4341),n(8576);const c=e=>t=>({type:e,payload:t}),l=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,n=e.statusText;switch(t){case 403:a().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:a().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:a().fire("ERROR",n,"warning");case 500:a().fire("ERROR",s().translate("errors.server_error"),"error")}}),i=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,n)=>{n.d(t,{buildAPIBaseUrl:()=>a,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>i,setSessionClearingState:()=>l});n(8362),n(6530);const r=()=>"undefined"!=typeof window?window.location.pathname:null,a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),n}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},l=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},i=async(e,t=3)=>{for(let n=0;n<t;n++)if(await e())return!0;return!1}},9142:(e,t,n)=>{n.d(t,{getCountryList:()=>p});var r=n(4054),a=n(8576),o=n(6793),s=n(6517),c=n.n(s),l=n(6530),i=n.n(l);const d=500,p=(c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`full_name@@${e},first_name@@${e},last_name@@${e},email@@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name@@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name@@${t},first_name@@${t},last_name@@${t},email@@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1",l=encodeURIComponent(`tag@@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${l}&expand=tag,track_tag_group`:`/tags?filter=${l}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((t=>{let r=[...t.data];e&&(r=r.map((e=>e.tag))),n(r)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name@@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();let c=(t=(0,r.escapeFilterValue)(t))?encodeURIComponent(`filter=name@@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n=!1,s)=>{const c=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let l=`/api/v1/summits/${e}/events`+(n?"/published":""),i=encodeURIComponent(`title@@${t}`);fetch((0,o.buildAPIBaseUrl)(`${l}?filter=${i}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,a.getAccessToken)()}`;if(t=(0,r.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name@@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();let s=encodeURIComponent(`title@@${e},code@@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name@@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let c=i()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`company_name@@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name@@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name@@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),(e,t)=>fetch((0,o.buildAPIBaseUrl)("/api/public/v1/countries"),{signal:t}).then(r.fetchResponseHandler).then((t=>{e(t.data)})).catch(r.fetchErrorHandler));c().debounce((async(e,t={},n,s="v1",c=5)=>{const l=await(0,a.getAccessToken)();let d=i()(`/api/${s}/summits/${e}/ticket-types`);if(d.addQuery("access_token",l),d.addQuery("order","name"),d.addQuery("per_page",c),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);d.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);d.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(d.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)(),s=i()("/api/v1/sponsored-projects");s.addQuery("access_token",n),e&&(e=(0,r.escapeFilterValue)(e),s.addQuery("filter[]",`name@@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`code@@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d)},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")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},6517:e=>{e.exports=require("lodash")},8362:e=>{e.exports=require("moment-timezone")},6689:e=>{e.exports=require("react")},1929:e=>{e.exports=require("react-select")},2691:e=>{e.exports=require("superagent/lib/client")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{n.r(r),n.d(r,{default:()=>l});var e=n(8213),t=n.n(e),a=n(6689),o=n.n(a),s=n(401),c=n(9142);class l extends o().Component{constructor(e){super(e),this.state={options:[]},this.handleChange=this.handleChange.bind(this),this.setOptions=this.setOptions.bind(this),this.abortController=new AbortController}componentDidMount(){let{options:e}=this.state;0==e.length&&(0,c.getCountryList)(this.setOptions,this.abortController.signal)}componentWillUnmount(){this.abortController.abort()}handleChange(e){let t={target:{id:this.props.id,value:e,type:"countryddl"}};this.props.onChange(t)}setOptions(e){let t=e.map((e=>({label:e.name,value:e.iso_code})));this.setState({options:t})}render(){let{options:e}=this.state;return o().createElement(s.default,t()({options:e},this.props))}}})(),r})()));
|
|
2
2
|
//# sourceMappingURL=country-dropdown.js.map
|