openstack-uicore-foundation 4.2.26 → 5.0.1
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/.codegraph/config.json +140 -0
- package/lib/components/attendance-tracker.js +1 -1
- package/lib/components/attendance-tracker.js.map +1 -1
- package/lib/components/clock.js.map +1 -1
- package/lib/components/extra-questions.js.map +1 -1
- package/lib/components/forms/simple-form.js.map +1 -1
- package/lib/components/free-text-search.js.map +1 -1
- package/lib/components/google-map.js.map +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/index.js.map +1 -1
- package/lib/components/inputs/access-levels-input.js +1 -1
- package/lib/components/inputs/access-levels-input.js.map +1 -1
- package/lib/components/inputs/attendee-input.js +1 -1
- package/lib/components/inputs/attendee-input.js.map +1 -1
- package/lib/components/inputs/company-input-v2.js +1 -1
- package/lib/components/inputs/company-input-v2.js.map +1 -1
- package/lib/components/inputs/company-input.js +1 -1
- package/lib/components/inputs/company-input.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/country-input.js +1 -1
- package/lib/components/inputs/country-input.js.map +1 -1
- package/lib/components/inputs/event-input.js +1 -1
- package/lib/components/inputs/event-input.js.map +1 -1
- package/lib/components/inputs/group-input.js +1 -1
- package/lib/components/inputs/group-input.js.map +1 -1
- package/lib/components/inputs/language-input.js +1 -1
- package/lib/components/inputs/language-input.js.map +1 -1
- package/lib/components/inputs/member-input.js +1 -1
- package/lib/components/inputs/member-input.js.map +1 -1
- package/lib/components/inputs/organization-input.js +1 -1
- package/lib/components/inputs/organization-input.js.map +1 -1
- package/lib/components/inputs/promocode-input.js +1 -1
- package/lib/components/inputs/promocode-input.js.map +1 -1
- package/lib/components/inputs/registration-company-input.js +1 -1
- package/lib/components/inputs/registration-company-input.js.map +1 -1
- package/lib/components/inputs/speaker-input.js +1 -1
- package/lib/components/inputs/speaker-input.js.map +1 -1
- package/lib/components/inputs/sponsor-input.js +1 -1
- package/lib/components/inputs/sponsor-input.js.map +1 -1
- package/lib/components/inputs/summit-input.js +1 -1
- package/lib/components/inputs/summit-input.js.map +1 -1
- package/lib/components/inputs/tag-input.js +1 -1
- package/lib/components/inputs/tag-input.js.map +1 -1
- package/lib/components/inputs/ticket-types-input.js +1 -1
- package/lib/components/inputs/ticket-types-input.js.map +1 -1
- package/lib/components/inputs/upload-input-v2.js +1 -1
- package/lib/components/inputs/upload-input-v2.js.map +1 -1
- package/lib/components/inputs/upload-input-v3.js +1 -1
- package/lib/components/inputs/upload-input-v3.js.map +1 -1
- package/lib/components/mui/checkbox-list.js +2 -0
- package/lib/components/mui/checkbox-list.js.map +1 -0
- package/lib/components/mui/chip-list.js +2 -0
- package/lib/components/mui/chip-list.js.map +1 -0
- package/lib/components/mui/chip-notify.js +2 -0
- package/lib/components/mui/chip-notify.js.map +1 -0
- package/lib/components/mui/chip-select-input.js +2 -0
- package/lib/components/mui/chip-select-input.js.map +1 -0
- package/lib/components/mui/confirm-dialog.js +2 -0
- package/lib/components/mui/confirm-dialog.js.map +1 -0
- package/lib/components/mui/custom-alert.js +2 -0
- package/lib/components/mui/custom-alert.js.map +1 -0
- package/lib/components/mui/dnd-list.js +2 -0
- package/lib/components/mui/dnd-list.js.map +1 -0
- package/lib/components/mui/dropdown-checkbox.js +2 -0
- package/lib/components/mui/dropdown-checkbox.js.map +1 -0
- package/lib/components/mui/editable-table.js +2 -0
- package/lib/components/mui/editable-table.js.map +1 -0
- package/lib/components/mui/form-item-table.js +2 -0
- package/lib/components/mui/form-item-table.js.map +1 -0
- package/lib/components/mui/formik-inputs/additional-input-list.js +2 -0
- package/lib/components/mui/formik-inputs/additional-input-list.js.map +1 -0
- package/lib/components/mui/formik-inputs/additional-input.js +2 -0
- package/lib/components/mui/formik-inputs/additional-input.js.map +1 -0
- package/lib/components/mui/formik-inputs/async-select.js +2 -0
- package/lib/components/mui/formik-inputs/async-select.js.map +1 -0
- package/lib/components/mui/formik-inputs/checkbox-group.js +2 -0
- package/lib/components/mui/formik-inputs/checkbox-group.js.map +1 -0
- package/lib/components/mui/formik-inputs/checkbox.js +2 -0
- package/lib/components/mui/formik-inputs/checkbox.js.map +1 -0
- package/lib/components/mui/formik-inputs/company-input.js +2 -0
- package/lib/components/mui/formik-inputs/company-input.js.map +1 -0
- package/lib/components/mui/formik-inputs/datepicker.js +2 -0
- package/lib/components/mui/formik-inputs/datepicker.js.map +1 -0
- package/lib/components/mui/formik-inputs/discount-field.js +2 -0
- package/lib/components/mui/formik-inputs/discount-field.js.map +1 -0
- package/lib/components/mui/formik-inputs/dropdown-checkbox.js +2 -0
- package/lib/components/mui/formik-inputs/dropdown-checkbox.js.map +1 -0
- package/lib/components/mui/formik-inputs/dropdown-radio.js +2 -0
- package/lib/components/mui/formik-inputs/dropdown-radio.js.map +1 -0
- package/lib/components/mui/formik-inputs/file-size-field.js +2 -0
- package/lib/components/mui/formik-inputs/file-size-field.js.map +1 -0
- package/lib/components/mui/formik-inputs/item-price-tiers.js +2 -0
- package/lib/components/mui/formik-inputs/item-price-tiers.js.map +1 -0
- package/lib/components/mui/formik-inputs/price-field.js +2 -0
- package/lib/components/mui/formik-inputs/price-field.js.map +1 -0
- package/lib/components/mui/formik-inputs/quantity-field.js +2 -0
- package/lib/components/mui/formik-inputs/quantity-field.js.map +1 -0
- package/lib/components/mui/formik-inputs/radio-group.js +2 -0
- package/lib/components/mui/formik-inputs/radio-group.js.map +1 -0
- package/lib/components/mui/formik-inputs/select-group.js +2 -0
- package/lib/components/mui/formik-inputs/select-group.js.map +1 -0
- package/lib/components/mui/formik-inputs/select.js +2 -0
- package/lib/components/mui/formik-inputs/select.js.map +1 -0
- package/lib/components/mui/formik-inputs/sponsor-input.js +2 -0
- package/lib/components/mui/formik-inputs/sponsor-input.js.map +1 -0
- package/lib/components/mui/formik-inputs/sponsorship-input.js +2 -0
- package/lib/components/mui/formik-inputs/sponsorship-input.js.map +1 -0
- package/lib/components/mui/formik-inputs/sponsorship-summit-select.js +2 -0
- package/lib/components/mui/formik-inputs/sponsorship-summit-select.js.map +1 -0
- package/lib/components/mui/formik-inputs/summit-addon-select.js +2 -0
- package/lib/components/mui/formik-inputs/summit-addon-select.js.map +1 -0
- package/lib/components/mui/formik-inputs/switch.js +2 -0
- package/lib/components/mui/formik-inputs/switch.js.map +1 -0
- package/lib/components/mui/formik-inputs/textfield.js +2 -0
- package/lib/components/mui/formik-inputs/textfield.js.map +1 -0
- package/lib/components/mui/formik-inputs/timepicker.js +2 -0
- package/lib/components/mui/formik-inputs/timepicker.js.map +1 -0
- package/lib/components/mui/formik-inputs/upload.js +2 -0
- package/lib/components/mui/formik-inputs/upload.js.map +1 -0
- package/lib/components/mui/infinite-table.js +2 -0
- package/lib/components/mui/infinite-table.js.map +1 -0
- package/lib/components/mui/item-settings-modal.js +2 -0
- package/lib/components/mui/item-settings-modal.js.map +1 -0
- package/lib/components/mui/menu-button.js +2 -0
- package/lib/components/mui/menu-button.js.map +1 -0
- package/lib/components/mui/notes-modal.js +2 -0
- package/lib/components/mui/notes-modal.js.map +1 -0
- package/lib/components/mui/search-input.js +2 -0
- package/lib/components/mui/search-input.js.map +1 -0
- package/lib/components/mui/show-confirm-dialog.js +2 -0
- package/lib/components/mui/show-confirm-dialog.js.map +1 -0
- package/lib/components/mui/snackbar-notification.js +2 -0
- package/lib/components/mui/snackbar-notification.js.map +1 -0
- package/lib/components/mui/sortable-table.js +2 -0
- package/lib/components/mui/sortable-table.js.map +1 -0
- package/lib/components/mui/sponsor-addon-select.js +2 -0
- package/lib/components/mui/sponsor-addon-select.js.map +1 -0
- package/lib/components/mui/summit-addon-select.js +2 -0
- package/lib/components/mui/summit-addon-select.js.map +1 -0
- package/lib/components/mui/summits-dropdown.js +2 -0
- package/lib/components/mui/summits-dropdown.js.map +1 -0
- package/lib/components/mui/table.js +2 -0
- package/lib/components/mui/table.js.map +1 -0
- package/lib/components/schedule-builder-view.js +1 -1
- package/lib/components/schedule-builder-view.js.map +1 -1
- package/lib/components/sponsored-project-input.js +1 -1
- package/lib/components/sponsored-project-input.js.map +1 -1
- package/lib/components/table-editable.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 -2
- package/lib/css/components/index.css.map +1 -1
- package/lib/css/components/mui/formik-inputs/upload.css +2 -0
- package/lib/css/components/mui/formik-inputs/upload.css.map +1 -0
- package/lib/css/components/mui/infinite-table.css +2 -0
- package/lib/css/components/mui/infinite-table.css.map +1 -0
- package/lib/css/components/mui/sortable-table.css +2 -0
- package/lib/css/components/mui/sortable-table.css.map +1 -0
- package/lib/css/components/mui/table.css +2 -0
- package/lib/css/components/mui/table.css.map +1 -0
- package/lib/i18n.js +1 -1
- package/lib/i18n.js.map +1 -1
- package/lib/security/abstract-auth-callback-route-v2.js +1 -1
- package/lib/security/abstract-auth-callback-route-v2.js.map +1 -1
- package/lib/security/abstract-auth-callback-route.js +1 -1
- package/lib/security/abstract-auth-callback-route.js.map +1 -1
- package/lib/security/actions.js +1 -1
- package/lib/security/actions.js.map +1 -1
- package/lib/security/methods.js +1 -1
- package/lib/security/methods.js.map +1 -1
- package/lib/security/reducers.js +1 -1
- package/lib/security/reducers.js.map +1 -1
- package/lib/security/session-checker.js +1 -1
- package/lib/security/session-checker.js.map +1 -1
- package/lib/utils/actions.js +1 -1
- package/lib/utils/actions.js.map +1 -1
- package/lib/utils/methods.js +1 -1
- package/lib/utils/methods.js.map +1 -1
- package/lib/utils/money.js +1 -1
- package/lib/utils/money.js.map +1 -1
- package/lib/utils/query-actions.js +1 -1
- package/lib/utils/query-actions.js.map +1 -1
- package/lib/utils/questions-set.js.map +1 -1
- package/lib/utils/reducers.js +1 -1
- package/lib/utils/reducers.js.map +1 -1
- package/package.json +21 -12
|
@@ -0,0 +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={6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},8619:e=>{e.exports=require("@mui/material")},3294:e=>{e.exports=require("formik")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},2015:e=>{e.exports=require("react")}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,r),a.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};r.r(o),r.d(o,{default:()=>b});var n=r(6031),a=r.n(n),l=r(2462),i=r.n(l),u=r(2015),p=r.n(u),d=r(8619),s=r(3294),c=r(6842),m=r.n(c);const f=["name","options","placeholder"],b=e=>{let{name:t,options:r,placeholder:o}=e,n=i()(e,f);const l=o||m().translate("general.select_an_option"),[u,c,b]=(0,s.useField)(t);return p().createElement(d.FormControl,{fullWidth:!0,error:c.touched&&Boolean(c.error)},p().createElement(d.Select,a()({variant:"outlined",name:t,value:u.value||"",onChange:e=>{b.setValue(e.target.value)},displayEmpty:!0},n,{renderValue:e=>{if(!e)return p().createElement("em",null,l);const t=r.find((({value:t})=>t===e));return t?t.label:""}}),r.map((({label:e,value:t})=>p().createElement(d.MenuItem,{key:`radio-ddl-${t}`,value:t},p().createElement(d.Radio,{checked:u.value===t}),p().createElement(d.ListItemText,{primary:e}))))))};return o})()));
|
|
2
|
+
//# sourceMappingURL=dropdown-radio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/mui/formik-inputs/dropdown-radio.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,mCCTTH,EAAOD,QAAUK,QAAQ,iC,WCAzBJ,EAAOD,QAAUK,QAAQ,iD,WCAzBJ,EAAOD,QAAUK,QAAQ,gB,WCAzBJ,EAAOD,QAAUK,QAAQ,S,WCAzBJ,EAAOD,QAAUK,QAAQ,6B,WCAzBJ,EAAOD,QAAUK,QAAQ,Q,GCCrBC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaT,QAGrB,IAAIC,EAASK,EAAyBE,GAAY,CAGjDR,QAAS,CAAC,GAOX,OAHAW,EAAoBH,GAAUP,EAAQA,EAAOD,QAASO,GAG/CN,EAAOD,OACf,C,MCrBAO,EAAoBK,EAAKX,IACxB,IAAIY,EAASZ,GAAUA,EAAOa,WAC7B,IAAOb,EAAiB,QACxB,IAAM,EAEP,OADAM,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,C,WCLdN,EAAoBQ,EAAI,CAACf,EAASiB,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEnB,EAASkB,IAC5EE,OAAOC,eAAerB,EAASkB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,C,WCNDX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,E,WCClFlB,EAAoBsB,EAAK7B,IACH,oBAAX8B,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAerB,EAAS8B,OAAOC,YAAa,CAAEC,MAAO,WAE7DZ,OAAOC,eAAerB,EAAS,aAAc,CAAEgC,OAAO,GAAO,C,yLC2D9D,EAxC+B,IAA6C,IAA5C,KAAEC,EAAF,QAAQC,EAAR,YAAiBC,GAA2B,EAAXC,EAAW,SAC1E,MAAMC,EACJF,GAAeG,IAAAA,UAAY,6BACtBC,EAAOC,EAAMC,IAAWC,EAAAA,EAAAA,UAAST,GAMxC,OACE,kBAAC,EAAAU,YAAD,CAAaC,WAAS,EAACC,MAAOL,EAAKM,SAAWC,QAAQP,EAAKK,QACzD,kBAAC,EAAAG,OAAD,KACEC,QAAQ,WACRhB,KAAMA,EACND,MAAOO,EAAMP,OAAS,GACtBkB,SAVgBC,IACpBV,EAAQW,SAASD,EAAME,OAAOrB,MAA9B,EAUIsB,cAAY,GAERlB,EAPN,CAQEmB,YAAcC,IACZ,IAAKA,EACH,OAAO,4BAAKnB,GAEd,MAAMoB,EAAiBvB,EAAQwB,MAC7B,EAAG1B,WAAYA,IAAUwB,IAE3B,OAAOC,EAAiBA,EAAeE,MAAQ,EAA/C,IAGDzB,EAAQ0B,KAAI,EAAGD,QAAO3B,WACrB,kBAAC,EAAA6B,SAAD,CAAU3C,IAAM,aAAYc,IAASA,MAAOA,GAC1C,kBAAC,EAAA8B,MAAD,CAAOC,QAASxB,EAAMP,QAAUA,IAChC,kBAAC,EAAAgC,aAAD,CAAcC,QAASN,QAvBjC,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","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 \"@mui/material\"","webpack://openstack-uicore-foundation/external commonjs \"formik\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react/dist/i18n-react\"","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/mui/formik-inputs/mui-formik-dropdown-radio.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 ","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"@mui/material\");","module.exports = require(\"formik\");","module.exports = require(\"i18n-react/dist/i18n-react\");","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 2026 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 {\n FormControl,\n ListItemText,\n MenuItem,\n Radio,\n Select\n} from \"@mui/material\";\nimport { useField } from \"formik\";\nimport T from \"i18n-react/dist/i18n-react\";\n\nconst MuiFormikDropdownRadio = ({ name, options, placeholder, ...rest }) => {\n const finalPlaceholder =\n placeholder || T.translate(\"general.select_an_option\");\n const [field, meta, helpers] = useField(name);\n\n const handleChange = (event) => {\n helpers.setValue(event.target.value);\n };\n\n return (\n <FormControl fullWidth error={meta.touched && Boolean(meta.error)}>\n <Select\n variant=\"outlined\"\n name={name}\n value={field.value || \"\"}\n onChange={handleChange}\n displayEmpty\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...rest}\n renderValue={(selected) => {\n if (!selected) {\n return <em>{finalPlaceholder}</em>;\n }\n const selectedOption = options.find(\n ({ value }) => value === selected\n );\n return selectedOption ? selectedOption.label : \"\";\n }}\n >\n {options.map(({ label, value }) => (\n <MenuItem key={`radio-ddl-${value}`} value={value}>\n <Radio checked={field.value === value} />\n <ListItemText primary={label} />\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n );\n};\n\nexport default MuiFormikDropdownRadio;\n"],"names":["root","factory","exports","module","define","amd","this","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","name","options","placeholder","rest","finalPlaceholder","T","field","meta","helpers","useField","FormControl","fullWidth","error","touched","Boolean","Select","variant","onChange","event","setValue","target","displayEmpty","renderValue","selected","selectedOption","find","label","map","MenuItem","Radio","checked","ListItemText","primary"],"sourceRoot":""}
|
|
@@ -0,0 +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={9314:(e,t,r)=>{r.d(t,{default:()=>b});var o=r(6031),n=r.n(o),l=r(2462),a=r.n(l),u=r(2015),i=r.n(u),s=r(9825),p=r.n(s),d=r(8619),c=r(3294);const m=["name","label","maxLength","required"],f=e=>{var t;let{name:r,label:o,maxLength:l,required:u=!1}=e,s=a()(e,m);const[p,f]=(0,c.useField)(r),b=(null===(t=p.value)||void 0===t?void 0:t.length)||0;let v="";return o&&(v=u?`${o} *`:o),i().createElement(d.Box,null,i().createElement(d.TextField,n()({name:r,label:v},p,{onBlur:p.onBlur,margin:"normal",error:f.touched&&Boolean(f.error),helperText:f.touched&&f.error,slotProps:{htmlInput:{maxLength:l}}},s)),l&&i().createElement(d.Typography,{sx:{fontSize:"1.2rem",color:"#00000099",pl:2}},l-b+" characters left"))};f.propTypes={name:p().string.isRequired,label:p().string,maxLength:p().number,required:p().bool};const b=f},3209:(e,t,r)=>{r.d(t,{o_:()=>o});const o=1048576},6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},8619:e=>{e.exports=require("@mui/material")},3294:e=>{e.exports=require("formik")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var l=t[o]={exports:{}};return e[o](l,l.exports,r),l.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};r.r(o),r.d(o,{default:()=>y});var n=r(6031),l=r.n(n),a=r(2462),u=r.n(a),i=r(2015),s=r.n(i),p=r(9825),d=r.n(p),c=r(8619),m=r(3294),f=r(9314),b=r(3209);const v=["name","label"],x=["e","E","+","-",".",","],g=e=>{let{name:t,label:r}=e,o=u()(e,v);const[n,a,p]=(0,m.useField)(t),[d,g]=(0,i.useState)(!1),y=null===a.initialValue?null:0;return s().createElement(f.default,l()({name:t,label:r,type:"number",value:(()=>d?"":null==n.value||0===n.value?0===n.value?0:"":(e=>Math.floor(e/b.o_))(n.value))(),onChange:e=>{const t=e.target.value;if(""===t)return g(!0),void p.setValue(y);g(!1);const r=Number(t)*b.o_;p.setValue(r)},slotProps:{input:{endAdornment:s().createElement(c.InputAdornment,{position:"end"},"MB")},htmlInput:{min:0,inputMode:"numeric",step:1}},onKeyDown:e=>{if(x.includes(e.key))return e.preventDefault(),void e.stopPropagation();"0"!==e.key||""!==e.target.value&&"0"!==e.target.value||(e.preventDefault(),e.stopPropagation())}},o))};g.propTypes={name:d().string.isRequired,label:d().string.isRequired};const y=g;return o})()));
|
|
2
|
+
//# sourceMappingURL=file-size-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/mui/formik-inputs/file-size-field.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,oNCSHC,EAAqB,IAMrB,UANsB,KAC1BC,EAD0B,MAE1BC,EAF0B,UAG1BC,EAH0B,SAI1BC,GAAW,GAEP,EADDC,EACC,SACJ,MAAOC,EAAOC,IAAQC,EAAAA,EAAAA,UAASP,GACzBQ,GAAgB,UAAAH,EAAMI,aAAN,eAAaC,SAAU,EAE7C,IAAIC,EAAa,GAMjB,OAJIV,IACFU,EAAaR,EAAY,GAAEF,MAAYA,GAIvC,kBAAC,EAAAW,IAAD,KACE,kBAAC,EAAAC,UAAD,KACEb,KAAMA,EACNC,MAAOU,GACHN,EAHN,CAIES,OAAQT,EAAMS,OACdC,OAAO,SACPC,MAAOV,EAAKW,SAAWC,QAAQZ,EAAKU,OACpCG,WAAYb,EAAKW,SAAWX,EAAKU,MACjCI,UAAW,CACTC,UAAW,CACTnB,eAIAE,IAELF,GACC,kBAAC,EAAAoB,WAAD,CAAYC,GAAI,CAAEC,SAAU,SAAUC,MAAO,YAAaC,GAAI,IACxDxB,EAAYM,EAAd,oBApBV,EA2BFT,EAAmB4B,UAAY,CAC7B3B,KAAM4B,IAAAA,OAAiBC,WACvB5B,MAAO2B,IAAAA,OACP1B,UAAW0B,IAAAA,OACXzB,SAAUyB,IAAAA,MAGZ,S,mCCpEO,MAwBME,EAAe,O,WCxB5Bn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EAAMsD,IAAWrD,EAAAA,EAAAA,UAASP,IACjC6D,EAASC,IAAcC,EAAAA,EAAAA,WAAS,GAEjCC,EAAmC,OAAtB1D,EAAK2D,aAAwB,KAAO,EAsCvD,OACE,kBAAC,UAAD,KACEjE,KAAMA,EACNC,MAAOA,EACPiE,KAAK,SACLzD,MAzCoB,KAClBoD,EAAgB,GACD,MAAfxD,EAAMI,OAAiC,IAAhBJ,EAAMI,MACR,IAAhBJ,EAAMI,MAAc,EAAI,GAXlB0D,IAAUC,KAAKC,MAAMF,EAAQrC,EAAAA,IAarCwC,CAAUjE,EAAMI,OAoCd8D,GACPC,SAlCkBC,IACpB,MAAMC,EAAUD,EAAEE,OAAOlE,MAEzB,GAAgB,KAAZiE,EAGF,OAFAZ,GAAW,QACXF,EAAQgB,SAASZ,GAInBF,GAAW,GACX,MAAMK,EAAQU,OAAOH,GAAW5C,EAAAA,GAChC8B,EAAQgB,SAAST,EAAjB,EAwBE/C,UAAW,CACT0D,MAAO,CACLC,aAAc,kBAAC,EAAAC,eAAD,CAAgBC,SAAS,OAAzB,OAEhB5D,UAAW,CACT6D,IAAK,EACLC,UAAW,UACXC,KAAM,IAGVC,UA/BmBZ,IACrB,GAAIf,EAAa4B,SAASb,EAAE7B,KAG1B,OAFA6B,EAAEc,sBACFd,EAAEe,kBAKU,MAAVf,EAAE7B,KAAmC,KAAnB6B,EAAEE,OAAOlE,OAAmC,MAAnBgE,EAAEE,OAAOlE,QACtDgE,EAAEc,iBACFd,EAAEe,kBACH,GAsBKpF,GAnBR,EAwBFuD,EAAuBhC,UAAY,CACjC3B,KAAM4B,IAAAA,OAAiBC,WACvB5B,MAAO2B,IAAAA,OAAiBC,YAG1B,U","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/mui/formik-inputs/mui-formik-textfield.js","webpack://openstack-uicore-foundation/./src/utils/constants.js","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 \"@mui/material\"","webpack://openstack-uicore-foundation/external commonjs \"formik\"","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/mui/formik-inputs/mui-formik-file-size-field.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 2026 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 PropTypes from \"prop-types\";\nimport { Box, TextField, Typography } from \"@mui/material\";\nimport { useField } from \"formik\";\n\nconst MuiFormikTextField = ({\n name,\n label,\n maxLength,\n required = false,\n ...props\n}) => {\n const [field, meta] = useField(name);\n const currentLength = field.value?.length || 0;\n\n let finalLabel = \"\";\n\n if (label) {\n finalLabel = required ? `${label} *` : label;\n }\n\n return (\n <Box>\n <TextField\n name={name}\n label={finalLabel}\n {...field}\n onBlur={field.onBlur}\n margin=\"normal\"\n error={meta.touched && Boolean(meta.error)}\n helperText={meta.touched && meta.error}\n slotProps={{\n htmlInput: {\n maxLength\n }\n }}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n />\n {maxLength && (\n <Typography sx={{ fontSize: \"1.2rem\", color: \"#00000099\", pl: 2 }}>\n {`${maxLength - currentLength} characters left`}\n </Typography>\n )}\n </Box>\n );\n};\n\nMuiFormikTextField.propTypes = {\n name: PropTypes.string.isRequired,\n label: PropTypes.string,\n maxLength: PropTypes.number,\n required: PropTypes.bool\n};\n\nexport default MuiFormikTextField;\n","export const CENTS_FACTOR = 100n;\nexport const TWO_DECIMAL_PLACES = 2;\nexport const THREE_DECIMAL_PLACES = 3;\nexport const ONE_CENT = 1n;\nexport const ZERO_INT = 0;\n\nexport const CODE_200 = 200;\n\nexport const DEBOUNCE_WAIT_250 = 250;\nexport const DEBOUNCE_WAIT = 500;\n\nexport const NOTIFICATION_TIMEOUT = 2000;\nexport const DEFAULT_PER_PAGE = 10;\nexport const TWENTY_PER_PAGE = 20;\nexport const FIFTY_PER_PAGE = 50;\nexport const MAX_PER_PAGE = 100;\n\nexport const INT_BASE = 10;\n\nexport const ONE_HUNDRED = 100;\nexport const MILLISECONDS_IN_SECOND = 1000;\n\nexport const MILLISECONDS_TO_SECONDS = 1000;\n\nexport const BYTES_PER_MB = 1_048_576; // 1024 * 1024\n\nexport const MAX_INVENTORY_IMAGE_UPLOAD_SIZE = 512000;\nexport const MAX_INVENTORY_IMAGES_UPLOAD_QTY = 5;\nexport const ALLOWED_INVENTORY_IMAGE_FORMATS = [\"jpg\", \"jpeg\", \"png\"];\n\nexport const METAFIELD_TYPES_WITH_OPTIONS = [\n \"CheckBoxList\",\n \"ComboBox\",\n \"RadioButtonList\"\n];\n\nexport const METAFIELD_TYPES = [\n \"CheckBox\",\n ...METAFIELD_TYPES_WITH_OPTIONS,\n \"Text\",\n \"TextArea\",\n \"Quantity\",\n \"DateTime\",\n \"Time\"\n];\n\nexport const DISCOUNT_TYPES = {\n AMOUNT: \"Amount\",\n RATE: \"Rate\"\n};\n\nexport const RATE_FIELDS = {\n EARLY_BIRD: \"early_bird_rate\",\n STANDARD: \"standard_rate\",\n ONSITE: \"onsite_rate\"\n};\n\nexport const DECIMAL_DIGITS = 2;\n","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"@mui/material\");","module.exports = require(\"formik\");","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 2026 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, { useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { InputAdornment } from \"@mui/material\";\nimport { useField } from \"formik\";\nimport MuiFormikTextField from \"./mui-formik-textfield\";\nimport { BYTES_PER_MB } from \"../../../utils/constants\";\n\nconst BLOCKED_KEYS = [\"e\", \"E\", \"+\", \"-\", \".\", \",\"];\n\nconst bytesToMb = (bytes) => Math.floor(bytes / BYTES_PER_MB);\n\nconst MuiFormikFilesizeField = ({ name, label, ...props }) => {\n const [field, meta, helpers] = useField(name);\n const [cleared, setCleared] = useState(false);\n\n const emptyValue = meta.initialValue === null ? null : 0;\n\n const getDisplayValue = () => {\n if (cleared) return \"\";\n if (field.value == null || field.value === 0) {\n return field.value === 0 ? 0 : \"\";\n }\n return bytesToMb(field.value);\n };\n\n const handleChange = (e) => {\n const mbValue = e.target.value;\n\n if (mbValue === \"\") {\n setCleared(true);\n helpers.setValue(emptyValue);\n return;\n }\n\n setCleared(false);\n const bytes = Number(mbValue) * BYTES_PER_MB;\n helpers.setValue(bytes);\n };\n\n const handleKeyDown = (e) => {\n if (BLOCKED_KEYS.includes(e.key)) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n // Block \"0\" as first character — only 1-9 are valid leading digits.\n // When value is empty or already \"0\", prevent any \"0\" keypress.\n if (e.key === \"0\" && (e.target.value === \"\" || e.target.value === \"0\")) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n return (\n <MuiFormikTextField\n name={name}\n label={label}\n type=\"number\"\n value={getDisplayValue()}\n onChange={handleChange}\n slotProps={{\n input: {\n endAdornment: <InputAdornment position=\"end\">MB</InputAdornment>\n },\n htmlInput: {\n min: 0,\n inputMode: \"numeric\",\n step: 1\n }\n }}\n onKeyDown={handleKeyDown}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n />\n );\n};\n\nMuiFormikFilesizeField.propTypes = {\n name: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired\n};\n\nexport default MuiFormikFilesizeField;\n"],"names":["root","factory","exports","module","define","amd","this","MuiFormikTextField","name","label","maxLength","required","props","field","meta","useField","currentLength","value","length","finalLabel","Box","TextField","onBlur","margin","error","touched","Boolean","helperText","slotProps","htmlInput","Typography","sx","fontSize","color","pl","propTypes","PropTypes","isRequired","BYTES_PER_MB","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","BLOCKED_KEYS","MuiFormikFilesizeField","helpers","cleared","setCleared","useState","emptyValue","initialValue","type","bytes","Math","floor","bytesToMb","getDisplayValue","onChange","e","mbValue","target","setValue","Number","input","endAdornment","InputAdornment","position","min","inputMode","step","onKeyDown","includes","preventDefault","stopPropagation"],"sourceRoot":""}
|
|
@@ -0,0 +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={3300:(e,t,r)=>{r.d(t,{default:()=>O});var n=r(6031),a=r.n(n),l=r(1116),o=r.n(l),i=r(2462),u=r.n(i),s=r(2015),c=r.n(s),p=r(9825),d=r.n(p),b=r(8619),m=r(3294),f=r(9314),v=r(3209);const y=["name","label","inCents","inputProps"];function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const h=["e","E","+","-"],E=e=>{let{name:t,label:r,inCents:n=!1,inputProps:l={step:.01}}=e,o=u()(e,y);const[i,p,d]=(0,m.useField)(t),[g,E]=(0,s.useState)(!1),[O,R]=(0,s.useState)(!1),[T,j]=(0,s.useState)(""),P=()=>{if(g||null==i.value)return"";if(0===i.value)return"0";const e=n?i.value/v.At:i.value;return String(Number(e.toFixed(v.tv)))};return c().createElement(f.default,a()({name:t,label:r,type:"number",value:(()=>{if(O)return T;if(g)return"";if(null==i.value||0===i.value)return 0===i.value?0:"";const e=P(),t=e.indexOf(".");return-1===t?`${e}.00`:e.length-t-1==1?`${e}0`:e})(),onChange:e=>{const t=e.target.value;if(j(t),""===t)return E(!0),void d.setValue(0);E(!1);const r=Number(t),a=n?Math.round(r*v.At):r;d.setValue(a)},onFocus:()=>{R(!0),j(P())},onBlur:e=>{R(!1),o.onBlur&&o.onBlur(e)},slotProps:{input:{startAdornment:c().createElement(b.InputAdornment,{position:"start"},"$")}},inputProps:x({min:0,inputMode:"decimal"},l),onKeyDown:e=>{h.includes(e.key)&&(e.preventDefault(),e.stopPropagation())}},o))};E.propTypes={name:d().string.isRequired,label:d().string};const O=E},9314:(e,t,r)=>{r.d(t,{default:()=>f});var n=r(6031),a=r.n(n),l=r(2462),o=r.n(l),i=r(2015),u=r.n(i),s=r(9825),c=r.n(s),p=r(8619),d=r(3294);const b=["name","label","maxLength","required"],m=e=>{var t;let{name:r,label:n,maxLength:l,required:i=!1}=e,s=o()(e,b);const[c,m]=(0,d.useField)(r),f=(null===(t=c.value)||void 0===t?void 0:t.length)||0;let v="";return n&&(v=i?`${n} *`:n),u().createElement(p.Box,null,u().createElement(p.TextField,a()({name:r,label:v},c,{onBlur:c.onBlur,margin:"normal",error:m.touched&&Boolean(m.error),helperText:m.touched&&m.error,slotProps:{htmlInput:{maxLength:l}}},s)),l&&u().createElement(p.Typography,{sx:{fontSize:"1.2rem",color:"#00000099",pl:2}},l-f+" characters left"))};m.propTypes={name:c().string.isRequired,label:c().string,maxLength:c().number,required:c().bool};const f=m},3209:(e,t,r)=>{r.d(t,{At:()=>n,TR:()=>a,tv:()=>l});const n=100,a={EARLY_BIRD:"early_bird_rate",STANDARD:"standard_rate",ONSITE:"onsite_rate"},l=2},9558:(e,t,r)=>{r.d(t,{isRateEnabled:()=>n});r(5812),r(8041);const n=e=>null!=e&&""!==e},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},8619:e=>{e.exports=require("@mui/material")},3294:e=>{e.exports=require("formik")},9870:e=>{e.exports=require("i18n-react")},5812:e=>{e.exports=require("moment-timezone")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")},8041:e=>{e.exports=require("urijs")}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var l=t[n]={exports:{}};return e[n](l,l.exports,r),l.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var n={};r.r(n),r.d(n,{default:()=>m});var a=r(2015),l=r.n(a),o=r(9870),i=r.n(o),u=r(3294),s=r(8619),c=r(3300),p=r(3209),d=r(9558);const b=[{field:p.TR.EARLY_BIRD,label:"rates.early_bird_rate"},{field:p.TR.STANDARD,label:"rates.standard_rate"},{field:p.TR.ONSITE,label:"rates.onsite_rate"}],m=({readOnly:e=!1})=>{const{values:t,setFieldValue:r}=(0,u.useFormikContext)(),n={[p.TR.EARLY_BIRD]:(0,d.isRateEnabled)(t[p.TR.EARLY_BIRD]),[p.TR.STANDARD]:(0,d.isRateEnabled)(t[p.TR.STANDARD]),[p.TR.ONSITE]:(0,d.isRateEnabled)(t[p.TR.ONSITE])};return l().createElement(s.Grid2,{container:!0,spacing:2,size:12},b.map((({field:t,label:a})=>{const o=n[t];return l().createElement(s.Grid2,{key:t,size:4},l().createElement(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"}},l().createElement(s.InputLabel,{htmlFor:t},i().translate(a)),l().createElement(s.FormControlLabel,{control:l().createElement(s.Checkbox,{checked:!o,onChange:e=>((e,t)=>{r(e,t?null:0)})(t,e.target.checked),size:"small",disabled:e,inputProps:{"aria-label":`${i().translate(a)} ${i().translate("general.not_available")}`}}),label:i().translate("general.not_available")})),l().createElement(s.Box,null,o?l().createElement(c.default,{name:t,fullWidth:!0,disabled:e}):l().createElement(s.TextField,{disabled:!0,value:i().translate("general.not_available"),fullWidth:!0,variant:"outlined",margin:"normal"})))})))};return n})()));
|
|
2
|
+
//# sourceMappingURL=item-price-tiers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/mui/formik-inputs/item-price-tiers.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,+BAAi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H,EAAU,KAAO,EAAtC,EAqBkCE,CAAa3H,EAAO0H,EAAG9F,OAAO6F,SAChDZ,KAAK,QACLe,SAAUvB,EACVxG,WAAY,CACV,aAAe,GAAEwH,IAAAA,UAAY1H,MAAU0H,IAAAA,UACrC,8BAKR1H,MAAO0H,IAAAA,UAAY,4BAGvB,kBAAC,EAAA7D,IAAD,KACGuD,EACC,kBAAC,UAAD,CACErH,KAAMM,EACN6H,WAAS,EACTD,SAAUvB,IAGZ,kBAAC,EAAA5C,UAAD,CACEmE,UAAQ,EACRhH,MAAOyG,IAAAA,UAAY,yBACnBQ,WAAS,EACTC,QAAQ,WACRpE,OAAO,YAxCjB,IAJN,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/mui/formik-inputs/mui-formik-pricefield.js","webpack://openstack-uicore-foundation/./src/components/mui/formik-inputs/mui-formik-textfield.js","webpack://openstack-uicore-foundation/./src/utils/constants.js","webpack://openstack-uicore-foundation/./src/utils/methods.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material\"","webpack://openstack-uicore-foundation/external commonjs \"formik\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"moment-timezone\"","webpack://openstack-uicore-foundation/external commonjs \"prop-types\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"urijs\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/mui/formik-inputs/item-price-tiers.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 2026 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, {useState} from \"react\";\nimport PropTypes from \"prop-types\";\nimport {InputAdornment} from \"@mui/material\";\nimport {useField} from \"formik\";\nimport MuiFormikTextField from \"./mui-formik-textfield\";\nimport {DECIMAL_DIGITS, ONE_HUNDRED} from \"../../../utils/constants\";\n\nconst BLOCKED_KEYS = [\"e\", \"E\", \"+\", \"-\"];\n\nconst MuiFormikPriceField = ({\n name,\n label,\n inCents = false,\n inputProps = {step: 0.01},\n ...props\n }) => {\n // eslint-disable-next-line no-unused-vars\n const [field, meta, helpers] = useField(name);\n const [cleared, setCleared] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n const [focusedValue, setFocusedValue] = useState(\"\");\n\n // emptyValue is always 0 when editing this field, null is handled by N/A checkbox\n const emptyValue = 0;\n\n const getRawString = () => {\n if (cleared || field.value == null) return \"\";\n if (field.value === 0) return \"0\";\n const raw = inCents ? field.value / ONE_HUNDRED : field.value;\n return String(Number(raw.toFixed(DECIMAL_DIGITS)));\n };\n\n const getDisplayValue = () => {\n if (isFocused) return focusedValue;\n if (cleared) return \"\";\n if (field.value == null || field.value === 0) {\n return field.value === 0 ? 0 : \"\";\n }\n const str = getRawString();\n const dotIdx = str.indexOf(\".\");\n if (dotIdx === -1) return `${str}.00`;\n if (str.length - dotIdx - 1 === 1) return `${str}0`;\n return str;\n };\n\n const handleFocus = () => {\n setIsFocused(true);\n setFocusedValue(getRawString());\n };\n\n const handleBlur = (e) => {\n setIsFocused(false);\n if (props.onBlur) props.onBlur(e);\n };\n\n const handleChange = (e) => {\n const newVal = e.target.value;\n setFocusedValue(newVal);\n\n if (newVal === \"\") {\n setCleared(true);\n helpers.setValue(emptyValue);\n return;\n }\n\n setCleared(false);\n const numericValue = Number(newVal);\n const newPrice = inCents\n ? Math.round(numericValue * ONE_HUNDRED)\n : numericValue;\n\n helpers.setValue(newPrice);\n };\n\n const handleKeyDown = (e) => {\n if (BLOCKED_KEYS.includes(e.key)) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n return (\n <MuiFormikTextField\n name={name}\n label={label}\n type=\"number\"\n value={getDisplayValue()}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n slotProps={{\n input: {\n startAdornment: <InputAdornment position=\"start\">$</InputAdornment>\n }\n }}\n inputProps={{\n min: 0,\n inputMode: \"decimal\",\n ...inputProps\n }}\n onKeyDown={handleKeyDown}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n />\n );\n};\n\nMuiFormikPriceField.propTypes = {\n name: PropTypes.string.isRequired,\n label: PropTypes.string\n};\n\nexport default MuiFormikPriceField;\n","/**\n * Copyright 2026 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 PropTypes from \"prop-types\";\nimport { Box, TextField, Typography } from \"@mui/material\";\nimport { useField } from \"formik\";\n\nconst MuiFormikTextField = ({\n name,\n label,\n maxLength,\n required = false,\n ...props\n}) => {\n const [field, meta] = useField(name);\n const currentLength = field.value?.length || 0;\n\n let finalLabel = \"\";\n\n if (label) {\n finalLabel = required ? `${label} *` : label;\n }\n\n return (\n <Box>\n <TextField\n name={name}\n label={finalLabel}\n {...field}\n onBlur={field.onBlur}\n margin=\"normal\"\n error={meta.touched && Boolean(meta.error)}\n helperText={meta.touched && meta.error}\n slotProps={{\n htmlInput: {\n maxLength\n }\n }}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n />\n {maxLength && (\n <Typography sx={{ fontSize: \"1.2rem\", color: \"#00000099\", pl: 2 }}>\n {`${maxLength - currentLength} characters left`}\n </Typography>\n )}\n </Box>\n );\n};\n\nMuiFormikTextField.propTypes = {\n name: PropTypes.string.isRequired,\n label: PropTypes.string,\n maxLength: PropTypes.number,\n required: PropTypes.bool\n};\n\nexport default MuiFormikTextField;\n","export const CENTS_FACTOR = 100n;\nexport const TWO_DECIMAL_PLACES = 2;\nexport const THREE_DECIMAL_PLACES = 3;\nexport const ONE_CENT = 1n;\nexport const ZERO_INT = 0;\n\nexport const CODE_200 = 200;\n\nexport const DEBOUNCE_WAIT_250 = 250;\nexport const DEBOUNCE_WAIT = 500;\n\nexport const NOTIFICATION_TIMEOUT = 2000;\nexport const DEFAULT_PER_PAGE = 10;\nexport const TWENTY_PER_PAGE = 20;\nexport const FIFTY_PER_PAGE = 50;\nexport const MAX_PER_PAGE = 100;\n\nexport const INT_BASE = 10;\n\nexport const ONE_HUNDRED = 100;\nexport const MILLISECONDS_IN_SECOND = 1000;\n\nexport const MILLISECONDS_TO_SECONDS = 1000;\n\nexport const BYTES_PER_MB = 1_048_576; // 1024 * 1024\n\nexport const MAX_INVENTORY_IMAGE_UPLOAD_SIZE = 512000;\nexport const MAX_INVENTORY_IMAGES_UPLOAD_QTY = 5;\nexport const ALLOWED_INVENTORY_IMAGE_FORMATS = [\"jpg\", \"jpeg\", \"png\"];\n\nexport const METAFIELD_TYPES_WITH_OPTIONS = [\n \"CheckBoxList\",\n \"ComboBox\",\n \"RadioButtonList\"\n];\n\nexport const METAFIELD_TYPES = [\n \"CheckBox\",\n ...METAFIELD_TYPES_WITH_OPTIONS,\n \"Text\",\n \"TextArea\",\n \"Quantity\",\n \"DateTime\",\n \"Time\"\n];\n\nexport const DISCOUNT_TYPES = {\n AMOUNT: \"Amount\",\n RATE: \"Rate\"\n};\n\nexport const RATE_FIELDS = {\n EARLY_BIRD: \"early_bird_rate\",\n STANDARD: \"standard_rate\",\n ONSITE: \"onsite_rate\"\n};\n\nexport const DECIMAL_DIGITS = 2;\n","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport moment from 'moment-timezone';\nimport URI from \"urijs\";\n\nexport const findElementPos = (obj) => {\n var curtop = -70;\n if (obj.offsetParent) {\n do {\n curtop += obj.offsetTop;\n } while (obj = obj.offsetParent);\n return [curtop];\n }\n};\n\nexport const epochToMoment = (atime) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime);\n};\n\nexport const epochToMomentTimeZone = (atime, time_zone) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime).tz(time_zone);\n};\n\nexport const formatEpoch = (atime, format = 'M/D/YYYY h:mm a') => {\n if(!atime) return atime;\n return epochToMoment(atime).format(format);\n};\n\nexport const parseLocationHour = (hour) => {\n let parsedHour = hour.toString();\n if(parsedHour.length < 4) parsedHour = `0${parsedHour}`;\n parsedHour = parsedHour.match(/.{2}/g);\n parsedHour = parsedHour.join(':');\n return parsedHour;\n}\n\nexport const objectToQueryString = (obj) => {\n var str = \"\";\n for (var key in obj) {\n if (str != \"\") {\n str += \"&\";\n }\n str += key + \"=\" + encodeURIComponent(obj[key]);\n }\n\n return str;\n};\n\nexport const getBackURL = () => {\n let url = URI(window.location.href);\n let query = url.search(true);\n let fragment = url.fragment();\n let backUrl = query.hasOwnProperty('BackUrl') ? query['BackUrl'] : null;\n if(backUrl != null && fragment != null && fragment != ''){\n backUrl += `#${fragment}`;\n }\n return backUrl;\n};\n\nexport const toSlug = (text) =>{\n text = text.toLowerCase();\n return text.replace(/[^a-zA-Z0-9]+/g,'_');\n}\n\nexport const getAuthCallback = () => {\n if(typeof window !== 'undefined') {\n return `${window.location.origin}/auth/callback`;\n }\n return null;\n};\n\nexport const getCurrentLocation = () => {\n let location = '';\n if(typeof window !== 'undefined') {\n location = window.location;\n // check if we are on iframe\n if (window.top)\n location = window.top.location;\n }\n return location;\n};\n\nexport const getOrigin = () => {\n if(typeof window !== 'undefined') {\n return window.location.origin;\n }\n return null;\n};\n\nexport const getCurrentPathName = () => {\n if(typeof window !== 'undefined') {\n return window.location.pathname;\n }\n return null;\n};\n\nexport const getCurrentHref = () => {\n if(typeof window !== 'undefined') {\n return window.location.href;\n }\n return null;\n};\n\nexport const getAllowedUserGroups = () => {\n if(typeof window !== 'undefined') {\n return window.ALLOWED_USER_GROUPS || '';\n }\n return null;\n};\n\nexport const buildAPIBaseUrl = (relativeUrl) => {\n if(typeof window !== 'undefined'){\n return `${window.API_BASE_URL}${relativeUrl}`;\n }\n return null``;\n};\n\nexport const putOnLocalStorage = (key, value) => {\n if(typeof window !== 'undefined') {\n window.localStorage.setItem(key, value);\n }\n};\n\nexport const getFromLocalStorage = (key, removeIt) => {\n if(typeof window !== 'undefined') {\n let val = window.localStorage.getItem(key);\n if(removeIt){\n console.log(`getFromLocalStorage removing key ${key}`);\n removeFromLocalStorage(key);\n }\n return val;\n }\n return null;\n};\n\nexport const removeFromLocalStorage = (key) => {\n if(typeof window !== 'undefined') {\n window.localStorage.removeItem(key);\n }\n}\n\nexport const isClearingSessionState = () => {\n if(typeof window !== 'undefined') {\n return window.clearing_session_state;\n }\n return false;\n};\n\nexport const setSessionClearingState = (val) => {\n if(typeof window !== 'undefined') {\n window.clearing_session_state = val;\n }\n};\n\nexport const getCurrentUserLanguage = () => {\n let language = 'en';\n if(typeof navigator !== 'undefined') {\n language = (navigator.languages && navigator.languages[0]) || navigator.language || navigator.userLanguage;\n }\n return language;\n};\n\nexport const scrollToError = (errors) => {\n if(Object.keys(errors).length > 0) {\n const firstError = Object.keys(errors)[0];\n const firstNode = document.getElementById(firstError);\n if (firstNode) window.scrollTo(0, findElementPos(firstNode));\n }\n};\n\nexport const hasErrors = (field, errors) => {\n if(field in errors) {\n return errors[field];\n }\n return '';\n};\n\nexport const shallowEqual = (object1, object2) => {\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (let key of keys1) {\n if (object1[key] !== object2[key]) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const arraysEqual = (a1, a2) =>\n a1.length === a2.length && a1.every((o, idx) => shallowEqual(o, a2[idx]));\n\nexport const isEmpty = (obj) => {\n return Object.keys(obj).length === 0;\n};\n\n\nexport const base64URLEncode = (str) => {\n return str\n .toString('base64')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '')\n}\n\nexport const retryPromise = async (\n cb,\n maxNumberOfRetries = 3\n) => {\n for (let i = 0; i < maxNumberOfRetries; i++) {\n if (await cb()) {\n return true;\n }\n }\n\n return false;\n}\n\nexport const getTimeServiceUrl = () => {\n if(typeof window !== 'undefined') {\n return window.TIMEINTERVALSINCE1970_API_URL || process.env.TIMEINTERVALSINCE1970_API_URL;\n }\n return null;\n};\n\nexport const getEventLocation = (event, summitVenueCount, summitShowLocDate = null, nowUtc = null) => {\n const shouldShowVenues = (summitShowLocDate && nowUtc) ? summitShowLocDate * 1000 < nowUtc : true;\n const locationName = [];\n const { location } = event;\n\n if (!shouldShowVenues) return 'TBA';\n\n if (!location) return 'TBA';\n\n if (summitVenueCount > 1 && location.venue?.name) locationName.push(location.venue.name);\n if (location.floor?.name) locationName.push(location.floor.name);\n if (location.name) locationName.push(location.name);\n\n return locationName.length > 0 ? locationName.join(' - ') : 'TBA';\n};\n\nexport const getEventHosts = (event) => {\n let hosts = [];\n if (event.speakers?.length > 0) {\n hosts = [...event.speakers];\n }\n if (event.moderator) hosts.push(event.moderator);\n\n return hosts;\n};\n\nconst loadImage = async url => {\n const img = document.createElement('img')\n img.src = url\n img.crossOrigin = 'anonymous'\n\n return new Promise((resolve, reject) => {\n img.onload = () => resolve(img)\n img.onerror = reject\n })\n}\n\nexport const convertSVGtoImg = async (svgUrl) => {\n const img = await loadImage(svgUrl)\n const newWidth = 100\n const newHeight = Math.floor(img.naturalHeight * 100 / img.naturalWidth)\n\n const canvas = document.createElement('canvas')\n canvas.width = newWidth\n canvas.height = newHeight\n canvas.getContext('2d').drawImage(img, 0, 0, newWidth, newHeight)\n\n const url = await canvas.toDataURL(`image/png`, 1.0)\n console.log(url, newWidth, newHeight);\n return {url, width: newWidth, height: newHeight}\n}\n\nexport const isRateEnabled = (value) =>\n value !== null && value !== undefined && value !== \"\";\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"@mui/material\");","module.exports = require(\"formik\");","module.exports = require(\"i18n-react\");","module.exports = require(\"moment-timezone\");","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","module.exports = require(\"urijs\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport T from \"i18n-react\";\nimport { useFormikContext } from \"formik\";\nimport {\n Box,\n Checkbox,\n FormControlLabel,\n Grid2,\n InputLabel,\n TextField\n} from \"@mui/material\";\nimport MuiFormikPriceField from \"./mui-formik-pricefield\";\nimport { RATE_FIELDS } from \"../../../utils/constants\";\nimport { isRateEnabled } from \"../../../utils/methods\";\n\nconst TIERS = [\n { field: RATE_FIELDS.EARLY_BIRD, label: \"rates.early_bird_rate\" },\n { field: RATE_FIELDS.STANDARD, label: \"rates.standard_rate\" },\n { field: RATE_FIELDS.ONSITE, label: \"rates.onsite_rate\" }\n];\n\nconst ItemPriceTiers = ({ readOnly = false }) => {\n const { values, setFieldValue } = useFormikContext();\n\n const enabled = {\n [RATE_FIELDS.EARLY_BIRD]: isRateEnabled(values[RATE_FIELDS.EARLY_BIRD]),\n [RATE_FIELDS.STANDARD]: isRateEnabled(values[RATE_FIELDS.STANDARD]),\n [RATE_FIELDS.ONSITE]: isRateEnabled(values[RATE_FIELDS.ONSITE])\n };\n\n const handleToggle = (field, checked) => {\n setFieldValue(field, checked ? null : 0);\n };\n\n return (\n <Grid2 container spacing={2} size={12}>\n {TIERS.map(({ field, label }) => {\n const isEnabled = enabled[field];\n return (\n <Grid2 key={field} size={4}>\n <Box\n sx={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\"\n }}\n >\n <InputLabel htmlFor={field}>{T.translate(label)}</InputLabel>\n <FormControlLabel\n control={\n <Checkbox\n checked={!isEnabled}\n onChange={(ev) => handleToggle(field, ev.target.checked)}\n size=\"small\"\n disabled={readOnly}\n inputProps={{\n \"aria-label\": `${T.translate(label)} ${T.translate(\n \"general.not_available\"\n )}`\n }}\n />\n }\n label={T.translate(\"general.not_available\")}\n />\n </Box>\n <Box>\n {isEnabled ? (\n <MuiFormikPriceField\n name={field}\n fullWidth\n disabled={readOnly}\n />\n ) : (\n <TextField\n disabled\n value={T.translate(\"general.not_available\")}\n fullWidth\n variant=\"outlined\"\n margin=\"normal\"\n />\n )}\n </Box>\n </Grid2>\n );\n })}\n </Grid2>\n );\n};\n\nexport default ItemPriceTiers;\n"],"names":["root","factory","exports","module","define","amd","this","BLOCKED_KEYS","MuiFormikPriceField","name","label","inCents","inputProps","step","props","field","meta","helpers","useField","cleared","setCleared","useState","isFocused","setIsFocused","focusedValue","setFocusedValue","getRawString","value","raw","ONE_HUNDRED","String","Number","toFixed","DECIMAL_DIGITS","type","str","dotIdx","indexOf","length","getDisplayValue","onChange","e","newVal","target","setValue","numericValue","newPrice","Math","round","onFocus","onBlur","slotProps","input","startAdornment","InputAdornment","position","min","inputMode","onKeyDown","includes","key","preventDefault","stopPropagation","propTypes","PropTypes","isRequired","MuiFormikTextField","maxLength","required","currentLength","finalLabel","Box","TextField","margin","error","touched","Boolean","helperText","htmlInput","Typography","sx","fontSize","color","pl","RATE_FIELDS","EARLY_BIRD","STANDARD","ONSITE","isRateEnabled","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","TIERS","readOnly","values","setFieldValue","useFormikContext","enabled","Grid2","container","spacing","size","map","isEnabled","display","alignItems","justifyContent","InputLabel","htmlFor","T","FormControlLabel","control","Checkbox","checked","ev","handleToggle","disabled","fullWidth","variant"],"sourceRoot":""}
|
|
@@ -0,0 +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={9314:(e,t,r)=>{r.d(t,{default:()=>m});var n=r(6031),o=r.n(n),u=r(2462),l=r.n(u),a=r(2015),i=r.n(a),s=r(9825),p=r.n(s),c=r(8619),d=r(3294);const f=["name","label","maxLength","required"],b=e=>{var t;let{name:r,label:n,maxLength:u,required:a=!1}=e,s=l()(e,f);const[p,b]=(0,d.useField)(r),m=(null===(t=p.value)||void 0===t?void 0:t.length)||0;let y="";return n&&(y=a?`${n} *`:n),i().createElement(c.Box,null,i().createElement(c.TextField,o()({name:r,label:y},p,{onBlur:p.onBlur,margin:"normal",error:b.touched&&Boolean(b.error),helperText:b.touched&&b.error,slotProps:{htmlInput:{maxLength:u}}},s)),u&&i().createElement(c.Typography,{sx:{fontSize:"1.2rem",color:"#00000099",pl:2}},u-m+" characters left"))};b.propTypes={name:p().string.isRequired,label:p().string,maxLength:p().number,required:p().bool};const m=b},3209:(e,t,r)=>{r.d(t,{At:()=>n,tv:()=>o});const n=100,o=2},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},8619:e=>{e.exports=require("@mui/material")},3294:e=>{e.exports=require("formik")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var u=t[n]={exports:{}};return e[n](u,u.exports,r),u.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var n={};r.r(n),r.d(n,{default:()=>j});var o=r(6031),u=r.n(o),l=r(1116),a=r.n(l),i=r(2462),s=r.n(i),p=r(2015),c=r.n(p),d=r(9825),f=r.n(d),b=r(8619),m=r(3294),y=r(9314),v=r(3209);const g=["name","label","inCents","inputProps"];function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const O=["e","E","+","-"],P=e=>{let{name:t,label:r,inCents:n=!1,inputProps:o={step:.01}}=e,l=s()(e,g);const[a,i,d]=(0,m.useField)(t),[f,x]=(0,p.useState)(!1),[P,j]=(0,p.useState)(!1),[q,S]=(0,p.useState)(""),w=()=>{if(f||null==a.value)return"";if(0===a.value)return"0";const e=n?a.value/v.At:a.value;return String(Number(e.toFixed(v.tv)))};return c().createElement(y.default,u()({name:t,label:r,type:"number",value:(()=>{if(P)return q;if(f)return"";if(null==a.value||0===a.value)return 0===a.value?0:"";const e=w(),t=e.indexOf(".");return-1===t?`${e}.00`:e.length-t-1==1?`${e}0`:e})(),onChange:e=>{const t=e.target.value;if(S(t),""===t)return x(!0),void d.setValue(0);x(!1);const r=Number(t),o=n?Math.round(r*v.At):r;d.setValue(o)},onFocus:()=>{j(!0),S(w())},onBlur:e=>{j(!1),l.onBlur&&l.onBlur(e)},slotProps:{input:{startAdornment:c().createElement(b.InputAdornment,{position:"start"},"$")}},inputProps:h({min:0,inputMode:"decimal"},o),onKeyDown:e=>{O.includes(e.key)&&(e.preventDefault(),e.stopPropagation())}},l))};P.propTypes={name:f().string.isRequired,label:f().string};const j=P;return n})()));
|
|
2
|
+
//# sourceMappingURL=price-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/mui/formik-inputs/price-field.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,oN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I,MACxD,OAAOiE,OAAOC,OAAOF,EAAIG,QAAQ7C,EAAAA,KAAjC,EAoDF,OACE,kBAAC,UAAD,KACE/B,KAAMA,EACNC,MAAOA,EACP4E,KAAK,SACLpE,MAtDoB,MACtB,GAAI2D,EAAW,OAAOE,EACtB,GAAIL,EAAS,MAAO,GACpB,GAAmB,MAAf5D,EAAMI,OAAiC,IAAhBJ,EAAMI,MAC/B,OAAuB,IAAhBJ,EAAMI,MAAc,EAAI,GAEjC,MAAMqE,EAAMN,IACNO,EAASD,EAAIE,QAAQ,KAC3B,OAAgB,IAAZD,EAAuB,GAAED,OACzBA,EAAIpE,OAASqE,EAAS,GAAM,EAAW,GAAED,KACtCA,CAAP,EA4CSG,GACPC,SAhCkBC,IACpB,MAAMC,EAASD,EAAEE,OAAO5E,MAGxB,GAFA8D,EAAgBa,GAED,KAAXA,EAGF,OAFAlB,GAAW,QACXF,EAAQsB,SAtCO,GA0CjBpB,GAAW,GACX,MAAMqB,EAAeZ,OAAOS,GACtBI,EAAW3B,EACb4B,KAAKC,MAAMH,EAAezD,EAAAA,IAC1ByD,EAEJvB,EAAQsB,SAASE,EAAjB,EAiBEG,QA3CgB,KAClBtB,GAAa,GACbE,EAAgBC,IAAhB,EA0CE1D,OAvCgBqE,IAClBd,GAAa,GACTjE,EAAMU,QAAQV,EAAMU,OAAOqE,EAAb,EAsChB/D,UAAW,CACTwE,MAAO,CACLC,eAAgB,kBAAC,EAAAC,eAAD,CAAgBC,SAAS,SAAzB,OAGpBjC,WAAU,GACRkC,IAAK,EACLC,UAAW,WACRnC,GAELoC,UA1BmBf,IACjBxB,EAAawC,SAAShB,EAAEtC,OAC1BsC,EAAEiB,iBACFjB,EAAEkB,kBACH,GAwBKjG,GArBR,EA0BFwD,EAAoBjC,UAAY,CAC9B3B,KAAM4B,IAAAA,OAAiBC,WACvB5B,MAAO2B,IAAAA,QAGT,U","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/mui/formik-inputs/mui-formik-textfield.js","webpack://openstack-uicore-foundation/./src/utils/constants.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 \"@mui/material\"","webpack://openstack-uicore-foundation/external commonjs \"formik\"","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/mui/formik-inputs/mui-formik-pricefield.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 2026 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 PropTypes from \"prop-types\";\nimport { Box, TextField, Typography } from \"@mui/material\";\nimport { useField } from \"formik\";\n\nconst MuiFormikTextField = ({\n name,\n label,\n maxLength,\n required = false,\n ...props\n}) => {\n const [field, meta] = useField(name);\n const currentLength = field.value?.length || 0;\n\n let finalLabel = \"\";\n\n if (label) {\n finalLabel = required ? `${label} *` : label;\n }\n\n return (\n <Box>\n <TextField\n name={name}\n label={finalLabel}\n {...field}\n onBlur={field.onBlur}\n margin=\"normal\"\n error={meta.touched && Boolean(meta.error)}\n helperText={meta.touched && meta.error}\n slotProps={{\n htmlInput: {\n maxLength\n }\n }}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n />\n {maxLength && (\n <Typography sx={{ fontSize: \"1.2rem\", color: \"#00000099\", pl: 2 }}>\n {`${maxLength - currentLength} characters left`}\n </Typography>\n )}\n </Box>\n );\n};\n\nMuiFormikTextField.propTypes = {\n name: PropTypes.string.isRequired,\n label: PropTypes.string,\n maxLength: PropTypes.number,\n required: PropTypes.bool\n};\n\nexport default MuiFormikTextField;\n","export const CENTS_FACTOR = 100n;\nexport const TWO_DECIMAL_PLACES = 2;\nexport const THREE_DECIMAL_PLACES = 3;\nexport const ONE_CENT = 1n;\nexport const ZERO_INT = 0;\n\nexport const CODE_200 = 200;\n\nexport const DEBOUNCE_WAIT_250 = 250;\nexport const DEBOUNCE_WAIT = 500;\n\nexport const NOTIFICATION_TIMEOUT = 2000;\nexport const DEFAULT_PER_PAGE = 10;\nexport const TWENTY_PER_PAGE = 20;\nexport const FIFTY_PER_PAGE = 50;\nexport const MAX_PER_PAGE = 100;\n\nexport const INT_BASE = 10;\n\nexport const ONE_HUNDRED = 100;\nexport const MILLISECONDS_IN_SECOND = 1000;\n\nexport const MILLISECONDS_TO_SECONDS = 1000;\n\nexport const BYTES_PER_MB = 1_048_576; // 1024 * 1024\n\nexport const MAX_INVENTORY_IMAGE_UPLOAD_SIZE = 512000;\nexport const MAX_INVENTORY_IMAGES_UPLOAD_QTY = 5;\nexport const ALLOWED_INVENTORY_IMAGE_FORMATS = [\"jpg\", \"jpeg\", \"png\"];\n\nexport const METAFIELD_TYPES_WITH_OPTIONS = [\n \"CheckBoxList\",\n \"ComboBox\",\n \"RadioButtonList\"\n];\n\nexport const METAFIELD_TYPES = [\n \"CheckBox\",\n ...METAFIELD_TYPES_WITH_OPTIONS,\n \"Text\",\n \"TextArea\",\n \"Quantity\",\n \"DateTime\",\n \"Time\"\n];\n\nexport const DISCOUNT_TYPES = {\n AMOUNT: \"Amount\",\n RATE: \"Rate\"\n};\n\nexport const RATE_FIELDS = {\n EARLY_BIRD: \"early_bird_rate\",\n STANDARD: \"standard_rate\",\n ONSITE: \"onsite_rate\"\n};\n\nexport const DECIMAL_DIGITS = 2;\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"@mui/material\");","module.exports = require(\"formik\");","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 2026 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, {useState} from \"react\";\nimport PropTypes from \"prop-types\";\nimport {InputAdornment} from \"@mui/material\";\nimport {useField} from \"formik\";\nimport MuiFormikTextField from \"./mui-formik-textfield\";\nimport {DECIMAL_DIGITS, ONE_HUNDRED} from \"../../../utils/constants\";\n\nconst BLOCKED_KEYS = [\"e\", \"E\", \"+\", \"-\"];\n\nconst MuiFormikPriceField = ({\n name,\n label,\n inCents = false,\n inputProps = {step: 0.01},\n ...props\n }) => {\n // eslint-disable-next-line no-unused-vars\n const [field, meta, helpers] = useField(name);\n const [cleared, setCleared] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n const [focusedValue, setFocusedValue] = useState(\"\");\n\n // emptyValue is always 0 when editing this field, null is handled by N/A checkbox\n const emptyValue = 0;\n\n const getRawString = () => {\n if (cleared || field.value == null) return \"\";\n if (field.value === 0) return \"0\";\n const raw = inCents ? field.value / ONE_HUNDRED : field.value;\n return String(Number(raw.toFixed(DECIMAL_DIGITS)));\n };\n\n const getDisplayValue = () => {\n if (isFocused) return focusedValue;\n if (cleared) return \"\";\n if (field.value == null || field.value === 0) {\n return field.value === 0 ? 0 : \"\";\n }\n const str = getRawString();\n const dotIdx = str.indexOf(\".\");\n if (dotIdx === -1) return `${str}.00`;\n if (str.length - dotIdx - 1 === 1) return `${str}0`;\n return str;\n };\n\n const handleFocus = () => {\n setIsFocused(true);\n setFocusedValue(getRawString());\n };\n\n const handleBlur = (e) => {\n setIsFocused(false);\n if (props.onBlur) props.onBlur(e);\n };\n\n const handleChange = (e) => {\n const newVal = e.target.value;\n setFocusedValue(newVal);\n\n if (newVal === \"\") {\n setCleared(true);\n helpers.setValue(emptyValue);\n return;\n }\n\n setCleared(false);\n const numericValue = Number(newVal);\n const newPrice = inCents\n ? Math.round(numericValue * ONE_HUNDRED)\n : numericValue;\n\n helpers.setValue(newPrice);\n };\n\n const handleKeyDown = (e) => {\n if (BLOCKED_KEYS.includes(e.key)) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n return (\n <MuiFormikTextField\n name={name}\n label={label}\n type=\"number\"\n value={getDisplayValue()}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n slotProps={{\n input: {\n startAdornment: <InputAdornment position=\"start\">$</InputAdornment>\n }\n }}\n inputProps={{\n min: 0,\n inputMode: \"decimal\",\n ...inputProps\n }}\n onKeyDown={handleKeyDown}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n />\n );\n};\n\nMuiFormikPriceField.propTypes = {\n name: PropTypes.string.isRequired,\n label: PropTypes.string\n};\n\nexport default MuiFormikPriceField;\n"],"names":["root","factory","exports","module","define","amd","this","MuiFormikTextField","name","label","maxLength","required","props","field","meta","useField","currentLength","value","length","finalLabel","Box","TextField","onBlur","margin","error","touched","Boolean","helperText","slotProps","htmlInput","Typography","sx","fontSize","color","pl","propTypes","PropTypes","isRequired","ONE_HUNDRED","DECIMAL_DIGITS","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","BLOCKED_KEYS","MuiFormikPriceField","inCents","inputProps","step","helpers","cleared","setCleared","useState","isFocused","setIsFocused","focusedValue","setFocusedValue","getRawString","raw","String","Number","toFixed","type","str","dotIdx","indexOf","getDisplayValue","onChange","e","newVal","target","setValue","numericValue","newPrice","Math","round","onFocus","input","startAdornment","InputAdornment","position","min","inputMode","onKeyDown","includes","preventDefault","stopPropagation"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={9314:(e,r,t)=>{t.d(r,{default:()=>b});var o=t(6031),n=t.n(o),a=t(2462),i=t.n(a),l=t(2015),u=t.n(l),p=t(9825),s=t.n(p),d=t(8619),c=t(3294);const m=["name","label","maxLength","required"],f=e=>{var r;let{name:t,label:o,maxLength:a,required:l=!1}=e,p=i()(e,m);const[s,f]=(0,c.useField)(t),b=(null===(r=s.value)||void 0===r?void 0:r.length)||0;let x="";return o&&(x=l?`${o} *`:o),u().createElement(d.Box,null,u().createElement(d.TextField,n()({name:t,label:x},s,{onBlur:s.onBlur,margin:"normal",error:f.touched&&Boolean(f.error),helperText:f.touched&&f.error,slotProps:{htmlInput:{maxLength:a}}},p)),a&&u().createElement(d.Typography,{sx:{fontSize:"1.2rem",color:"#00000099",pl:2}},a-b+" characters left"))};f.propTypes={name:s().string.isRequired,label:s().string,maxLength:s().number,required:s().bool};const b=f},6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},8619:e=>{e.exports=require("@mui/material")},3294:e=>{e.exports=require("formik")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")}},r={};function t(o){var n=r[o];if(void 0!==n)return n.exports;var a=r[o]={exports:{}};return e[o](a,a.exports,t),a.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};t.r(o),t.d(o,{default:()=>m});var n=t(6031),a=t.n(n),i=t(2015),l=t.n(i),u=t(9825),p=t.n(u),s=t(9314);const d=["e","E","+","-"],c=e=>{let r=a()({},e);return l().createElement(s.default,a()({type:"number",onKeyDown:e=>{d.includes(e.key)&&(e.nativeEvent.preventDefault(),e.nativeEvent.stopImmediatePropagation())},inputProps:{min:0,inputMode:"numeric"}},r))};c.propTypes={name:p().string.isRequired,label:p().string};const m=c;return o})()));
|
|
2
|
+
//# sourceMappingURL=quantity-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/mui/formik-inputs/quantity-field.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,oNCSHC,EAAqB,IAMrB,UANsB,KAC1BC,EAD0B,MAE1BC,EAF0B,UAG1BC,EAH0B,SAI1BC,GAAW,GAEP,EADDC,EACC,SACJ,MAAOC,EAAOC,IAAQC,EAAAA,EAAAA,UAASP,GACzBQ,GAAgB,UAAAH,EAAMI,aAAN,eAAaC,SAAU,EAE7C,IAAIC,EAAa,GAMjB,OAJIV,IACFU,EAAaR,EAAY,GAAEF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KAASX,EAAoBY,EAAElD,EAASiD,IAC5EE,OAAOC,eAAepD,EAASiD,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,C,WCNDX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,E,WCClFlB,EAAoBsB,EAAK5D,IACH,oBAAX6D,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAepD,EAAS6D,OAAOC,YAAa,CAAE/C,MAAO,WAE7DoC,OAAOC,eAAepD,EAAS,aAAc,CAAEe,OAAO,GAAO,C,mHCY9D,MAAMgD,EAAe,CAAC,IAAK,IAAK,IAAK,KAE/BC,EAAyB,QAAMtD,EAAN,iBAC7B,kBAAC,UAAD,KACEuD,KAAK,SACLC,UAAYC,IACNJ,EAAaK,SAASD,EAAElB,OAC1BkB,EAAEE,YAAYC,iBACdH,EAAEE,YAAYE,2BACf,EAEHC,WAAY,CACVC,IAAK,EACLC,UAAW,YAGThE,GAduB,EAkB/BsD,EAAuB/B,UAAY,CACjC3B,KAAM4B,IAAAA,OAAiBC,WACvB5B,MAAO2B,IAAAA,QAGT,U","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/mui/formik-inputs/mui-formik-textfield.js","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 \"@mui/material\"","webpack://openstack-uicore-foundation/external commonjs \"formik\"","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/mui/formik-inputs/mui-formik-quantity-field.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 2026 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 PropTypes from \"prop-types\";\nimport { Box, TextField, Typography } from \"@mui/material\";\nimport { useField } from \"formik\";\n\nconst MuiFormikTextField = ({\n name,\n label,\n maxLength,\n required = false,\n ...props\n}) => {\n const [field, meta] = useField(name);\n const currentLength = field.value?.length || 0;\n\n let finalLabel = \"\";\n\n if (label) {\n finalLabel = required ? `${label} *` : label;\n }\n\n return (\n <Box>\n <TextField\n name={name}\n label={finalLabel}\n {...field}\n onBlur={field.onBlur}\n margin=\"normal\"\n error={meta.touched && Boolean(meta.error)}\n helperText={meta.touched && meta.error}\n slotProps={{\n htmlInput: {\n maxLength\n }\n }}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n />\n {maxLength && (\n <Typography sx={{ fontSize: \"1.2rem\", color: \"#00000099\", pl: 2 }}>\n {`${maxLength - currentLength} characters left`}\n </Typography>\n )}\n </Box>\n );\n};\n\nMuiFormikTextField.propTypes = {\n name: PropTypes.string.isRequired,\n label: PropTypes.string,\n maxLength: PropTypes.number,\n required: PropTypes.bool\n};\n\nexport default MuiFormikTextField;\n","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"@mui/material\");","module.exports = require(\"formik\");","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 2026 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 PropTypes from \"prop-types\";\nimport MuiFormikTextField from \"./mui-formik-textfield\";\n\nconst BLOCKED_KEYS = [\"e\", \"E\", \"+\", \"-\"];\n\nconst MuiFormikQuantityField = ({ ...props }) => (\n <MuiFormikTextField\n type=\"number\"\n onKeyDown={(e) => {\n if (BLOCKED_KEYS.includes(e.key)) {\n e.nativeEvent.preventDefault();\n e.nativeEvent.stopImmediatePropagation();\n }\n }}\n inputProps={{\n min: 0,\n inputMode: \"numeric\"\n }}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n />\n);\n\nMuiFormikQuantityField.propTypes = {\n name: PropTypes.string.isRequired,\n label: PropTypes.string\n};\n\nexport default MuiFormikQuantityField;\n"],"names":["root","factory","exports","module","define","amd","this","MuiFormikTextField","name","label","maxLength","required","props","field","meta","useField","currentLength","value","length","finalLabel","Box","TextField","onBlur","margin","error","touched","Boolean","helperText","slotProps","htmlInput","Typography","sx","fontSize","color","pl","propTypes","PropTypes","isRequired","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","BLOCKED_KEYS","MuiFormikQuantityField","type","onKeyDown","e","includes","nativeEvent","preventDefault","stopImmediatePropagation","inputProps","min","inputMode"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},8619:e=>{e.exports=require("@mui/material")},3294:e=>{e.exports=require("formik")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")}},r={};function o(t){var a=r[t];if(void 0!==a)return a.exports;var n=r[t]={exports:{}};return e[t](n,n.exports,o),n.exports}(()=>{o.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return o.d(r,{a:r}),r}})(),(()=>{o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})}})(),(()=>{o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var t={};o.r(t),o.d(t,{default:()=>x});var a=o(6031),n=o.n(a),l=o(2462),i=o.n(l),u=o(2015),p=o.n(u),s=o(9825),d=o.n(s),c=o(8619),m=o(3294);const b=["name","label","marginWrapper","options"],f=e=>{let{name:r,label:o,marginWrapper:t="normal",options:a}=e,l=i()(e,b);const[u,s]=(0,m.useField)({name:r});return p().createElement(c.FormControl,{fullWidth:!0,margin:t,error:s.touched&&Boolean(s.error)},o&&p().createElement(c.FormLabel,{id:"radio-group-label"},o),p().createElement(c.RadioGroup,n()({"aria-labelledby":"radio-group-label",defaultValue:u.value,name:r},u,l),a.map((e=>p().createElement(c.FormControlLabel,{key:`radio-box-${e.value}`,value:e.value,control:p().createElement(c.Radio,{sx:{"& .MuiSvgIcon-root":{fontSize:24}}}),label:e.label})))),s.touched&&s.error&&p().createElement(c.FormHelperText,null,s.error))};f.propTypes={name:d().string.isRequired,label:d().string,marginWrapper:d().string,options:d().array.isRequired};const x=f;return t})()));
|
|
2
|
+
//# sourceMappingURL=radio-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/mui/formik-in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a,CAAEC,MAAO,WAE7DZ,OAAOC,eAAerB,EAAS,aAAc,CAAEgC,OAAO,GAAO,C,mMCoBxDC,EAAsB,IAMtB,IANuB,KAC3BC,EAD2B,MAE3BC,EAF2B,cAG3BC,EAAgB,SAHW,QAI3BC,GAEI,EADDC,EACC,SACJ,MAAOC,EAAOC,IAAQC,EAAAA,EAAAA,UAAS,CAAEP,SAEjC,OACE,kBAAC,EAAAQ,YAAD,CACEC,WAAS,EACTC,OAAQR,EACRS,MAAOL,EAAKM,SAAWC,QAAQP,EAAKK,QAEnCV,GAAS,kBAAC,EAAAa,UAAD,CAAWC,GAAG,qBAAqBd,GAC7C,kBAAC,EAAAe,WAAD,KACE,kBAAgB,oBAChBC,aAAcZ,EAAMP,MACpBE,KAAMA,GAEFK,EAEAD,GAEHD,EAAQe,KAAKC,GACZ,kBAAC,EAAAC,iBAAD,CACEpC,IAAM,aAAYmC,EAAGrB,QACrBA,MAAOqB,EAAGrB,MACVuB,QACE,kBAAC,EAAAC,MAAD,CACEC,GAAI,CACF,qBAAsB,CACpBC,SAAU,OAKlBvB,MAAOkB,EAAGlB,WAIfK,EAAKM,SAAWN,EAAKK,OACpB,kBAAC,EAAAc,eAAD,KAAiBnB,EAAKK,OAlC5B,EAwCFZ,EAAoB2B,UAAY,CAC9B1B,KAAM2B,IAAAA,OAAiBC,WACvB3B,MAAO0B,IAAAA,OACPzB,cAAeyB,IAAAA,OACfxB,QAASwB,IAAAA,MAAgBC,YAG3B,U","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","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 \"@mui/material\"","webpack://openstack-uicore-foundation/external commonjs \"formik\"","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/mui/formik-inputs/mui-formik-radio-group.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 ","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"@mui/material\");","module.exports = require(\"formik\");","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 2026 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 PropTypes from \"prop-types\";\nimport {\n FormControl,\n FormControlLabel,\n FormHelperText,\n FormLabel,\n Radio,\n RadioGroup\n} from \"@mui/material\";\nimport { useField } from \"formik\";\n\nconst MuiFormikRadioGroup = ({\n name,\n label,\n marginWrapper = \"normal\",\n options,\n ...props\n}) => {\n const [field, meta] = useField({ name });\n\n return (\n <FormControl\n fullWidth\n margin={marginWrapper}\n error={meta.touched && Boolean(meta.error)}\n >\n {label && <FormLabel id=\"radio-group-label\">{label}</FormLabel>}\n <RadioGroup\n aria-labelledby=\"radio-group-label\"\n defaultValue={field.value}\n name={name}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...field}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n >\n {options.map((op) => (\n <FormControlLabel\n key={`radio-box-${op.value}`}\n value={op.value}\n control={\n <Radio\n sx={{\n \"& .MuiSvgIcon-root\": {\n fontSize: 24\n }\n }}\n />\n }\n label={op.label}\n />\n ))}\n </RadioGroup>\n {meta.touched && meta.error && (\n <FormHelperText>{meta.error}</FormHelperText>\n )}\n </FormControl>\n );\n};\n\nMuiFormikRadioGroup.propTypes = {\n name: PropTypes.string.isRequired,\n label: PropTypes.string,\n marginWrapper: PropTypes.string,\n options: PropTypes.array.isRequired\n};\n\nexport default MuiFormikRadioGroup;\n"],"names":["root","factory","exports","module","define","amd","this","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","MuiFormikRadioGroup","name","label","marginWrapper","options","props","field","meta","useField","FormControl","fullWidth","margin","error","touched","Boolean","FormLabel","id","RadioGroup","defaultValue","map","op","FormControlLabel","control","Radio","sx","fontSize","FormHelperText","propTypes","PropTypes","isRequired"],"sourceRoot":""}
|
|
@@ -0,0 +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={1858:e=>{e.exports=require("@mui/icons-material/ExpandMore")},8619:e=>{e.exports=require("@mui/material")},3294:e=>{e.exports=require("formik")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")}},t={};function r(l){var n=t[l];if(void 0!==n)return n.exports;var o=t[l]={exports:{}};return e[l](o,o.exports,r),o.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var l in t)r.o(t,l)&&!r.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var l={};r.r(l),r.d(l,{default:()=>d});var n=r(2015),o=r.n(n),a=r(8619),i=r(1858),s=r.n(i),u=r(9825),c=r.n(u),p=r(3294);const m=({name:e,queryFunction:t,queryParams:r=[],placeholder:l="Select options",showSelectAll:i=!1,selectAllLabel:u="Select All",getOptionLabel:c=e=>e.name,getOptionValue:m=e=>e.id,noOptionsLabel:d="No items",getGroupId:f=null,getGroupLabel:g=null,disabled:y=!1})=>{const[x,b,h]=(0,p.useField)(e),[v,E]=(0,n.useState)([]),[S,A]=(0,n.useState)([]),[k,L]=(0,n.useState)(!1),I=Array.isArray(x.value)&&x.value.includes("all"),O=I?v:x.value||[],q=b.touched&&b.error;(0,n.useEffect)((()=>{(async()=>{L(!0);try{await t(...r,(e=>{if(E(e),f&&g){const t=new Map;e.forEach((e=>{const r=f(e),l=g(e);t.has(r)||t.set(r,{id:r,label:l,options:[]}),t.get(r).options.push(e)})),A(Array.from(t.values()))}else A([{id:"default",label:null,options:e}]);L(!1)}))}catch(e){L(!1)}})()}),[]);const P=e=>{const t=e.target.value;if(t.includes("selectAll")){const e=Array.isArray(O)?O.map(m):[];return void(I||e.length===v.length?h.setValue([]):h.setValue(["all"]))}const r=t.filter((e=>"selectAll"!==e)).map((e=>v.find((t=>m(t)===e)))).filter(Boolean);h.setValue(r)},C=I?v.map(m):Array.isArray(O)?O.map((e=>m(e))):[],M=(0,n.useMemo)((()=>(e=>()=>o().createElement(a.Box,{sx:{display:"flex",alignItems:"center",pr:1}},e&&o().createElement(a.CircularProgress,{size:16,sx:{mr:1}}),o().createElement(s(),null)))(k)),[k]);return o().createElement(o().Fragment,null,o().createElement(a.Select,{multiple:!0,fullWidth:!0,value:C,onChange:P,input:o().createElement(a.OutlinedInput,null),displayEmpty:!0,disabled:y||k,renderValue:e=>e&&0!==e.length?e.map((e=>{const t=v.find((t=>m(t)===e));return t?c(t):e})).join(", "):o().createElement("span",{style:{color:"#aaa"}},k?"Loading...":l),error:Boolean(q),IconComponent:M},(()=>k?o().createElement(a.MenuItem,{disabled:!0},o().createElement(a.CircularProgress,{size:20})):0===v.length?o().createElement(a.MenuItem,{disabled:!0},o().createElement(a.ListItemText,{primary:d,slotProps:{primary:{sx:{fontSize:"16px",color:"#00000061"}}}})):o().createElement(o().Fragment,null,i&&o().createElement(o().Fragment,null,o().createElement(a.MenuItem,{value:"selectAll",sx:{backgroundColor:"#fafafa","&:hover":{backgroundColor:"#f0f0f0"}},onClick:()=>{P({target:{value:["selectAll"]}})}},o().createElement(a.Checkbox,{checked:I,indeterminate:C.length>0&&!I,sx:{p:1,"& svg":{fontSize:24}}}),o().createElement(a.ListItemText,{primary:u,slotProps:{primary:{sx:{fontSize:"16px"}}}})),o().createElement(a.Divider,null)),(()=>S.map(((e,t)=>[e.label&&o().createElement(a.ListSubheader,{key:`header-${e.id}`,sx:{fontWeight:400,fontSize:"14px",color:"#00000061",lineHeight:"24px",textTransform:"uppercase",letterSpacing:"0.17px",pointerEvents:"none"}},e.label),...e.options.map((e=>{const t=m(e),r=C.includes(t);return o().createElement(a.MenuItem,{key:t,value:t,sx:{pl:2},onClick:()=>{let e;e=I?v.filter((e=>m(e)!==t)).map(m):r?C.filter((e=>e!==t)):[...C,t],P({target:{value:e}})}},o().createElement(a.Checkbox,{checked:r,sx:{p:1,"& svg":{fontSize:24}}}),o().createElement(a.ListItemText,{primary:c(e),slotProps:{primary:{sx:{fontSize:"16px",fontStyle:"normal",fontWeight:400,lineHeight:"150%",letterSpacing:"0.15px"}}}}))})),e.label&&t<S.length-1&&o().createElement(a.Divider,{key:`divider-${e.id}`})])).flat().filter(Boolean))()))()),q&&o().createElement("div",{style:{color:"#d32f2f",fontSize:"0.75rem",marginTop:"3px"}},q))};m.propTypes={name:c().string.isRequired,queryFunction:c().func.isRequired,queryParams:c().array,placeholder:c().string,showSelectAll:c().bool,selectAllLabel:c().string,getOptionLabel:c().func,getOptionValue:c().func,getGroupId:c().func,getGroupLabel:c().func,noOptionsLabel:c().string,disabled:c().bool};const d=m;return l})()));
|
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wB,GAAQvE,EAAeuE,KAAS0B,IACxCtD,IAAI3C,GAEKkG,EACR1D,EAAeO,QAAQsD,GAAMA,IAAMJ,IACnC,IAAIzD,EAAgByD,GAE1B3D,EAAa,CAAEG,OAAQ,CAAEnD,MAAO8G,IAAhC,GAGF,kBAAC,EAAAjB,SAAD,CACEC,QAASc,EACT5C,GAAI,CACFgC,EAAG,EACH,QAAS,CACPN,SAAU,OAIhB,kBAAC,EAAAH,aAAD,CACEC,QAAShF,EAAekG,GACxBjB,UAAW,CACTD,QAAS,CACPxB,GAAI,CACF0B,SAAU,OACVsB,UAAW,SACXX,WAAY,IACZC,WAAY,OACZE,cAAe,cArC3B,IA6CFN,EAAMvD,OAASwD,EAAa5E,EAAe+B,OAAS,GAClD,kBAAC,EAAA2C,QAAD,CAAS/G,IAAM,WAAUgH,EAAMvF,UAGlCsG,OACAxD,OAAOG,SAsELsD,IAmCAC,IAEFpF,GACC,yBACEoD,MAAO,CACLC,MAAO,UACPM,SAAU,UACV0B,UAAW,QAGZrF,GAtCT,EA6CF9B,EAAqBoH,UAAY,CAC/BnH,KAAMoH,IAAAA,OAAiBC,WACvBpH,cAAemH,IAAAA,KAAeC,WAC9BnH,YAAakH,IAAAA,MACbjH,YAAaiH,IAAAA,OACbhH,cAAegH,IAAAA,KACf/G,eAAgB+G,IAAAA,OAChB9G,eAAgB8G,IAAAA,KAChB5G,eAAgB4G,IAAAA,KAChBzG,WAAYyG,IAAAA,KACZxG,cAAewG,IAAAA,KACf1G,eAAgB0G,IAAAA,OAChBvG,SAAUuG,IAAAA,MAGZ,U","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/ExpandMore\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material\"","webpack://openstack-uicore-foundation/external commonjs \"formik\"","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/mui/formik-inputs/mui-formik-select-group.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 ","module.exports = require(\"@mui/icons-material/ExpandMore\");","module.exports = require(\"@mui/material\");","module.exports = require(\"formik\");","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 2026 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, { useState, useEffect, useMemo } from \"react\";\nimport {\n MenuItem,\n Checkbox,\n ListItemText,\n CircularProgress,\n Select,\n OutlinedInput,\n Box,\n ListSubheader,\n Divider\n} from \"@mui/material\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\nimport PropTypes from \"prop-types\";\nimport { useField } from \"formik\";\n\nconst getCustomIcon = (loading) => () =>\n (\n <Box sx={{ display: \"flex\", alignItems: \"center\", pr: 1 }}>\n {loading && <CircularProgress size={16} sx={{ mr: 1 }} />}\n <ExpandMoreIcon />\n </Box>\n );\n\nconst MuiFormikSelectGroup = ({\n name,\n queryFunction,\n queryParams = [],\n placeholder = \"Select options\",\n showSelectAll = false,\n selectAllLabel = \"Select All\",\n getOptionLabel = (item) => item.name,\n getOptionValue = (item) => item.id,\n noOptionsLabel = \"No items\",\n getGroupId = null,\n getGroupLabel = null,\n disabled = false\n}) => {\n const [field, meta, helpers] = useField(name);\n const [options, setOptions] = useState([]);\n const [groupedOptions, setGroupedOptions] = useState([]);\n const [loading, setLoading] = useState(false);\n\n const isAllSelected =\n Array.isArray(field.value) && field.value.includes(\"all\");\n const value = isAllSelected ? options : field.value || [];\n const error = meta.touched && meta.error;\n\n const fetchOptions = async () => {\n setLoading(true);\n try {\n await queryFunction(...queryParams, (results) => {\n setOptions(results);\n\n if (getGroupId && getGroupLabel) {\n // using map no avoid duplicate groups\n const groupsMap = new Map();\n\n results.forEach((item) => {\n const groupId = getGroupId(item);\n const groupLabel = getGroupLabel(item);\n\n if (!groupsMap.has(groupId)) {\n groupsMap.set(groupId, {\n id: groupId,\n label: groupLabel,\n options: []\n });\n }\n\n groupsMap.get(groupId).options.push(item);\n });\n\n setGroupedOptions(Array.from(groupsMap.values()));\n } else {\n setGroupedOptions([\n {\n id: \"default\",\n label: null,\n options: results\n }\n ]);\n }\n setLoading(false);\n });\n } catch (error) {\n setLoading(false);\n }\n };\n\n useEffect(() => {\n fetchOptions();\n }, []);\n\n const handleChange = (event) => {\n const selectedValues = event.target.value;\n\n if (selectedValues.includes(\"selectAll\")) {\n const currentValues = Array.isArray(value)\n ? value.map(getOptionValue)\n : [];\n\n if (isAllSelected || currentValues.length === options.length) {\n helpers.setValue([]);\n } else {\n helpers.setValue([\"all\"]);\n }\n return;\n }\n\n const filteredValues = selectedValues.filter((val) => val !== \"selectAll\");\n\n const selectedItems = filteredValues\n .map((val) => {\n const found = options.find((item) => getOptionValue(item) === val);\n return found;\n })\n .filter(Boolean);\n\n helpers.setValue(selectedItems);\n };\n\n const selectedValues = isAllSelected\n ? options.map(getOptionValue)\n : Array.isArray(value)\n ? value.map((item) => getOptionValue(item))\n : [];\n\n const renderGroupedOptions = () =>\n groupedOptions\n .map((group, groupIndex) => [\n group.label && (\n <ListSubheader\n key={`header-${group.id}`}\n sx={{\n fontWeight: 400,\n fontSize: \"14px\",\n color: \"#00000061\",\n lineHeight: \"24px\",\n textTransform: \"uppercase\",\n letterSpacing: \"0.17px\",\n pointerEvents: \"none\"\n }}\n >\n {group.label}\n </ListSubheader>\n ),\n ...group.options.map((option) => {\n const optionValue = getOptionValue(option);\n const isChecked = selectedValues.includes(optionValue);\n\n return (\n <MenuItem\n key={optionValue}\n value={optionValue}\n sx={{ pl: 2 }}\n onClick={() => {\n let newValues;\n if (isAllSelected) {\n newValues = options\n .filter((opt) => getOptionValue(opt) !== optionValue)\n .map(getOptionValue);\n } else {\n newValues = isChecked\n ? selectedValues.filter((v) => v !== optionValue)\n : [...selectedValues, optionValue];\n }\n handleChange({ target: { value: newValues } });\n }}\n >\n <Checkbox\n checked={isChecked}\n sx={{\n p: 1,\n \"& svg\": {\n fontSize: 24\n }\n }}\n />\n <ListItemText\n primary={getOptionLabel(option)}\n slotProps={{\n primary: {\n sx: {\n fontSize: \"16px\",\n fontStyle: \"normal\",\n fontWeight: 400,\n lineHeight: \"150%\",\n letterSpacing: \"0.15px\"\n }\n }\n }}\n />\n </MenuItem>\n );\n }),\n group.label && groupIndex < groupedOptions.length - 1 && (\n <Divider key={`divider-${group.id}`} />\n )\n ])\n .flat()\n .filter(Boolean);\n\n const renderMenuContent = () => {\n if (loading) {\n return (\n <MenuItem disabled>\n <CircularProgress size={20} />\n </MenuItem>\n );\n }\n\n if (options.length === 0) {\n return (\n <MenuItem disabled>\n <ListItemText\n primary={noOptionsLabel}\n slotProps={{\n primary: {\n sx: {\n fontSize: \"16px\",\n color: \"#00000061\"\n }\n }\n }}\n />\n </MenuItem>\n );\n }\n\n return (\n <>\n {showSelectAll && (\n <>\n <MenuItem\n value=\"selectAll\"\n sx={{\n backgroundColor: \"#fafafa\",\n \"&:hover\": {\n backgroundColor: \"#f0f0f0\"\n }\n }}\n onClick={() => {\n // custom event value to select all\n handleChange({ target: { value: [\"selectAll\"] } });\n }}\n >\n <Checkbox\n checked={isAllSelected}\n indeterminate={selectedValues.length > 0 && !isAllSelected}\n sx={{\n p: 1,\n \"& svg\": {\n fontSize: 24\n }\n }}\n />\n <ListItemText\n primary={selectAllLabel}\n slotProps={{\n primary: {\n sx: {\n fontSize: \"16px\"\n }\n }\n }}\n />\n </MenuItem>\n <Divider />\n </>\n )}\n {renderGroupedOptions()}\n </>\n );\n };\n\n const IconWithLoading = useMemo(() => getCustomIcon(loading), [loading]);\n\n return (\n <>\n <Select\n multiple\n fullWidth\n value={selectedValues}\n onChange={handleChange}\n input={<OutlinedInput />}\n displayEmpty\n disabled={disabled || loading}\n renderValue={(selected) => {\n if (!selected || selected.length === 0) {\n return (\n <span style={{ color: \"#aaa\" }}>\n {loading ? \"Loading...\" : placeholder}\n </span>\n );\n }\n return selected\n .map((val) => {\n const item = options.find((opt) => getOptionValue(opt) === val);\n return item ? getOptionLabel(item) : val;\n })\n .join(\", \");\n }}\n error={Boolean(error)}\n IconComponent={IconWithLoading}\n >\n {renderMenuContent()}\n </Select>\n {error && (\n <div\n style={{\n color: \"#d32f2f\",\n fontSize: \"0.75rem\",\n marginTop: \"3px\"\n }}\n >\n {error}\n </div>\n )}\n </>\n );\n};\n\nMuiFormikSelectGroup.propTypes = {\n name: PropTypes.string.isRequired,\n queryFunction: PropTypes.func.isRequired,\n queryParams: PropTypes.array,\n placeholder: PropTypes.string,\n showSelectAll: PropTypes.bool,\n selectAllLabel: PropTypes.string,\n getOptionLabel: PropTypes.func,\n getOptionValue: PropTypes.func,\n getGroupId: PropTypes.func,\n getGroupLabel: PropTypes.func,\n noOptionsLabel: PropTypes.string,\n disabled: PropTypes.bool\n};\n\nexport default MuiFormikSelectGroup;\n"],"names":["root","factory","exports","module","define","amd","this","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","MuiFormikSelectGroup","name","queryFunction","queryParams","placeholder","showSelectAll","selectAllLabel","getOptionLabel","item","getOptionValue","id","noOptionsLabel","getGroupId","getGroupLabel","disabled","field","meta","helpers","useField","options","setOptions","useState","groupedOptions","setGroupedOptions","loading","setLoading","isAllSelected","Array","isArray","includes","error","touched","useEffect","async","results","groupsMap","Map","forEach","groupId","groupLabel","has","set","label","push","from","values","fetchOptions","handleChange","event","selectedValues","target","currentValues","map","length","setValue","selectedItems","filter","val","find","Boolean","IconWithLoading","useMemo","Box","sx","display","alignItems","pr","CircularProgress","size","mr","getCustomIcon","Select","multiple","fullWidth","onChange","input","OutlinedInput","displayEmpty","renderValue","selected","opt","join","style","color","IconComponent","MenuItem","ListItemText","primary","slotProps","fontSize","backgroundColor","onClick","Checkbox","checked","indeterminate","p","Divider","group","groupIndex","ListSubheader","fontWeight","lineHeight","textTransform","letterSpacing","pointerEvents","option","optionValue","isChecked","pl","newValues","v","fontStyle","flat","renderGroupedOptions","renderMenuContent","marginTop","propTypes","PropTypes","isRequired"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},692:e=>{e.exports=require("@mui/icons-material/Clear")},8619:e=>{e.exports=require("@mui/material")},3294:e=>{e.exports=require("formik")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")}},r={};function t(o){var l=r[o];if(void 0!==l)return l.exports;var n=r[o]={exports:{}};return e[o](n,n.exports,t),n.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};t.r(o),t.d(o,{default:()=>h});var l=t(6031),n=t.n(l),a=t(2462),i=t.n(a),u=t(2015),s=t.n(u),p=t(9825),d=t.n(p),c=t(8619),m=t(692),b=t.n(m),f=t(3294);const x=["name","label","placeholder","children","isClearable"],y=e=>{let{name:r,label:t,placeholder:o,children:l,isClearable:a}=e,u=i()(e,x);const[p,d,m]=(0,f.useField)(r),y=(null==p?void 0:p.value)&&""!==p.value||Boolean(o);return s().createElement(c.FormControl,{fullWidth:!0,error:d.touched&&Boolean(d.error)},t&&s().createElement(c.InputLabel,{htmlFor:r,id:`${r}-label`,shrink:y},t),s().createElement(c.Select,n()({name:r,id:r},p,{labelId:`${r}-label`,label:t,notched:y,displayEmpty:!0,renderValue:e=>e&&""!==e?e:s().createElement("span",{style:{color:"#aaa"}},o),endAdornment:a&&p.value?s().createElement(c.InputAdornment,{position:"end",sx:{mr:2}},s().createElement(c.IconButton,{size:"small",onClick:e=>{e.stopPropagation(),m.setValue("")}},s().createElement(b(),{fontSize:"small"}))):null},u),l),d.touched&&d.error&&s().createElement(c.FormHelperText,null,d.error))};y.propTypes={name:d().string.isRequired,children:d().node.isRequired,placeholder:d().string,isClearable:d().bool};const h=y;return o})()));
|
|
2
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/mui/formik-inputs/select.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,mCCTTH,EAAOD,QAAUK,QAAQ,iC,WCAzBJ,EAAOD,QAAUK,QAAQ,iD,UCAzBJ,EAAOD,QAAUK,QAAQ,4B,WCAzBJ,EAAOD,QAAUK,QAAQ,gB,WCAzBJ,EAAOD,QAAUK,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EAACC,MAAOP,EAAKQ,SAAWJ,QAAQJ,EAAKO,QACxDb,GACC,kBAAC,EAAAe,WAAD,CAAYC,QAASjB,EAAMkB,GAAK,GAAElB,UAAcmB,OAAQT,GACrDT,GAGL,kBAAC,EAAAmB,OAAD,KACEpB,KAAMA,EACNkB,GAAIlB,GAEAM,EAJN,CAKEe,QAAU,GAAErB,UACZC,MAAOA,EACPqB,QAASZ,EACTa,cAAY,EACZC,YAAcC,GACPA,GAAyB,KAAbA,EAGVA,EAFE,0BAAMC,MAAO,CAAEC,MAAO,SAAWzB,GAI5C0B,aACExB,GAAeE,EAAMR,MACnB,kBAAC,EAAA+B,eAAD,CAAgBC,SAAS,MAAMC,GAAI,CAAEC,GAAI,IACvC,kBAAC,EAAAC,WAAD,CAAYC,KAAK,QAAQC,QAjChBC,IACnBA,EAAGC,kBACH7B,EAAQ8B,SAAS,GAAjB,GAgCY,kBAAC,IAAD,CAAWC,SAAS,YAGtB,MAGFlC,GAEHF,GAEFI,EAAKQ,SAAWR,EAAKO,OACpB,kBAAC,EAAA0B,eAAD,KAAiBjC,EAAKO,OArC5B,EA2CFf,EAAgB0C,UAAY,CAC1BzC,KAAM0C,IAAAA,OAAiBC,WACvBxC,SAAUuC,IAAAA,KAAeC,WACzBzC,YAAawC,IAAAA,OACbtC,YAAasC,IAAAA,MAGf,U","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","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 \"@mui/icons-material/Clear\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material\"","webpack://openstack-uicore-foundation/external commonjs \"formik\"","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/mui/formik-inputs/mui-formik-select.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 ","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"@mui/icons-material/Clear\");","module.exports = require(\"@mui/material\");","module.exports = require(\"formik\");","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 2026 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 PropTypes from \"prop-types\";\nimport {\n Select,\n FormHelperText,\n FormControl,\n InputAdornment,\n IconButton,\n InputLabel\n} from \"@mui/material\";\nimport ClearIcon from \"@mui/icons-material/Clear\";\nimport { useField } from \"formik\";\n\nconst MuiFormikSelect = ({\n name,\n label,\n placeholder,\n children,\n isClearable,\n ...rest\n}) => {\n const [field, meta, helpers] = useField(name);\n\n const handleClear = (ev) => {\n ev.stopPropagation();\n helpers.setValue(\"\");\n };\n\n const hasValue = field?.value && field.value !== \"\";\n const shouldShrink = hasValue || Boolean(placeholder);\n\n return (\n <FormControl fullWidth error={meta.touched && Boolean(meta.error)}>\n {label && (\n <InputLabel htmlFor={name} id={`${name}-label`} shrink={shouldShrink}>\n {label}\n </InputLabel>\n )}\n <Select\n name={name}\n id={name}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...field}\n labelId={`${name}-label`}\n label={label}\n notched={shouldShrink}\n displayEmpty\n renderValue={(selected) => {\n if (!selected || selected === \"\") {\n return <span style={{ color: \"#aaa\" }}>{placeholder}</span>;\n }\n return selected;\n }}\n endAdornment={\n isClearable && field.value ? (\n <InputAdornment position=\"end\" sx={{ mr: 2 }}>\n <IconButton size=\"small\" onClick={handleClear}>\n <ClearIcon fontSize=\"small\" />\n </IconButton>\n </InputAdornment>\n ) : null\n }\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...rest}\n >\n {children}\n </Select>\n {meta.touched && meta.error && (\n <FormHelperText>{meta.error}</FormHelperText>\n )}\n </FormControl>\n );\n};\n\nMuiFormikSelect.propTypes = {\n name: PropTypes.string.isRequired,\n children: PropTypes.node.isRequired,\n placeholder: PropTypes.string,\n isClearable: PropTypes.bool\n};\n\nexport default MuiFormikSelect;\n"],"names":["root","factory","exports","module","define","amd","this","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","MuiFormikSelect","name","label","placeholder","children","isClearable","rest","field","meta","helpers","useField","shouldShrink","Boolean","FormControl","fullWidth","error","touched","InputLabel","htmlFor","id","shrink","Select","labelId","notched","displayEmpty","renderValue","selected","style","color","endAdornment","InputAdornment","position","sx","mr","IconButton","size","onClick","ev","stopPropagation","setValue","fontSize","FormHelperText","propTypes","PropTypes","isRequired"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={5097:(e,r,a)=>{a(1116),a(6842),a(9087),a(9558),a(2183)},3195:(e,r,a)=>{a.d(r,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>t,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>n,AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR:()=>d,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>i});const t="AUTH_ERROR_MISSING_AUTH_INFO",n="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",i="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR",d="AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR"},2183:(e,r,a)=>{a.d(r,{getAccessToken:()=>R});var t=a(9558),n=a(5812),o=a.n(n);a(806);const s=require("browser-tabs-lock");var i=a.n(s);const d=require("js-cookie");var u=a.n(d),l=(a(8041),a(9891),a(5097),a(8853),a(3195));const Lock=new(i()),GET_TOKEN_SILENTLY_LOCK_KEY="openstackuicore.lock.getTokenSilently",c="code",p="authInfo",y="idToken",m=async(e,r)=>{if(e===c&&h()){if(!r)throw w(),Error(l.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await(async(e,r=5,a=1e3)=>{for(let t=0;t<r;t++)try{return await e()}catch(e){if(!e.message||!e.message.startsWith(l.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR)||t===r-1)throw e;const n=a*Math.pow(2,t);console.log(`retryWithBackoff retry ${t+1}/${r} in ${n}ms`),await new Promise((e=>setTimeout(e,n)))}})((()=>f(r))),{access_token:a,expires_in:t,refresh_token:n,id_token:o}=e;return void 0===n&&(n=null),g(a,t,n,o),a}throw w(),Error(l.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)},_=async()=>{console.log("openstack-uicore-foundation::Security::methods::_getAccessToken");let e=E();if(!e)throw console.log("openstack-uicore-foundation::Security::methods::_getAccessToken AUTH_ERROR_MISSING_AUTH_INFO"),Error(l.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:r,expiresIn:a,accessTokenUpdatedAt:t,refreshToken:n}=e,s=Q();const i=o()().unix();let d=i-t;return a-=60,console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken now ${i} accessTokenUpdatedAt ${t} expiresIn ${a} timeElapsedSecs ${d}`),(d>=a||null==r)&&(console.log("openstack-uicore-foundation::Security::methods::_getAccessToken access token expired, refreshing it ..."),r=await m(s,n)),r},R=async()=>{if("undefined"!=typeof navigator&&navigator.locks)return await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY,(async e=>(console.log("openstack-uicore-foundation::Security::methods::getAccessToken web lock api",e),await _())));if(!await(0,t.retryPromise)((()=>Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY,6e3)),10))throw Error(l.AUTH_ERROR_LOCK_ACQUIRE_ERROR);try{return await _()}finally{await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY)}},f=async e=>{let r=T(),a=O();const n={grant_type:"refresh_token",client_id:encodeURI(a),refresh_token:e},o=new AbortController,s=setTimeout((()=>o.abort()),1e4);let i,d;try{i=await fetch(`${r}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n),signal:o.signal})}catch(e){throw console.log("refreshAccessToken network error:",e.message),Error(`${l.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${e.message}`)}finally{clearTimeout(s)}if(!i.ok){if(console.log(`refreshAccessToken server error: ${i.status} - ${i.statusText}`),i.status>=500||408===i.status||429===i.status)throw Error(`${l.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${i.status} - ${i.statusText}`);throw(0,t.setSessionClearingState)(!0),Error(`${l.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${i.status} - ${i.statusText}`)}try{d=await i.json()}catch(e){throw Error(`${l.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: invalid JSON response from IDP`)}let{access_token:u,refresh_token:c,expires_in:p,id_token:y}=d;if(!u)throw(0,t.setSessionClearingState)(!0),Error(`${l.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: missing access_token in refresh response`);return{access_token:u,refresh_token:c,expires_in:p,id_token:y}},g=(e,r,a=null,n=null)=>{let o=E(),s={accessToken:e,expiresIn:r,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null==a&&o&&(a=o.refreshToken),null==n&&o&&(n=o.idToken),a&&(s.refreshToken=a),n?(s[y]=n,u().set(y,n,{secure:!0,sameSite:"Lax"})):u().remove(y),(0,t.putOnLocalStorage)(p,JSON.stringify(s))},E=()=>{try{let e=(0,t.getFromLocalStorage)(p,!1);return e?JSON.parse(e):null}catch(e){return null}},w=()=>{"undefined"!=typeof window&&((0,t.removeFromLocalStorage)(p),u().remove(y))},O=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,Q=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",h=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),T=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},9087:(e,r,a)=>{a.d(r,{escapeFilterValue:()=>p,fetchErrorHandler:()=>l,fetchResponseHandler:()=>c});a(2462),a(1116),a(806);var t=a(8041),n=a.n(t),o=a(9236),s=a.n(o),i=a(6842),d=a.n(i);a(9558),a(5097),a(2183),a(3209);n().escapeQuerySpace=!1;const u=e=>r=>({type:e,payload:r}),l=(u("RESET_LOADING"),u("START_LOADING"),u("STOP_LOADING"),e=>{let r=e.status,a=e.statusText;switch(r){case 403:s().fire("ERROR",d().translate("errors.user_not_authz"),"warning");break;case 401:s().fire("ERROR",d().translate("errors.session_expired"),"error");break;case 412:s().fire("ERROR",a,"warning");case 500:s().fire("ERROR",d().translate("errors.server_error"),"error")}}),c=e=>{if(e.ok)return e.json();throw e},p=e=>e=(e=(e=(e=(e=String(e)).replace(/\\/g,"\\\\")).replace(/,/g,"\\,")).replace(/;/g,"\\;")).replace(/\+/g,"%2B")},3209:(e,r,a)=>{a.d(r,{Vg:()=>s,WU:()=>o,mH:()=>t,wU:()=>n});const t=250,n=500,o=10,s=100},8853:()=>{require("spark-md5"),require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto)},9558:(e,r,a)=>{a.d(r,{buildAPIBaseUrl:()=>t,getFromLocalStorage:()=>o,putOnLocalStorage:()=>n,removeFromLocalStorage:()=>s,retryPromise:()=>d,setSessionClearingState:()=>i});a(5812),a(8041);const t=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,n=(e,r)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,r)},o=(e,r)=>{if("undefined"!=typeof window){let a=window.localStorage.getItem(e);return r&&(console.log(`getFromLocalStorage removing key ${e}`),s(e)),a}return null},s=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},d=async(e,r=3)=>{for(let a=0;a<r;a++)if(await e())return!0;return!1}},3582:(e,r,a)=>{a.d(r,{querySponsorsV2:()=>m});var t=a(9087),n=a(2183),o=a(9558),s=a(7825),i=a.n(s),d=(a(5812),a(8041)),u=a.n(d),l=a(3209);u().escapeQuerySpace=!1;const c=async(e,r,a={})=>fetch((0,o.buildAPIBaseUrl)(e.toString()),a).then(t.fetchResponseHandler).then((e=>{"function"==typeof r&&r(e.data)})).catch((e=>(404===e.status&&r([]),e))).catch(t.fetchErrorHandler),p=async(e,r={})=>{let a;try{a=await(0,n.getAccessToken)()}catch(e){return Promise.reject(e)}return e.addQuery("access_token",a),fetch((0,o.buildAPIBaseUrl)(e.toString()),r).then(t.fetchResponseHandler).catch(t.fetchErrorHandler)},y=async(e,r,a={})=>{let t;try{t=await(0,n.getAccessToken)()}catch(e){return"function"==typeof r&&r(e),Promise.reject()}return e.addQuery("access_token",t),c(e,r,a)},m=(i().debounce((async(e,r,a=l.WU)=>{let n=u()("/api/v1/members");n.addQuery("expand","tickets,rsvp,schedule_summit_events,all_affiliations"),n.addQuery("order","first_name,last_name"),n.addQuery("page",1),n.addQuery("per_page",a),e&&(e=(0,t.escapeFilterValue)(e),n.addQuery("filter[]",`full_name@@${e},first_name@@${e},last_name@@${e},email@@${e}`)),y(n,r)}),l.wU),i().debounce((async(e,r,a,n=l.WU)=>{let o=u()(`/api/v1/summits/${e}/attendees`);o.addQuery("order","first_name,last_name"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,t.escapeFilterValue)(r),o.addQuery("filter[]",`full_name=@${r},email=@${r}`)),y(o,a)}),l.wU),i().debounce((async(e,r,a=l.WU)=>{let n=u()("/api/v1/summits/all");n.addQuery("expand","tickets,rsvp,schedule_summit_events,all_affiliations"),n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",a),e&&(e=(0,t.escapeFilterValue)(e),n.addQuery("filter[]",`name@@${e}`)),y(n,r)}),l.wU),i().debounce((async(e,r,a,n=l.WU)=>{let o=u()("/api/v1/"+(e?`summits/${e}/speakers`:"speakers"));o.addQuery("expand","member,registration_request"),o.addQuery("order","first_name,last_name"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,t.escapeFilterValue)(r),o.addQuery("filter[]",`full_name@@${r},first_name@@${r},last_name@@${r},email@@${r}`)),y(o,a)}),l.wU),i().debounce((async(e,r,a,n=50)=>{let o=u()("/api/v1/"+(e?`summits/${e}/track-tag-groups/all/allowed-tags`:"tags"));e&&o.addQuery("expand","tag,track_tag_group"),o.addQuery("order","tag"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,t.escapeFilterValue)(r),o.addQuery("filter[]",`tag@@${r}`)),y(o,a)}),l.wU),i().debounce((async(e,r,a,n=[],o=l.WU)=>{let s=u()(`/api/v1/summits/${e}/tracks`);s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",o),(null==n?void 0:n.length)>0&&s.addQuery("filter[]",`not_id==${n.join("||")}`),r&&(r=(0,t.escapeFilterValue)(r),s.addQuery("filter[]",`name@@${r}`)),y(s,a)}),l.wU),i().debounce((async(e,r,a,n=l.WU)=>{let o=u()(`/api/v1/summits/${e}/track-groups`);o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,t.escapeFilterValue)(r),o.addQuery("filter[]",`name@@${r}`)),y(o,a)}),l.wU),i().debounce((async(e,r,a=!1,n,o=l.WU)=>{let s=u()(`/api/v1/summits/${e}/events`+(a?"/published":""));s.addQuery("order","title"),s.addQuery("page",1),s.addQuery("per_page",o),r&&(r=(0,t.escapeFilterValue)(r),s.addQuery("filter[]",`title@@${r}`)),y(s,n)}),l.wU),i().debounce((async(e,r,a,n=null,o=l.WU)=>{let s=u()(`/api/v1/summits/${e}/event-types`);s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",o),r&&(r=(0,t.escapeFilterValue)(r),s.addQuery("filter[]",`name@@${r}`)),n&&(n=(0,t.escapeFilterValue)(n),s.addQuery("filter[]",`class_name==${n}`)),y(s,a)}),l.wU),i().debounce((async(e,r,a=l.WU)=>{let n=u()("/api/v1/groups");n.addQuery("order","title,code"),n.addQuery("page",1),n.addQuery("per_page",a),e&&(e=(0,t.escapeFilterValue)(e),n.addQuery("filter[]",`title@@${e},code@@${e}`)),y(n,r)}),l.wU),i().debounce((async(e,r,a=l.WU)=>{let n=u()("/api/v1/companies");n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",a),e&&(e=(0,t.escapeFilterValue)(e),n.addQuery("filter[]",`name@@${e}`)),y(n,r)}),l.wU),i().debounce((async(e,r,a,n=l.WU)=>{let o=u()(`/api/v1/summits/${e}/registration-companies`);o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,t.escapeFilterValue)(r),o.addQuery("filter[]",`name@@${r}`)),y(o,a)}),l.wU),i().debounce((async(e,r,a,n=l.WU)=>{let o=u()(`/api/v1/summits/${e}/sponsors`);o.addQuery("expand","company,sponsorship,sponsorship.type"),o.addQuery("order","id"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,t.escapeFilterValue)(r),o.addQuery("filter[]",`company_name@@${r}`)),y(o,a)}),l.wU),i().debounce((async(e,r,a)=>{const n=u()(`/api/v2/summits/${r}/sponsors`),o=(0,t.escapeFilterValue)(e);n.addQuery("fields","id,company.name,company.id"),n.addQuery("relations","company"),n.addQuery("expand","company"),o&&n.addQuery("filter",`company_name=@${o}`),p(n).then((e=>{const r=[...e.data].map((e=>({id:e.id,name:e.company.name})));a(r)})).catch(t.fetchErrorHandler)}),l.wU));i().debounce((async(e,r,a,n=l.WU)=>{let o=u()(`/api/v1/summits/${e}/sponsors`);o.addQuery("expand","company,sponsorship,sponsorship.type"),o.addQuery("fields","id,company.name,sponsorship.type.name"),o.addQuery("relations","none,company.none,sponsorship.type.none"),o.addQuery("filter[]","badge_scans_count>0"),o.addQuery("order","+company_name"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,t.escapeFilterValue)(r),o.addQuery("filter[]",`company_name@@${r}`)),y(o,a)}),l.wU),i().debounce((async(e,r,a,n=l.WU)=>{let o=u()(`/api/v1/summits/${e}/access-level-types`);o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,t.escapeFilterValue)(r),o.addQuery("filter[]",`name@@${r}`)),y(o,a)}),l.wU),i().debounce((async(e,r,a=l.WU)=>{let n=u()("/api/v1/organizations");n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",a),e&&(e=(0,t.escapeFilterValue)(e),n.addQuery("filter[]",`name@@${e}`)),y(n,r)}),l.wU);i().debounce((async(e,r={},a,n="v1",o=l.WU)=>{let s=u()(`/api/${n}/summits/${e}/ticket-types`);if(s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",o),r.hasOwnProperty("name")){const e=(0,t.escapeFilterValue)(r.name);e&&""!=e&&s.addQuery("filter[]",`name@@${e}`)}if(r.hasOwnProperty("audience")){const e=(0,t.escapeFilterValue)(r.audience);e&&""!=e&&s.addQuery("filter[]",`audience==${e}`)}y(s,a)}),l.wU),i().debounce((async(e,r,a=l.WU)=>{const n=u()("/api/v1/sponsored-projects");n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",a),e&&(e=(0,t.escapeFilterValue)(e),n.addQuery("filter[]",`name@@${e}`)),y(n,r)}),l.wU),i().debounce((async(e,r,a,n=l.WU,o=[])=>{let s=u()(`/api/v1/summits/${e}/promo-codes`);s.addQuery("order","code"),s.addQuery("page",1),s.addQuery("per_page",n),r&&(r=(0,t.escapeFilterValue)(r),s.addQuery("filter[]",`code@@${r}`));for(const e of o)s.addQuery("filter[]",e);y(s,a)}),l.wU),i().debounce((async(e,r)=>{const a=u()("/api/v1/sponsorship-types");(e=(0,t.escapeFilterValue)(e))&&a.addQuery("filter",`name=@${e}`),y(a,r)}),l.wU),i().debounce((async(e,r,a)=>{const n=u()(`/api/v1/summits/${r}/sponsorships-types`);e=(0,t.escapeFilterValue)(e),n.addQuery("page",1),n.addQuery("per_page",l.Vg),n.addQuery("expand","type"),n.addQuery("order","+name"),e&&n.addQuery("filter",`name=@${e}`),y(n,a)}),l.wU)},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},1858:e=>{e.exports=require("@mui/icons-material/ExpandMore")},1616:e=>{e.exports=require("@mui/material/Autocomplete")},6658:e=>{e.exports=require("@mui/material/CircularProgress")},7633:e=>{e.exports=require("@mui/material/TextField")},3294:e=>{e.exports=require("formik")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9891:e=>{e.exports=require("idtoken-verifier")},7825:e=>{e.exports=require("lodash")},5812:e=>{e.exports=require("moment-timezone")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")},806:e=>{e.exports=require("superagent/lib/client")},9236:e=>{e.exports=require("sweetalert2")},8041:e=>{e.exports=require("urijs")}},r={};function a(t){var n=r[t];if(void 0!==n)return n.exports;var o=r[t]={exports:{}};return e[t](o,o.exports,a),o.exports}(()=>{a.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return a.d(r,{a:r}),r}})(),(()=>{a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})}})(),(()=>{a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var t={};a.r(t),a.d(t,{default:()=>k});var n=a(6031),o=a.n(n),s=a(1116),i=a.n(s),d=a(2462),u=a.n(d),l=a(2015),c=a.n(l),p=a(9825),y=a.n(p),m=a(7633),_=a.n(m),R=a(1616),f=a.n(R),g=a(6658),E=a.n(g),w=a(1858),O=a.n(w),Q=a(3294),h=a(3582),T=a(3209);const S=["id","name","placeholder","plainValue","isMulti","summitId"];function U(e,r){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),a.push.apply(a,t)}return a}function b(e){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?U(Object(a),!0).forEach((function(r){i()(e,r,a[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):U(Object(a)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))}))}return e}const v=e=>{let{id:r,name:a,placeholder:t,plainValue:n,isMulti:s=!1,summitId:i}=e,d=u()(e,S);const[p,y,m]=(0,Q.useField)(a),[R,g]=(0,l.useState)([]),[w,U]=(0,l.useState)(!1),[v,k]=(0,l.useState)(""),[$,A]=(0,l.useState)(!1),{value:x}=p,H=y.touched&&y.error;(0,l.useEffect)((()=>{if(v){const e=setTimeout((()=>{(async e=>{if(!e)return void g([]);A(!0),await(0,h.querySponsorsV2)(e,i,(e=>{g((e=>e.map((e=>({value:e.id.toString(),label:e.name}))))(e)),A(!1)}))})(v)}),T.mH);return()=>clearTimeout(e)}}),[v]);const F=(0,l.useMemo)((()=>{var e;return x?s?x.map((e=>{var r;return n?{value:e,label:e}:{value:null===(r=e.id)||void 0===r?void 0:r.toString(),label:e.name}})):n?{value:x,label:x}:{value:null===(e=x.id)||void 0===e?void 0:e.toString(),label:x.name}:s?[]:null}),[x,n,s]),I=H&&("string"==typeof H?H:H[Object.keys(H)[0]]);return c().createElement(f(),o()({open:w,onOpen:()=>U(!0),onClose:()=>U(!1),options:R,value:F,getOptionLabel:e=>e.label,isOptionEqualToValue:(e,r)=>e.value===r.value,onInputChange:(e,r)=>{k(r)},multiple:s,onChange:(e,r)=>{let a;a=!r||Array.isArray(r)&&0===r.length?s?[]:n?"":{id:"",name:""}:s?n?r.map((e=>e.label)):r.map((e=>({id:parseInt(e.value),name:e.label}))):n?r.label:{id:parseInt(r.value),name:r.label},m.setValue(a)},loading:$,fullWidth:!0,popupIcon:c().createElement(O(),null),renderInput:e=>{var r;return c().createElement(_(),o()({},e,{name:p.name,placeholder:t,variant:"outlined",error:Boolean(H),helperText:I||"",slotProps:b(b({},e.InputProps),{},{inputLabel:{shrink:!1},sx:{"& input::placeholder":{color:"#00000061",opacity:1}},endAdornment:c().createElement(c().Fragment,null,$&&c().createElement(E(),{color:"inherit",size:20}),null===(r=e.InputProps)||void 0===r?void 0:r.endAdornment)})}))}},d))};v.propTypes={id:y().string,name:y().string.isRequired,placeholder:y().string,plainValue:y().bool,isMulti:y().bool};const k=v;return t})()));
|
|
2
|
+
//# sourceMappingURL=sponsor-input.js.map
|