openstack-uicore-foundation 5.0.50-beta.0 → 5.0.50
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/.claude/rules/openstack-uicore-foundation-components.md +67 -0
- package/.claude/rules/openstack-uicore-foundation-project.md +69 -0
- package/.claude/rules/openstack-uicore-foundation-security.md +39 -0
- package/.claude/settings.local.json +7 -0
- package/.codegraph/.gitignore +5 -0
- package/docs/plans/2026-04-09-showconfirmdialog-react16-compat.md +83 -0
- package/docs/plans/2026-04-22-dropzone-pooling-ux.md +129 -0
- package/docs/plans/2026-04-23-uploadv3-duplicate-file-max-reached.md +109 -0
- package/docs/plans/2026-04-23-uploadv3-premature-complete-on-202.md +99 -0
- package/docs/plans/2026-07-06-file-size-field-unit-prop.md +20 -0
- package/docs/plans/2026-07-30-node-22-migration.md +139 -0
- package/docs/plans/clickup-barrel-mui-dragalong.md +43 -0
- package/docs/plans/clickup-order-ledger-extraction.md +44 -0
- package/docs/plans/clickup-uploadv3-progress-bar-large-files.md +42 -0
- package/lib/components/index.js +1 -1
- package/lib/components/index.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/alert-modal.js +1 -1
- package/lib/components/mui/alert-modal.js.map +1 -1
- package/lib/components/mui/custom-dialog.js +1 -1
- package/lib/components/mui/custom-dialog.js.map +1 -1
- package/lib/components/mui/formik-inputs/upload.js +1 -1
- package/lib/components/mui/formik-inputs/upload.js.map +1 -1
- package/lib/components/mui/item-settings-modal.js +1 -1
- package/lib/components/mui/item-settings-modal.js.map +1 -1
- package/lib/components/mui/notes-modal.js +1 -1
- package/lib/components/mui/notes-modal.js.map +1 -1
- package/lib/components/mui/upload-dialog.js +1 -1
- package/lib/components/mui/upload-dialog.js.map +1 -1
- package/package.json +1 -1
- package/package-lock.json +0 -22291
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={6969:(e,t,o)=>{o.d(t,{default:()=>
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={6969:(e,t,o)=>{o.d(t,{default:()=>p});var n=o(2015),r=o.n(n),i=o(9825),l=o.n(i),a=o(8619),s=o(4325),c=o.n(s);const u=({title:e,open:t,onClose:o,maxWidth:i,fullWidth:l,primaryAction:s,secondaryAction:u,children:d})=>{const[p,f]=(0,n.useState)(!1),m=(0,n.useRef)(!0);(0,n.useEffect)((()=>(m.current=!0,()=>{m.current=!1})),[]);const b=e=>{if(p)return;const t=e.onClick();t&&"function"==typeof t.then&&(f(!0),Promise.resolve(t).catch((()=>{})).finally((()=>{m.current&&f(!1)})))},y=()=>{p||o()};return r().createElement(a.Dialog,{open:t,onClose:y,maxWidth:i,fullWidth:l,disableEscapeKeyDown:p},r().createElement(a.DialogTitle,null,e),r().createElement(a.IconButton,{"aria-label":"close",onClick:y,disabled:p,size:"small",sx:e=>({position:"absolute",right:12,top:12,color:e.palette.grey[500]})},r().createElement(c(),{fontSize:"large"})),r().createElement(a.Divider,null),r().createElement(a.DialogContent,null,d),(s||u)&&r().createElement(a.DialogActions,null,u&&r().createElement(a.Button,{variant:"outlined",onClick:()=>b(u),disabled:p||u.disabled},u.label),s&&r().createElement(a.Button,{variant:"contained",onClick:()=>b(s),disabled:p||s.disabled,startIcon:p?r().createElement(a.CircularProgress,{size:16,color:"inherit"}):null},s.label)))},d=l().shape({label:l().node.isRequired,onClick:l().func.isRequired,disabled:l().bool});u.propTypes={title:l().node.isRequired,open:l().bool.isRequired,onClose:l().func.isRequired,maxWidth:l().oneOf(["xs","sm","md","lg","xl",!1]),fullWidth:l().bool,primaryAction:d,secondaryAction:d,children:l().node.isRequired},u.defaultProps={maxWidth:"sm",fullWidth:!0,primaryAction:null,secondaryAction:null};const p=u},4325:e=>{e.exports=require("@mui/icons-material/Close")},8619:e=>{e.exports=require("@mui/material")},9870:e=>{e.exports=require("i18n-react")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,o),i.exports}(()=>{o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t}})(),(()=>{o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(()=>{o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var n={};o.r(n),o.d(n,{default:()=>f});var r=o(2015),i=o.n(r),l=o(9825),a=o.n(l),s=o(9870),c=o.n(s),u=o(8619),d=o(6969);const p=({title:e,message:t,open:o,onClose:n})=>i().createElement(d.default,{title:e,open:o,onClose:n,primaryAction:{label:c().translate("general.ok"),onClick:n}},i().createElement(u.DialogContentText,null,t));p.propTypes={title:a().string.isRequired,message:a().string.isRequired,open:a().bool.isRequired,onClose:a().func.isRequired};const f=p;return n})()));
|
|
2
2
|
//# sourceMappingURL=alert-modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/mui/alert-modal.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAA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,KAAeC,YAG1B,U","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/mui/CustomDialog/index.js","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Close\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"prop-types\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/mui/AlertModal/index.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 { Dialog, DialogTitle, Divider, IconButton } from \"@mui/material\";\nimport CloseIcon from \"@mui/icons-material/Close\";\n\nconst CustomDialog = ({ title, open, onClose, maxWidth, fullWidth, children }) => (\n <Dialog open={open} onClose={onClose} maxWidth={maxWidth} fullWidth={fullWidth}>\n <DialogTitle>{title}</DialogTitle>\n <IconButton\n aria-label=\"close\"\n onClick={onClose}\n size=\"small\"\n sx={(theme) => ({\n position: \"absolute\",\n right: 12,\n top: 12,\n color: theme.palette.grey[500]\n })}\n >\n <CloseIcon fontSize=\"large\" />\n </IconButton>\n <Divider />\n {children}\n </Dialog>\n);\n\nCustomDialog.propTypes = {\n title: PropTypes.node.isRequired,\n open: PropTypes.bool.isRequired,\n onClose: PropTypes.func.isRequired,\n maxWidth: PropTypes.oneOf([\"xs\", \"sm\", \"md\", \"lg\", \"xl\", false]),\n fullWidth: PropTypes.bool,\n children: PropTypes.node.isRequired\n};\n\nCustomDialog.defaultProps = {\n maxWidth: \"sm\",\n fullWidth: true\n};\n\nexport default CustomDialog;\n","module.exports = require(\"@mui/icons-material/Close\");","module.exports = require(\"@mui/material\");","module.exports = require(\"i18n-react\");","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Copyright 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 T from \"i18n-react\";\nimport { Divider, Button, DialogActions, DialogContent, DialogContentText } from \"@mui/material\";\nimport CustomDialog from \"../CustomDialog\";\n\nconst AlertModal = ({ title, message, open, onClose }) => {\n return (\n <CustomDialog title={title} open={open} onClose={onClose}>\n <DialogContent>\n <DialogContentText>{message}</DialogContentText>\n </DialogContent>\n <Divider />\n <DialogActions>\n <Button onClick={onClose} variant=\"contained\" fullWidth>\n {T.translate(\"general.ok\")}\n </Button>\n </DialogActions>\n </CustomDialog>\n );\n};\n\nAlertModal.propTypes = {\n title: PropTypes.string.isRequired,\n message: PropTypes.string.isRequired,\n open: PropTypes.bool.isRequired,\n onClose: PropTypes.func.isRequired\n};\n\nexport default AlertModal;\n"],"names":["root","factory","exports","module","define","amd","this","CustomDialog","title","open","onClose","maxWidth","fullWidth","children","React","Dialog","DialogTitle","IconButton","onClick","size","sx","theme","position","right","top","color","palette","grey","CloseIcon","fontSize","Divider","propTypes","PropTypes","isRequired","defaultProps","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","AlertModal","message","DialogContent","DialogContentText","DialogActions","Button","variant","T"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"components/mui/alert-modal.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,uICkBT,MAAMC,EAAeA,EACnBC,QACAC,OACAC,UACAC,WACAC,YACAC,gBACAC,kBACAC,eAEA,MAAOC,EAAcC,IAAmBC,EAAAA,EAAAA,WAAS,GAE3CC,GAAaC,EAAAA,EAAAA,SAAO,IAE1BC,EAAAA,EAAAA,YAAU,KACRF,EAAWG,SAAU,EACd,KACLH,EAAWG,SAAU,CAAK,IAE3B,IAEH,MAAMC,EAAaC,IACjB,GAAIR,EAAc,OAElB,MAAMS,EAASD,EAAOE,UAGlBD,GAAiC,mBAAhBA,EAAOE,OAC1BV,GAAgB,GAChBW,QAAQC,QAAQJ,GACbK,OAAM,SACNC,SAAQ,KACHZ,EAAWG,SAASL,GAAgB,EAAM,IAEpD,EAMIe,EAAcA,KACdhB,GACJN,GAAS,EAGX,OACEuB,IAAAA,cAACC,EAAAA,OAAM,CACLzB,KAAMA,EACNC,QAASsB,EACTrB,SAAUA,EACVC,UAAWA,EACXuB,qBAAsBnB,GAEtBiB,IAAAA,cAACG,EAAAA,YAAW,KAAE5B,GACdyB,IAAAA,cAACI,EAAAA,WAAU,CACT,aAAW,QACXX,QAASM,EACTM,SAAUtB,EACVuB,KAAK,QACLC,GAAKC,IAAK,CACRC,SAAU,WACVC,MAAO,GACPC,IAAK,GACLC,MAAOJ,EAAMK,QAAQC,KAA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,KAAeC,YAG1B,U","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/mui/CustomDialog/index.js","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Close\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"prop-types\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/mui/AlertModal/index.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, { useEffect, useRef, useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport {\n Button,\n CircularProgress,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n Divider,\n IconButton\n} from \"@mui/material\";\nimport CloseIcon from \"@mui/icons-material/Close\";\n\nconst CustomDialog = ({\n title,\n open,\n onClose,\n maxWidth,\n fullWidth,\n primaryAction,\n secondaryAction,\n children\n}) => {\n const [isSubmitting, setIsSubmitting] = useState(false);\n // the only purpose of this is to avoid having a console log when modal is closed and setIsSubmitting is called\n const mountedRef = useRef(true);\n\n useEffect(() => {\n mountedRef.current = true;\n return () => {\n mountedRef.current = false;\n };\n }, []);\n\n const runAction = (action) => {\n if (isSubmitting) return;\n\n const result = action.onClick();\n\n // if action is async then guard double click\n if (result && typeof result.then === \"function\") {\n setIsSubmitting(true);\n Promise.resolve(result)\n .catch(() => {})\n .finally(() => {\n if (mountedRef.current) setIsSubmitting(false);\n });\n }\n };\n\n const handlePrimaryClick = () => runAction(primaryAction);\n const handleSecondaryClick = () => runAction(secondaryAction);\n\n const handleClose = () => {\n if (isSubmitting) return;\n onClose();\n };\n\n return (\n <Dialog\n open={open}\n onClose={handleClose}\n maxWidth={maxWidth}\n fullWidth={fullWidth}\n disableEscapeKeyDown={isSubmitting}\n >\n <DialogTitle>{title}</DialogTitle>\n <IconButton\n aria-label=\"close\"\n onClick={handleClose}\n disabled={isSubmitting}\n size=\"small\"\n sx={(theme) => ({\n position: \"absolute\",\n right: 12,\n top: 12,\n color: theme.palette.grey[500]\n })}\n >\n <CloseIcon fontSize=\"large\" />\n </IconButton>\n <Divider />\n <DialogContent>{children}</DialogContent>\n {(primaryAction || secondaryAction) && (\n <DialogActions>\n {secondaryAction && (\n <Button\n variant=\"outlined\"\n onClick={handleSecondaryClick}\n disabled={isSubmitting || secondaryAction.disabled}\n >\n {secondaryAction.label}\n </Button>\n )}\n {primaryAction && (\n <Button\n variant=\"contained\"\n onClick={handlePrimaryClick}\n disabled={isSubmitting || primaryAction.disabled}\n startIcon={\n isSubmitting ? (\n <CircularProgress size={16} color=\"inherit\" />\n ) : null\n }\n >\n {primaryAction.label}\n </Button>\n )}\n </DialogActions>\n )}\n </Dialog>\n );\n};\n\nconst actionPropType = PropTypes.shape({\n label: PropTypes.node.isRequired,\n onClick: PropTypes.func.isRequired,\n disabled: PropTypes.bool\n});\n\nCustomDialog.propTypes = {\n title: PropTypes.node.isRequired,\n open: PropTypes.bool.isRequired,\n onClose: PropTypes.func.isRequired,\n maxWidth: PropTypes.oneOf([\"xs\", \"sm\", \"md\", \"lg\", \"xl\", false]),\n fullWidth: PropTypes.bool,\n primaryAction: actionPropType,\n secondaryAction: actionPropType,\n children: PropTypes.node.isRequired\n};\n\nCustomDialog.defaultProps = {\n maxWidth: \"sm\",\n fullWidth: true,\n primaryAction: null,\n secondaryAction: null\n};\n\nexport default CustomDialog;\n","module.exports = require(\"@mui/icons-material/Close\");","module.exports = require(\"@mui/material\");","module.exports = require(\"i18n-react\");","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Copyright 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 T from \"i18n-react\";\nimport { DialogContentText } from \"@mui/material\";\nimport CustomDialog from \"../CustomDialog\";\n\nconst AlertModal = ({ title, message, open, onClose }) => {\n return (\n <CustomDialog\n title={title}\n open={open}\n onClose={onClose}\n primaryAction={{ label: T.translate(\"general.ok\"), onClick: onClose }}\n >\n <DialogContentText>{message}</DialogContentText>\n </CustomDialog>\n );\n};\n\nAlertModal.propTypes = {\n title: PropTypes.string.isRequired,\n message: PropTypes.string.isRequired,\n open: PropTypes.bool.isRequired,\n onClose: PropTypes.func.isRequired\n};\n\nexport default AlertModal;\n"],"names":["root","factory","exports","module","define","amd","this","CustomDialog","title","open","onClose","maxWidth","fullWidth","primaryAction","secondaryAction","children","isSubmitting","setIsSubmitting","useState","mountedRef","useRef","useEffect","current","runAction","action","result","onClick","then","Promise","resolve","catch","finally","handleClose","React","Dialog","disableEscapeKeyDown","DialogTitle","IconButton","disabled","size","sx","theme","position","right","top","color","palette","grey","CloseIcon","fontSize","Divider","DialogContent","DialogActions","Button","variant","handleSecondaryClick","label","handlePrimaryClick","startIcon","CircularProgress","actionPropType","PropTypes","isRequired","propTypes","defaultProps","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","AlertModal","message","T","DialogContentText"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,
|
|
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={4325:e=>{e.exports=require("@mui/icons-material/Close")},8619:e=>{e.exports=require("@mui/material")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,o),i.exports}(()=>{o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t}})(),(()=>{o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};o.r(r),o.d(r,{default:()=>f});var n=o(2015),i=o.n(n),l=o(9825),a=o.n(l),s=o(8619),c=o(4325),u=o.n(c);const d=({title:e,open:t,onClose:o,maxWidth:r,fullWidth:l,primaryAction:a,secondaryAction:c,children:d})=>{const[p,f]=(0,n.useState)(!1),m=(0,n.useRef)(!0);(0,n.useEffect)((()=>(m.current=!0,()=>{m.current=!1})),[]);const b=e=>{if(p)return;const t=e.onClick();t&&"function"==typeof t.then&&(f(!0),Promise.resolve(t).catch((()=>{})).finally((()=>{m.current&&f(!1)})))},y=()=>{p||o()};return i().createElement(s.Dialog,{open:t,onClose:y,maxWidth:r,fullWidth:l,disableEscapeKeyDown:p},i().createElement(s.DialogTitle,null,e),i().createElement(s.IconButton,{"aria-label":"close",onClick:y,disabled:p,size:"small",sx:e=>({position:"absolute",right:12,top:12,color:e.palette.grey[500]})},i().createElement(u(),{fontSize:"large"})),i().createElement(s.Divider,null),i().createElement(s.DialogContent,null,d),(a||c)&&i().createElement(s.DialogActions,null,c&&i().createElement(s.Button,{variant:"outlined",onClick:()=>b(c),disabled:p||c.disabled},c.label),a&&i().createElement(s.Button,{variant:"contained",onClick:()=>b(a),disabled:p||a.disabled,startIcon:p?i().createElement(s.CircularProgress,{size:16,color:"inherit"}):null},a.label)))},p=a().shape({label:a().node.isRequired,onClick:a().func.isRequired,disabled:a().bool});d.propTypes={title:a().node.isRequired,open:a().bool.isRequired,onClose:a().func.isRequired,maxWidth:a().oneOf(["xs","sm","md","lg","xl",!1]),fullWidth:a().bool,primaryAction:p,secondaryAction:p,children:a().node.isRequired},d.defaultProps={maxWidth:"sm",fullWidth:!0,primaryAction:null,secondaryAction:null};const f=d;return r})()));
|
|
2
2
|
//# sourceMappingURL=custom-dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/mui/custom-dialog.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,4B,WCAzBJ,EAAOD,QAAUK,QAAQ,gB,WCAzBJ,EAAOD,QAAUK,QAAQ,a,WCAzBJ,EAAOD,QAAUK,QAAQ,Q,GCCrBC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaT,QAGr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,KAAMuB,IAAAA,KAAeC,WACrBvB,QAASsB,IAAAA,KAAeC,WACxBtB,SAAUqB,IAAAA,MAAgB,CAAC,KAAM,KAAM,KAAM,KAAM,MAAM,IACzDpB,UAAWoB,IAAAA,KACXnB,SAAUmB,IAAAA,KAAeC,YAG3B1B,EAAa2B,aAAe,CAC1BvB,SAAU,KACVC,WAAW,GAGb,U","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Close\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material\"","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/CustomDialog/index.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/Close\");","module.exports = require(\"@mui/material\");","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 { Dialog, DialogTitle, Divider, IconButton } from \"@mui/material\";\nimport CloseIcon from \"@mui/icons-material/Close\";\n\nconst CustomDialog = ({ title, open, onClose, maxWidth, fullWidth, children }) => (\n <Dialog open={open} onClose={onClose} maxWidth={maxWidth} fullWidth={fullWidth}>\n <DialogTitle>{title}</DialogTitle>\n <IconButton\n aria-label=\"close\"\n onClick={onClose}\n size=\"small\"\n sx={(theme) => ({\n position: \"absolute\",\n right: 12,\n top: 12,\n color: theme.palette.grey[500]\n })}\n >\n <CloseIcon fontSize=\"large\" />\n </IconButton>\n <Divider />\n {children}\n </Dialog>\n);\n\nCustomDialog.propTypes = {\n title: PropTypes.node.isRequired,\n open: PropTypes.bool.isRequired,\n onClose: PropTypes.func.isRequired,\n maxWidth: PropTypes.oneOf([\"xs\", \"sm\", \"md\", \"lg\", \"xl\", false]),\n fullWidth: PropTypes.bool,\n children: PropTypes.node.isRequired\n};\n\nCustomDialog.defaultProps = {\n maxWidth: \"sm\",\n fullWidth: true\n};\n\nexport default CustomDialog;\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","CustomDialog","title","open","onClose","maxWidth","fullWidth","children","React","Dialog","DialogTitle","IconButton","onClick","size","sx","theme","position","right","top","color","palette","grey","CloseIcon","fontSize","Divider","propTypes","PropTypes","isRequired","defaultProps"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"components/mui/custom-dialog.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,4B,WCAzBJ,EAAOD,QAAUK,QAAQ,gB,WCAzBJ,EAAOD,QAAUK,QAAQ,a,WCAzBJ,EAAOD,QAAUK,QAAQ,Q,GCCrBC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaT,QAGrB,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B7C,SAAU8C,IAAAA,KAAeC,YAG3BvD,EAAayD,aAAe,CAC1BrD,SAAU,KACVC,WAAW,EACXC,cAAe,KACfC,gBAAiB,MAGnB,U","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Close\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material\"","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/CustomDialog/index.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/Close\");","module.exports = require(\"@mui/material\");","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, { useEffect, useRef, useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport {\n Button,\n CircularProgress,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n Divider,\n IconButton\n} from \"@mui/material\";\nimport CloseIcon from \"@mui/icons-material/Close\";\n\nconst CustomDialog = ({\n title,\n open,\n onClose,\n maxWidth,\n fullWidth,\n primaryAction,\n secondaryAction,\n children\n}) => {\n const [isSubmitting, setIsSubmitting] = useState(false);\n // the only purpose of this is to avoid having a console log when modal is closed and setIsSubmitting is called\n const mountedRef = useRef(true);\n\n useEffect(() => {\n mountedRef.current = true;\n return () => {\n mountedRef.current = false;\n };\n }, []);\n\n const runAction = (action) => {\n if (isSubmitting) return;\n\n const result = action.onClick();\n\n // if action is async then guard double click\n if (result && typeof result.then === \"function\") {\n setIsSubmitting(true);\n Promise.resolve(result)\n .catch(() => {})\n .finally(() => {\n if (mountedRef.current) setIsSubmitting(false);\n });\n }\n };\n\n const handlePrimaryClick = () => runAction(primaryAction);\n const handleSecondaryClick = () => runAction(secondaryAction);\n\n const handleClose = () => {\n if (isSubmitting) return;\n onClose();\n };\n\n return (\n <Dialog\n open={open}\n onClose={handleClose}\n maxWidth={maxWidth}\n fullWidth={fullWidth}\n disableEscapeKeyDown={isSubmitting}\n >\n <DialogTitle>{title}</DialogTitle>\n <IconButton\n aria-label=\"close\"\n onClick={handleClose}\n disabled={isSubmitting}\n size=\"small\"\n sx={(theme) => ({\n position: \"absolute\",\n right: 12,\n top: 12,\n color: theme.palette.grey[500]\n })}\n >\n <CloseIcon fontSize=\"large\" />\n </IconButton>\n <Divider />\n <DialogContent>{children}</DialogContent>\n {(primaryAction || secondaryAction) && (\n <DialogActions>\n {secondaryAction && (\n <Button\n variant=\"outlined\"\n onClick={handleSecondaryClick}\n disabled={isSubmitting || secondaryAction.disabled}\n >\n {secondaryAction.label}\n </Button>\n )}\n {primaryAction && (\n <Button\n variant=\"contained\"\n onClick={handlePrimaryClick}\n disabled={isSubmitting || primaryAction.disabled}\n startIcon={\n isSubmitting ? (\n <CircularProgress size={16} color=\"inherit\" />\n ) : null\n }\n >\n {primaryAction.label}\n </Button>\n )}\n </DialogActions>\n )}\n </Dialog>\n );\n};\n\nconst actionPropType = PropTypes.shape({\n label: PropTypes.node.isRequired,\n onClick: PropTypes.func.isRequired,\n disabled: PropTypes.bool\n});\n\nCustomDialog.propTypes = {\n title: PropTypes.node.isRequired,\n open: PropTypes.bool.isRequired,\n onClose: PropTypes.func.isRequired,\n maxWidth: PropTypes.oneOf([\"xs\", \"sm\", \"md\", \"lg\", \"xl\", false]),\n fullWidth: PropTypes.bool,\n primaryAction: actionPropType,\n secondaryAction: actionPropType,\n children: PropTypes.node.isRequired\n};\n\nCustomDialog.defaultProps = {\n maxWidth: \"sm\",\n fullWidth: true,\n primaryAction: null,\n secondaryAction: null\n};\n\nexport default CustomDialog;\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","CustomDialog","title","open","onClose","maxWidth","fullWidth","primaryAction","secondaryAction","children","isSubmitting","setIsSubmitting","useState","mountedRef","useRef","useEffect","current","runAction","action","result","onClick","then","Promise","resolve","catch","finally","handleClose","React","Dialog","disableEscapeKeyDown","DialogTitle","IconButton","disabled","size","sx","theme","position","right","top","color","palette","grey","CloseIcon","fontSize","Divider","DialogContent","DialogActions","Button","variant","handleSecondaryClick","label","handlePrimaryClick","startIcon","CircularProgress","actionPropType","PropTypes","isRequired","propTypes","defaultProps"],"sourceRoot":""}
|