openstack-uicore-foundation 5.0.68 → 5.0.69-beta.0
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/RESUME.md +23 -0
- package/lib/components/index.js +1 -1
- package/lib/components/index.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/auth-button.js +1 -1
- package/lib/components/mui/auth-button.js.map +1 -1
- package/lib/components/mui/bulk-edit-table.js +1 -1
- package/lib/components/mui/bulk-edit-table.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/editable-table.js +1 -1
- package/lib/components/mui/editable-table.js.map +1 -1
- package/lib/components/mui/form-item-table.js +1 -1
- package/lib/components/mui/form-item-table.js.map +1 -1
- package/lib/components/mui/formik-inputs/additional-input-list-v2.js +1 -1
- package/lib/components/mui/formik-inputs/additional-input-list-v2.js.map +1 -1
- package/lib/components/mui/formik-inputs/additional-input-list.js +1 -1
- package/lib/components/mui/formik-inputs/additional-input-list.js.map +1 -1
- package/lib/components/mui/formik-inputs/additional-input-v2.js +1 -1
- package/lib/components/mui/formik-inputs/additional-input-v2.js.map +1 -1
- package/lib/components/mui/formik-inputs/additional-input.js +1 -1
- package/lib/components/mui/formik-inputs/additional-input.js.map +1 -1
- package/lib/components/mui/formik-inputs/datepicker.js +1 -1
- package/lib/components/mui/formik-inputs/datepicker.js.map +1 -1
- package/lib/components/mui/formik-inputs/discount-field.js +1 -1
- package/lib/components/mui/formik-inputs/discount-field.js.map +1 -1
- package/lib/components/mui/formik-inputs/file-size-field.js +1 -1
- package/lib/components/mui/formik-inputs/file-size-field.js.map +1 -1
- package/lib/components/mui/formik-inputs/item-price-tiers.js +1 -1
- package/lib/components/mui/formik-inputs/item-price-tiers.js.map +1 -1
- package/lib/components/mui/formik-inputs/price-field.js +1 -1
- package/lib/components/mui/formik-inputs/price-field.js.map +1 -1
- package/lib/components/mui/formik-inputs/quantity-field.js +1 -1
- package/lib/components/mui/formik-inputs/quantity-field.js.map +1 -1
- package/lib/components/mui/formik-inputs/select.js +1 -1
- package/lib/components/mui/formik-inputs/select.js.map +1 -1
- package/lib/components/mui/formik-inputs/textfield.js +1 -1
- package/lib/components/mui/formik-inputs/textfield.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/grid-filter.js +1 -1
- package/lib/components/mui/grid-filter.js.map +1 -1
- package/lib/components/mui/info-note.js +1 -1
- package/lib/components/mui/info-note.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/nav-bar.js +1 -1
- package/lib/components/mui/nav-bar.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/sortable-table-v2.js +1 -1
- package/lib/components/mui/sortable-table-v2.js.map +1 -1
- package/lib/components/mui/sortable-table.js +1 -1
- package/lib/components/mui/sortable-table.js.map +1 -1
- package/lib/components/mui/sponsor-order-grid.js +1 -1
- package/lib/components/mui/sponsor-order-grid.js.map +1 -1
- package/lib/components/mui/table.js +1 -1
- package/lib/components/mui/table.js.map +1 -1
- package/lib/components/mui/upload-dialog.js +1 -1
- package/lib/components/mui/upload-dialog.js.map +1 -1
- package/lib/components/table-sortable.js +1 -1
- package/lib/components/table-sortable.js.map +1 -1
- package/lib/utils/theme.js +1 -1
- package/lib/utils/theme.js.map +1 -1
- package/package-lock.json +22291 -0
- package/package.json +1 -1
- package/.claude/rules/openstack-uicore-foundation-components.md +0 -67
- package/.claude/rules/openstack-uicore-foundation-project.md +0 -69
- package/.claude/rules/openstack-uicore-foundation-security.md +0 -39
- package/.claude/settings.local.json +0 -7
- package/.codegraph/.gitignore +0 -5
- package/docs/plans/2026-04-09-showconfirmdialog-react16-compat.md +0 -83
- package/docs/plans/2026-04-22-dropzone-pooling-ux.md +0 -129
- package/docs/plans/2026-04-23-uploadv3-duplicate-file-max-reached.md +0 -109
- package/docs/plans/2026-04-23-uploadv3-premature-complete-on-202.md +0 -99
- package/docs/plans/2026-07-06-file-size-field-unit-prop.md +0 -20
- package/docs/plans/2026-07-30-node-22-migration.md +0 -139
- package/docs/plans/clickup-barrel-mui-dragalong.md +0 -43
- package/docs/plans/clickup-dropzone-cancel-chunk-slot-leak.md +0 -58
- package/docs/plans/clickup-form-item-table-disabled-row-quantity.md +0 -117
- package/docs/plans/clickup-order-ledger-extraction.md +0 -44
- package/docs/plans/clickup-uploadv3-progress-bar-large-files.md +0 -42
|
@@ -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:()=>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(),
|
|
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(),null)),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,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,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AAYC,KAASX,EAAoBY,EAAE7E,EAAS4E,IAC5EE,OAAOC,eAAe/E,EAAS4E,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,C,WCNDX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,E,WCClFlB,EAAoBsB,EAAKvF,IACH,oBAAXwF,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAe/E,EAASwF,OAAOC,YAAa,CAAEC,MAAO,WAE7DZ,OAAOC,eAAe/E,EAAS,aAAc,CAAE0F,OAAO,GAAO,C,6HCc9D,MAAMC,EAAaA,EAAGrF,QAAOsF,UAASrF,OAAMC,aAExCuB,IAAAA,cAAC1B,EAAAA,QAAY,CACXC,MAAOA,EACPC,KAAMA,EACNC,QAASA,EACTG,cAAe,CAAE2C,MAAOuC,IAAAA,UAAY,cAAerE,QAAShB,IAE5DuB,IAAAA,cAAC+D,EAAAA,kBAAiB,KAAEF,IAK1BD,EAAW9B,UAAY,CACrBvD,MAAOqD,IAAAA,OAAiBC,WACxBgC,QAASjC,IAAAA,OAAiBC,WAC1BrD,KAAMoD,IAAAA,KAAeC,WACrBpD,QAASmD,IAAAA,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
|
+
{"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,EAA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AAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,C,WCNDX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,E,WCClFlB,EAAoBsB,EAAKtF,IACH,oBAAXuF,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAe9E,EAASuF,OAAOC,YAAa,CAAEC,MAAO,WAE7DZ,OAAOC,eAAe9E,EAAS,aAAc,CAAEyF,OAAO,GAAO,C,6HCc9D,MAAMC,EAAaA,EAAGpF,QAAOqF,UAASpF,OAAMC,aAExCuB,IAAAA,cAAC1B,EAAAA,QAAY,CACXC,MAAOA,EACPC,KAAMA,EACNC,QAASA,EACTG,cAAe,CAAE0C,MAAOuC,IAAAA,UAAY,cAAepE,QAAShB,IAE5DuB,IAAAA,cAAC8D,EAAAA,kBAAiB,KAAEF,IAK1BD,EAAW9B,UAAY,CACrBtD,MAAOoD,IAAAA,OAAiBC,WACxBgC,QAASjC,IAAAA,OAAiBC,WAC1BpD,KAAMmD,IAAAA,KAAeC,WACrBnD,QAASkD,IAAAA,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 />\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","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,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={6989:e=>{e.exports=require("@mui/material/Box")},6368:e=>{e.exports=require("@mui/material/Button")},7413:e=>{e.exports=require("@mui/material/Divider")},909:e=>{e.exports=require("@mui/material/IconButton")},535:e=>{e.exports=require("@mui/material/Menu")},4988:e=>{e.exports=require("@mui/material/MenuItem")},785:e=>{e.exports=require("@mui/material/Typography")},6182:e=>{e.exports=require("@mui/material/styles")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},2015:e=>{e.exports=require("react")}},t={};function r(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.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:()=>U});var i=r(2015),n=r.n(i),a=r(6842),l=r.n(a),s=r(6182),u=r(6989),m=r.n(u),c=r(6368),p=r.n(c),d=r(7413),x=r.n(d),y=r(909),f=r.n(y);const g=require("@mui/material/ListItemIcon");var v=r.n(g);const h=require("@mui/material/ListItemText");var E=r.n(h),b=r(535),q=r.n(b),S=r(4988),z=r.n(S),P=r(785),O=r.n(P);const j=require("@mui/icons-material/AccountCircle");var k=r.n(j);const L=require("@mui/icons-material/Logout");var T=r.n(L);const C=require("@mui/icons-material/Person");var I=r.n(C);const M=require("@mui/icons-material/Settings");var _=r.n(M);const w="UD7OIFgwF1LOfPJP234A",W="jWfqKg10xvcVZqMUgbLQ",U=({isLoggedUser:e,doLogin:t,initLogOut:r,profileEmail:o,profileName:a})=>{var u,c,d;const y=(0,s.useTheme)(),g=(0,i.useRef)(null),[h,b]=(0,i.useState)(!1),S=(null==y||null===(u=y.custom)||void 0===u||null===(u=u.menu)||void 0===u?void 0:u.fontSize)||"
|
|
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={6989:e=>{e.exports=require("@mui/material/Box")},6368:e=>{e.exports=require("@mui/material/Button")},7413:e=>{e.exports=require("@mui/material/Divider")},909:e=>{e.exports=require("@mui/material/IconButton")},535:e=>{e.exports=require("@mui/material/Menu")},4988:e=>{e.exports=require("@mui/material/MenuItem")},785:e=>{e.exports=require("@mui/material/Typography")},6182:e=>{e.exports=require("@mui/material/styles")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},2015:e=>{e.exports=require("react")}},t={};function r(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.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:()=>U});var i=r(2015),n=r.n(i),a=r(6842),l=r.n(a),s=r(6182),u=r(6989),m=r.n(u),c=r(6368),p=r.n(c),d=r(7413),x=r.n(d),y=r(909),f=r.n(y);const g=require("@mui/material/ListItemIcon");var v=r.n(g);const h=require("@mui/material/ListItemText");var E=r.n(h),b=r(535),q=r.n(b),S=r(4988),z=r.n(S),P=r(785),O=r.n(P);const j=require("@mui/icons-material/AccountCircle");var k=r.n(j);const L=require("@mui/icons-material/Logout");var T=r.n(L);const C=require("@mui/icons-material/Person");var I=r.n(C);const M=require("@mui/icons-material/Settings");var _=r.n(M);const w="UD7OIFgwF1LOfPJP234A",W="jWfqKg10xvcVZqMUgbLQ",U=({isLoggedUser:e,doLogin:t,initLogOut:r,profileEmail:o,profileName:a})=>{var u,c,d;const y=(0,s.useTheme)(),g=(0,i.useRef)(null),[h,b]=(0,i.useState)(!1),S=(null==y||null===(u=y.custom)||void 0===u||null===(u=u.menu)||void 0===u?void 0:u.fontSize)||"0.875rem",P=(null==y||null===(c=y.custom)||void 0===c||null===(c=c.menu)||void 0===c?void 0:c.lineHeight)||"1.25rem",j=(null==y||null===(d=y.custom)||void 0===d||null===(d=d.menu)||void 0===d?void 0:d.icon)||y.palette.text.secondary,L=()=>{b(!0)},C=()=>{b(!1)};return e?n().createElement(m(),{className:w},n().createElement(f(),{"aria-controls":h?"user-menu":void 0,"aria-expanded":h?"true":void 0,"aria-haspopup":"true",onClick:L,size:"medium","data-testid":"user-menu-button",sx:{color:y.palette.text.primary,p:0,width:28,height:28},ref:g},n().createElement(k(),{sx:{fontSize:28}})),n().createElement(q(),{id:"user-menu",anchorEl:g.current,open:h,onClose:C,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{mt:1.5,minWidth:260,borderRadius:2,overflow:"hidden",boxShadow:"0 16px 40px rgba(0, 0, 0, 0.18)"}},list:{disablePadding:!0,sx:{py:0}}}},n().createElement(m(),{sx:{px:3,py:2.5}},n().createElement(O(),{variant:"body1",sx:{fontSize:S,lineHeight:P,color:y.palette.text.primary,mb:.5}},a||"User"),n().createElement(O(),{variant:"body2",sx:{fontSize:S,lineHeight:P,color:y.palette.text.secondary}},o||"")),n().createElement(x(),null),n().createElement(z(),{onClick:C,sx:{py:1.5,px:3,gap:1.5}},n().createElement(v(),{sx:{minWidth:32,color:j}},n().createElement(_(),{sx:{fontSize:24}})),n().createElement(E(),{primary:l().translate("general.settings"),primaryTypographyProps:{sx:{fontSize:S,color:y.palette.text.primary}}})),n().createElement(z(),{onClick:C,sx:{py:1.5,px:3,gap:1.5}},n().createElement(v(),{sx:{minWidth:32,color:j}},n().createElement(I(),{sx:{fontSize:24}})),n().createElement(E(),{primary:l().translate("general.profile"),primaryTypographyProps:{sx:{fontSize:S,color:y.palette.text.primary}}})),n().createElement(x(),null),n().createElement(z(),{onClick:()=>{C(),r()},sx:{py:1.5,px:3,gap:1.5}},n().createElement(v(),{sx:{minWidth:32,color:j}},n().createElement(T(),{sx:{fontSize:24}})),n().createElement(E(),{primary:l().translate("buttons.sign_out"),primaryTypographyProps:{sx:{fontSize:S,color:y.palette.text.primary}}})))):n().createElement(m(),{className:W},n().createElement(p(),{variant:"contained",size:"small",color:"secondary",onClick:()=>{t()}},l().translate("buttons.log_in")))};return o})()));
|
|
2
2
|
//# sourceMappingURL=auth-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/mui/auth-button.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,oB,WCAzBJ,EAAOD,QAAUK,QAAQ,uB,WCAzBJ,EAAOD,QAAUK,QAAQ,wB,UCAzBJ,EAAOD,QAAUK,QAAQ,2B,UCAzBJ,EAAOD,QAAUK,QAAQ,qB,WCAzBJ,EAAOD,QAAUK,QAAQ,yB,UCAzBJ,EAAOD,QAAUK,QAAQ,2B,WCAzBJ,EAAOD,QAAUK,QAAQ,uB,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,MC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,eAWxCT,IAAAA,cAACC,IAAG,CAACC,UAAWC,GACdH,IAAAA,cAACiD,IAAM,CACLZ,QAAQ,YACR/B,KAAK,QACLE,MAAM,YACNH,QAASA,KACPhC,GAAS,GAGVwE,IAAAA,UAAY,mBAEX,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Box\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Button\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Divider\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/IconButton\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Menu\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/MenuItem\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Typography\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/styles\"","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/external commonjs \"@mui/material/ListItemIcon\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/ListItemText\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/AccountCircle\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Logout\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Person\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Settings\"","webpack://openstack-uicore-foundation/./src/components/mui/AuthButton/styles.module.scss","webpack://openstack-uicore-foundation/./src/components/mui/AuthButton/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/material/Box\");","module.exports = require(\"@mui/material/Button\");","module.exports = require(\"@mui/material/Divider\");","module.exports = require(\"@mui/material/IconButton\");","module.exports = require(\"@mui/material/Menu\");","module.exports = require(\"@mui/material/MenuItem\");","module.exports = require(\"@mui/material/Typography\");","module.exports = require(\"@mui/material/styles\");","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};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/ListItemIcon\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/ListItemText\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/icons-material/AccountCircle\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/icons-material/Logout\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/icons-material/Person\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/icons-material/Settings\");","// extracted by mini-css-extract-plugin\nexport default {\"userMenu\":\"UD7OIFgwF1LOfPJP234A\",\"login\":\"jWfqKg10xvcVZqMUgbLQ\"};","/**\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, {useRef, useState} from \"react\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport {useTheme} from \"@mui/material/styles\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport Divider from \"@mui/material/Divider\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Menu from \"@mui/material/Menu\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Typography from \"@mui/material/Typography\";\nimport AccountCircleIcon from \"@mui/icons-material/AccountCircle\";\nimport LogoutIcon from \"@mui/icons-material/Logout\";\nimport PersonIcon from \"@mui/icons-material/Person\";\nimport SettingsIcon from \"@mui/icons-material/Settings\";\nimport styles from \"./styles.module.scss\";\n\nconst AuthButton = ({\n isLoggedUser,\n doLogin,\n initLogOut,\n profileEmail,\n profileName\n }) => {\n const theme = useTheme();\n const anchorRef = useRef(null);\n const [menuOpen, setMenuOpen] = useState(false);\n\n const menuFontSize = theme?.custom?.menu?.fontSize || \"1.4rem\";\n const menuLineHeight = theme?.custom?.menu?.lineHeight || \"2rem\";\n const menuIconColor = theme?.custom?.menu?.icon || theme.palette.text.secondary;\n\n const openMenu = () => {\n setMenuOpen(true);\n };\n\n const closeMenu = () => {\n setMenuOpen(false);\n };\n\n if (isLoggedUser) {\n return (\n <Box className={styles.userMenu}>\n <IconButton\n aria-controls={menuOpen ? \"user-menu\" : undefined}\n aria-expanded={menuOpen ? \"true\" : undefined}\n aria-haspopup=\"true\"\n onClick={openMenu}\n size=\"medium\"\n data-testid=\"user-menu-button\"\n sx={{\n color: theme.palette.text.primary,\n p: 0,\n width: 28,\n height: 28\n }}\n ref={anchorRef}\n >\n <AccountCircleIcon sx={{fontSize: 28}}/>\n </IconButton>\n <Menu\n id=\"user-menu\"\n anchorEl={anchorRef.current}\n open={menuOpen}\n onClose={closeMenu}\n anchorOrigin={{\n vertical: \"bottom\",\n horizontal: \"right\"\n }}\n transformOrigin={{\n vertical: \"top\",\n horizontal: \"right\"\n }}\n slotProps={{\n paper: {\n sx: {\n mt: 1.5,\n minWidth: 260,\n borderRadius: 2,\n overflow: \"hidden\",\n boxShadow: \"0 16px 40px rgba(0, 0, 0, 0.18)\"\n }\n },\n list: {\n disablePadding: true,\n sx: {py: 0}\n }\n }}\n >\n <Box sx={{px: 3, py: 2.5}}>\n <Typography\n variant=\"body1\"\n sx={{\n fontSize: menuFontSize,\n lineHeight: menuLineHeight,\n color: theme.palette.text.primary,\n mb: 0.5\n }}\n >\n {profileName || \"User\"}\n </Typography>\n <Typography\n variant=\"body2\"\n sx={{\n fontSize: menuFontSize,\n lineHeight: menuLineHeight,\n color: theme.palette.text.secondary\n }}\n >\n {profileEmail || \"\"}\n </Typography>\n </Box>\n <Divider/>\n <MenuItem onClick={closeMenu} sx={{py: 1.5, px: 3, gap: 1.5}}>\n <ListItemIcon sx={{minWidth: 32, color: menuIconColor}}>\n <SettingsIcon sx={{fontSize: 24}}/>\n </ListItemIcon>\n <ListItemText\n primary={T.translate(\"general.settings\")}\n primaryTypographyProps={{\n sx: {\n fontSize: menuFontSize,\n color: theme.palette.text.primary\n }\n }}\n />\n </MenuItem>\n <MenuItem onClick={closeMenu} sx={{py: 1.5, px: 3, gap: 1.5}}>\n <ListItemIcon sx={{minWidth: 32, color: menuIconColor}}>\n <PersonIcon sx={{fontSize: 24}}/>\n </ListItemIcon>\n <ListItemText\n primary={T.translate(\"general.profile\")}\n primaryTypographyProps={{\n sx: {\n fontSize: menuFontSize,\n color: theme.palette.text.primary\n }\n }}\n />\n </MenuItem>\n <Divider/>\n <MenuItem\n onClick={() => {\n closeMenu();\n initLogOut();\n }}\n sx={{py: 1.5, px: 3, gap: 1.5}}\n >\n <ListItemIcon sx={{minWidth: 32, color: menuIconColor}}>\n <LogoutIcon sx={{fontSize: 24}}/>\n </ListItemIcon>\n <ListItemText\n primary={T.translate(\"buttons.sign_out\")}\n primaryTypographyProps={{\n sx: {\n fontSize: menuFontSize,\n color: theme.palette.text.primary\n }\n }}\n />\n </MenuItem>\n </Menu>\n </Box>\n );\n }\n\n return (\n <Box className={styles.login}>\n <Button\n variant=\"contained\"\n size=\"small\"\n color=\"secondary\"\n onClick={() => {\n doLogin();\n }}\n >\n {T.translate(\"buttons.log_in\")}\n </Button>\n </Box>\n );\n};\n\nexport default AuthButton;\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","AuthButton","isLoggedUser","doLogin","initLogOut","profileEmail","profileName","_theme$custom","_theme$custom2","_theme$custom3","theme","useTheme","anchorRef","useRef","menuOpen","setMenuOpen","useState","menuFontSize","custom","menu","fontSize","menuLineHeight","lineHeight","menuIconColor","icon","palette","text","secondary","openMenu","closeMenu","React","Box","className","styles","IconButton","onClick","size","sx","color","primary","p","width","height","ref","AccountCircleIcon","Menu","id","anchorEl","current","open","onClose","anchorOrigin","vertical","horizontal","transformOrigin","slotProps","paper","mt","minWidth","borderRadius","overflow","boxShadow","list","disablePadding","py","px","Typography","variant","mb","Divider","MenuItem","gap","ListItemIcon","SettingsIcon","ListItemText","T","primaryTypographyProps","PersonIcon","LogoutIcon","Button"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"components/mui/auth-button.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,oB,WCAzBJ,EAAOD,QAAUK,QAAQ,uB,WCAzBJ,EAAOD,QAAUK,QAAQ,wB,UCAzBJ,EAAOD,QAAUK,QAAQ,2B,UCAzBJ,EAAOD,QAAUK,QAAQ,qB,WCAzBJ,EAAOD,QAAUK,QAAQ,yB,UCAzBJ,EAAOD,QAAUK,QAAQ,2B,WCAzBJ,EAAOD,QAAUK,QAAQ,uB,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,EAA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,GAAI,CACFjB,SAAUH,EACVqB,MAAO5B,EAAMe,QAAQC,KAAKa,eAWxCT,IAAAA,cAACC,IAAG,CAACC,UAAWC,GACdH,IAAAA,cAACiD,IAAM,CACLZ,QAAQ,YACR/B,KAAK,QACLE,MAAM,YACNH,QAASA,KACPhC,GAAS,GAGVwE,IAAAA,UAAY,mBAEX,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Box\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Button\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Divider\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/IconButton\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Menu\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/MenuItem\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Typography\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/styles\"","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/external commonjs \"@mui/material/ListItemIcon\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/ListItemText\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/AccountCircle\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Logout\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Person\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Settings\"","webpack://openstack-uicore-foundation/./src/components/mui/AuthButton/styles.module.scss","webpack://openstack-uicore-foundation/./src/components/mui/AuthButton/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/material/Box\");","module.exports = require(\"@mui/material/Button\");","module.exports = require(\"@mui/material/Divider\");","module.exports = require(\"@mui/material/IconButton\");","module.exports = require(\"@mui/material/Menu\");","module.exports = require(\"@mui/material/MenuItem\");","module.exports = require(\"@mui/material/Typography\");","module.exports = require(\"@mui/material/styles\");","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};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/ListItemIcon\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/ListItemText\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/icons-material/AccountCircle\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/icons-material/Logout\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/icons-material/Person\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/icons-material/Settings\");","// extracted by mini-css-extract-plugin\nexport default {\"userMenu\":\"UD7OIFgwF1LOfPJP234A\",\"login\":\"jWfqKg10xvcVZqMUgbLQ\"};","/**\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, {useRef, useState} from \"react\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport {useTheme} from \"@mui/material/styles\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport Divider from \"@mui/material/Divider\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Menu from \"@mui/material/Menu\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Typography from \"@mui/material/Typography\";\nimport AccountCircleIcon from \"@mui/icons-material/AccountCircle\";\nimport LogoutIcon from \"@mui/icons-material/Logout\";\nimport PersonIcon from \"@mui/icons-material/Person\";\nimport SettingsIcon from \"@mui/icons-material/Settings\";\nimport styles from \"./styles.module.scss\";\n\nconst AuthButton = ({\n isLoggedUser,\n doLogin,\n initLogOut,\n profileEmail,\n profileName\n }) => {\n const theme = useTheme();\n const anchorRef = useRef(null);\n const [menuOpen, setMenuOpen] = useState(false);\n\n const menuFontSize = theme?.custom?.menu?.fontSize || \"0.875rem\";\n const menuLineHeight = theme?.custom?.menu?.lineHeight || \"1.25rem\";\n const menuIconColor = theme?.custom?.menu?.icon || theme.palette.text.secondary;\n\n const openMenu = () => {\n setMenuOpen(true);\n };\n\n const closeMenu = () => {\n setMenuOpen(false);\n };\n\n if (isLoggedUser) {\n return (\n <Box className={styles.userMenu}>\n <IconButton\n aria-controls={menuOpen ? \"user-menu\" : undefined}\n aria-expanded={menuOpen ? \"true\" : undefined}\n aria-haspopup=\"true\"\n onClick={openMenu}\n size=\"medium\"\n data-testid=\"user-menu-button\"\n sx={{\n color: theme.palette.text.primary,\n p: 0,\n width: 28,\n height: 28\n }}\n ref={anchorRef}\n >\n <AccountCircleIcon sx={{fontSize: 28}}/>\n </IconButton>\n <Menu\n id=\"user-menu\"\n anchorEl={anchorRef.current}\n open={menuOpen}\n onClose={closeMenu}\n anchorOrigin={{\n vertical: \"bottom\",\n horizontal: \"right\"\n }}\n transformOrigin={{\n vertical: \"top\",\n horizontal: \"right\"\n }}\n slotProps={{\n paper: {\n sx: {\n mt: 1.5,\n minWidth: 260,\n borderRadius: 2,\n overflow: \"hidden\",\n boxShadow: \"0 16px 40px rgba(0, 0, 0, 0.18)\"\n }\n },\n list: {\n disablePadding: true,\n sx: {py: 0}\n }\n }}\n >\n <Box sx={{px: 3, py: 2.5}}>\n <Typography\n variant=\"body1\"\n sx={{\n fontSize: menuFontSize,\n lineHeight: menuLineHeight,\n color: theme.palette.text.primary,\n mb: 0.5\n }}\n >\n {profileName || \"User\"}\n </Typography>\n <Typography\n variant=\"body2\"\n sx={{\n fontSize: menuFontSize,\n lineHeight: menuLineHeight,\n color: theme.palette.text.secondary\n }}\n >\n {profileEmail || \"\"}\n </Typography>\n </Box>\n <Divider/>\n <MenuItem onClick={closeMenu} sx={{py: 1.5, px: 3, gap: 1.5}}>\n <ListItemIcon sx={{minWidth: 32, color: menuIconColor}}>\n <SettingsIcon sx={{fontSize: 24}}/>\n </ListItemIcon>\n <ListItemText\n primary={T.translate(\"general.settings\")}\n primaryTypographyProps={{\n sx: {\n fontSize: menuFontSize,\n color: theme.palette.text.primary\n }\n }}\n />\n </MenuItem>\n <MenuItem onClick={closeMenu} sx={{py: 1.5, px: 3, gap: 1.5}}>\n <ListItemIcon sx={{minWidth: 32, color: menuIconColor}}>\n <PersonIcon sx={{fontSize: 24}}/>\n </ListItemIcon>\n <ListItemText\n primary={T.translate(\"general.profile\")}\n primaryTypographyProps={{\n sx: {\n fontSize: menuFontSize,\n color: theme.palette.text.primary\n }\n }}\n />\n </MenuItem>\n <Divider/>\n <MenuItem\n onClick={() => {\n closeMenu();\n initLogOut();\n }}\n sx={{py: 1.5, px: 3, gap: 1.5}}\n >\n <ListItemIcon sx={{minWidth: 32, color: menuIconColor}}>\n <LogoutIcon sx={{fontSize: 24}}/>\n </ListItemIcon>\n <ListItemText\n primary={T.translate(\"buttons.sign_out\")}\n primaryTypographyProps={{\n sx: {\n fontSize: menuFontSize,\n color: theme.palette.text.primary\n }\n }}\n />\n </MenuItem>\n </Menu>\n </Box>\n );\n }\n\n return (\n <Box className={styles.login}>\n <Button\n variant=\"contained\"\n size=\"small\"\n color=\"secondary\"\n onClick={() => {\n doLogin();\n }}\n >\n {T.translate(\"buttons.log_in\")}\n </Button>\n </Box>\n );\n};\n\nexport default AuthButton;\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","AuthButton","isLoggedUser","doLogin","initLogOut","profileEmail","profileName","_theme$custom","_theme$custom2","_theme$custom3","theme","useTheme","anchorRef","useRef","menuOpen","setMenuOpen","useState","menuFontSize","custom","menu","fontSize","menuLineHeight","lineHeight","menuIconColor","icon","palette","text","secondary","openMenu","closeMenu","React","Box","className","styles","IconButton","onClick","size","sx","color","primary","p","width","height","ref","AccountCircleIcon","Menu","id","anchorEl","current","open","onClose","anchorOrigin","vertical","horizontal","transformOrigin","slotProps","paper","mt","minWidth","borderRadius","overflow","boxShadow","list","disablePadding","py","px","Typography","variant","mb","Divider","MenuItem","gap","ListItemIcon","SettingsIcon","ListItemText","T","primaryTypographyProps","PersonIcon","LogoutIcon","Button"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={9299:(e,t,n)=>{var r=n(2015),o=n.n(r),a=n(9825),l=n.n(a),i=n(8619),c=n(8177),s=n.n(c),u=n(1519),d=n.n(u);const m=require("@mui/icons-material/Info");var p=n.n(m);const g=require("@mui/icons-material/Warning");var b=n.n(g);const f={warning:o().createElement(b(),{color:"warning"}),success:o().createElement(s(),{color:"success"}),error:o().createElement(d(),{color:"error"}),info:o().createElement(p(),{color:"info"})},y=({open:e,title:t,text:n,iconType:r="",onConfirm:a,onCancel:l,confirmButtonText:c="Confirm",confirmButtonColor:s="primary",cancelButtonText:u="Cancel",cancelButtonColor:d="primary"})=>o().createElement(i.Dialog,{open:e,onClose:l},o().createElement(i.DialogTitle,{sx:{p:2},component:"div"},o().createElement(i.Typography,{variant:"h5"},t)),o().createElement(i.Divider,null),o().createElement(i.DialogContent,{sx:{p:2}},o().createElement("div",{style:{display:"flex",alignItems:"center"}},f[r]&&o().createElement("div",{style:{marginRight:10}},f[r]),o().createElement(i.Typography,{variant:"body1"},n))),o().createElement(i.Divider,{sx:{margin:"10px 0px 10px 0px"}}),o().createElement(i.DialogActions,null,o().createElement(i.Button,{fullWidth:!0,onClick:l,color:d,variant:"outlined",sx:{whiteSpace:"nowrap",minWidth:100}},u),o().createElement(i.Button,{fullWidth:!0,onClick:a,color:s,variant:"contained",sx:{whiteSpace:"nowrap",minWidth:100}},c)));y.propTypes={open:l().bool,title:l().string.isRequired,text:l().string.isRequired,iconType:l().string,onConfirm:l().func.isRequired,onCancel:l().func.isRequired,confirmButtonText:l().string,confirmButtonColor:l().string,cancelButtonText:l().string,cancelButtonColor:l().string},y.defaultProps={open:!1,iconType:"warning",confirmButtonText:"Confirm",confirmButtonColor:"primary",cancelButtonText:"Cancel",cancelButtonColor:"default"}},6130:(e,t,n)=>{n.d(t,{default:()=>a});n(1116),n(2015),n(9299);const r="__oif_confirm_dialog_bridge__",o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{},a=({title:e,text:t,iconType:n="",confirmButtonText:a="Confirm",cancelButtonText:l="Cancel",confirmButtonColor:i="primary",cancelButtonColor:c="primary"})=>{if(!o[r])throw new Error("[openstack-uicore-foundation] showConfirmDialog: <GlobalConfirmDialog /> is not mounted. Add <GlobalConfirmDialog /> to the root of your app.");return o[r]({title:e,text:t,iconType:n,confirmButtonText:a,cancelButtonText:l,confirmButtonColor:i,cancelButtonColor:c})}},6737:(e,t,n)=>{n.d(t,{default:()=>S});var r=n(2015),o=n(6842),a=n.n(o),l=n(6989),i=n.n(l),c=n(785),s=n.n(c);const u=require("@mui/material/Select");var d=n.n(u),m=n(4988),p=n.n(m),g=n(9825),b=n.n(g),f=n(3209),y=n(909),x=n.n(y);const h=require("@mui/material/Slider");var E=n.n(h);const w=require("@mui/material/ClickAwayListener");var C=n.n(w);const v=require("@mui/icons-material/ChevronLeft");var P=n.n(v);const q=require("@mui/icons-material/ChevronRight");var O=n.n(q);const R=({currentPage:e,totalRows:t,perPage:n,onPageChange:o,initialExpanded:l})=>{const c=Math.max(1,Math.ceil((t??0)/n)),[u,d]=(0,r.useState)(l),[m,p]=(0,r.useState)(e),g=(0,r.useRef)(null),b=(0,r.useCallback)(((e,t)=>p(t)),[]),f=(0,r.useCallback)(((e,t)=>{o(t),g.current=setTimeout((()=>d(!1)),150)}),[o]);return r.createElement(C(),{onClickAway:()=>u&&d(!1)},r.createElement(i(),{sx:{display:"inline-flex",alignItems:"center",height:40,borderRadius:20,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",overflow:"hidden"}},r.createElement(x(),{size:"small",onClick:()=>{const t=Math.max(1,e-1);p(t),o(t)},disabled:e<=1,"aria-label":a().translate("mui_table.previous_page")},r.createElement(P(),{sx:{fontSize:"24px"}})),r.createElement(s(),{component:"button",type:"button",onClick:()=>{u?d(!1):(p(e),d(!0))},variant:"body1",color:"text.secondary",sx:{border:"none",background:"none",px:1.5,height:40,cursor:"pointer",whiteSpace:"nowrap"}},a().translate("mui_table.page_of",{page:u?m:e,totalPages:c})),r.createElement(i(),{sx:{width:u?220:0,overflow:"hidden",transition:e=>e.transitions.create("width"),display:"flex",alignItems:"center",px:u?2:0}},r.createElement(E(),{size:"small",min:1,max:c,step:1,value:m,onChange:b,onChangeCommitted:f,valueLabelDisplay:"auto",sx:{width:180}})),r.createElement(x(),{size:"small",onClick:()=>{const t=Math.min(c,e+1);p(t),o(t)},disabled:e>=c,"aria-label":a().translate("mui_table.next_page")},r.createElement(O(),{sx:{fontSize:"24px"}}))))};R.propTypes={currentPage:b().number.isRequired,totalRows:b().number,perPage:b().number.isRequired,onPageChange:b().func.isRequired,initialExpanded:b().bool},R.defaultProps={totalRows:0,initialExpanded:!1};const k=R,T=[f.WU,f.k6,f.Lr],j=({totalRows:e,perPage:t,currentPage:n,onPageChange:o,onPerPageChange:l,showRange:c,pageSliderVisible:u})=>{const m=r.useMemo((()=>T.includes(t)?T:[...T,t].sort(((e,t)=>e-t))),[t]),g=e??0,b=g>0?(n-1)*t+1:0,f=Math.min(n*t,g);return r.createElement(i(),{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:1.5,my:1}},r.createElement(i(),{sx:{display:{xs:"none",md:"block"}}},c&&r.createElement(s(),{variant:"body1",color:"text.secondary"},a().translate("mui_table.showing_range",{from:b,to:f,total:g}))),r.createElement(i(),{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",justifyContent:{xs:"space-between",md:"flex-end"},width:{xs:"100%",md:"auto"},gap:1.5,minWidth:0}},l&&r.createElement(i(),{sx:{display:"flex",alignItems:"center",gap:1}},r.createElement(s(),{variant:"body1",color:"text.secondary",sx:{whiteSpace:"nowrap"}},a().translate("mui_table.rows_per_page")),r.createElement(d(),{size:"small",value:t,onChange:e=>{l(Number(e.target.value))},sx:{height:40,borderRadius:"20px",minWidth:80,bgcolor:"background.paper","& .MuiOutlinedInput-notchedOutline":{borderColor:"divider"},"& .MuiSelect-select":{color:"text.secondary"}},inputProps:{"aria-label":a().translate("mui_table.rows_per_page")}},m.map((e=>r.createElement(p(),{key:e,value:e},e))))),r.createElement(k,{totalRows:e,perPage:t,currentPage:n,onPageChange:o,initialExpanded:u})))};j.propTypes={totalRows:b().number,perPage:b().number.isRequired,currentPage:b().number.isRequired,onPageChange:b().func.isRequired,onPerPageChange:b().func,showRange:b().bool,pageSliderVisible:b().bool},j.defaultProps={showRange:!1,pageSliderVisible:!1};const S=j},6772:(e,t,n)=>{n.d(t,{A:()=>r});const r=(e="top,bottom")=>{const t=e.split(",").map((e=>e.trim()));return{showTop:t.includes("top"),showBottom:t.includes("bottom")}}},2393:(e,t,n)=>{n.d(t,{A:()=>b});var r=n(2015),o=n(9825),a=n.n(o),l=n(909),i=n.n(l),c=n(535),s=n.n(c),u=n(4988),d=n.n(u);const m=require("@mui/icons-material/MoreVert");var p=n.n(m);const g=({actions:e})=>{const[t,n]=r.useState(null);return e.length?r.createElement(r.Fragment,null,r.createElement(i(),{size:"medium",onClick:e=>n(e.currentTarget),"data-testid":"row-actions-menu-trigger"},r.createElement(p(),{fontSize:"large"})),r.createElement(s(),{anchorEl:t,open:Boolean(t),onClose:()=>n(null)},e.map((e=>r.createElement(d(),{key:e.label,disabled:e.disabled,onClick:()=>{n(null),e.onClick()}},e.label))))):null};g.propTypes={actions:a().arrayOf(a().shape({label:a().string.isRequired,onClick:a().func.isRequired,disabled:a().bool})).isRequired};const b=g},5983:(e,t,n)=>{n.d(t,{GZ:()=>c,mW:()=>s,sG:()=>i});var r=n(1116),o=n.n(r);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const i={tableLayout:"auto"},c=e=>e<=3?"md":"lg",s=e=>l({minWidth:e.width??40},e.width&&{width:e.width,maxWidth:e.width})},3209:(e,t,n)=>{n.d(t,{Lr:()=>a,WU:()=>r,k6:()=>o});const r=10,o=20,a=50},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8177:e=>{e.exports=require("@mui/icons-material/CheckCircle")},6084:e=>{e.exports=require("@mui/icons-material/Delete")},9247:e=>{e.exports=require("@mui/icons-material/Edit")},1519:e=>{e.exports=require("@mui/icons-material/Error")},8619:e=>{e.exports=require("@mui/material")},6989:e=>{e.exports=require("@mui/material/Box")},6368:e=>{e.exports=require("@mui/material/Button")},909:e=>{e.exports=require("@mui/material/IconButton")},535:e=>{e.exports=require("@mui/material/Menu")},4988:e=>{e.exports=require("@mui/material/MenuItem")},270:e=>{e.exports=require("@mui/material/Paper")},9292:e=>{e.exports=require("@mui/material/Table")},9008:e=>{e.exports=require("@mui/material/TableBody")},5684:e=>{e.exports=require("@mui/material/TableCell")},5783:e=>{e.exports=require("@mui/material/TableContainer")},8202:e=>{e.exports=require("@mui/material/TableHead")},464:e=>{e.exports=require("@mui/material/TableRow")},38:e=>{e.exports=require("@mui/material/TableSortLabel")},7633:e=>{e.exports=require("@mui/material/TextField")},785:e=>{e.exports=require("@mui/material/Typography")},6831:e=>{e.exports=require("@mui/utils")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};n.r(r),n.d(r,{default:()=>ge});var o=n(2015),a=n.n(o),l=n(9825),i=n.n(l),c=n(6842),s=n.n(c),u=n(6989),d=n.n(u),m=n(270),p=n.n(m),g=n(9292),b=n.n(g),f=n(9008),y=n.n(f),x=n(5684),h=n.n(x),E=n(5783),w=n.n(E),C=n(8202),v=n.n(C),P=n(464),q=n.n(P);const O=require("@mui/material/Checkbox");var R=n.n(O),k=n(6368),T=n.n(k);const j=({editEnabled:e,selectedCount:t,onEdit:n,onApply:r,onCancel:o})=>a().createElement(d(),{sx:{display:"flex",gap:1,width:{xs:"100%",sm:"auto"}}},e?a().createElement(a().Fragment,null,a().createElement(T(),{variant:"contained",onClick:r,sx:{flex:{xs:1,sm:"0 0 auto"}}},s().translate("bulk_edit_table.apply_changes")),a().createElement(T(),{variant:"outlined",onClick:o,sx:{flex:{xs:1,sm:"0 0 auto"}}},s().translate("general.cancel"))):a().createElement(T(),{variant:"contained",onClick:n,disabled:0===t,sx:{width:{xs:"100%",sm:"auto"}}},s().translate("bulk_edit_table.edit_selected"),t>0?` (${t})`:""));j.propTypes={editEnabled:i().bool,selectedCount:i().number,onEdit:i().func,onApply:i().func,onCancel:i().func},j.defaultProps={selectedCount:0};const S=j;var D=n(38),_=n.n(D),B=n(6831),K=n(5983);const W=e=>{const{editEnabled:t,sortable:n,sortDir:r,onSort:o,columnIndex:l,columnKey:i,col:c,children:u}=e,m=(0,K.mW)(c);return!n||t?a().createElement(h(),{sx:m},u):a().createElement(h(),{sx:m},a().createElement(_(),{active:!!r,direction:-1===r?"desc":"asc",onClick:()=>{o&&n&&!t&&o(l,i,r?-1*r:1)}},u,r?a().createElement(d(),{component:"span",sx:B.visuallyHidden},-1===r?s().translate("bulk_edit_table.sorted_desc"):s().translate("bulk_edit_table.sorted_asc")):null))};W.propTypes={editEnabled:i().bool,onSort:i().func,sortDir:i().number,columnIndex:i().number,columnKey:i().oneOfType([i().string,i().number]),sortable:i().bool,col:i().object.isRequired,children:i().node};const A=W;var M=n(1116),F=n.n(M),z=n(909),I=n.n(z),$=n(9247),N=n.n($),G=n(6084),L=n.n(G),V=n(7633),H=n.n(V);const U=({col:e,row:t,editRow:n,isEditingRow:r,onChange:o})=>{return r&&!0===e.editableField?a().createElement(H(),{id:e.columnKey,placeholder:e.placeholder||s().translate("placeholders.text"),multiline:!0,minRows:2,fullWidth:!0,size:"small",onChange:o,value:n[e.columnKey]??""}):r&&e.editableField?e.editableField({value:(null===(l=n[e.columnKey])||void 0===l?void 0:l.id)??(null===(i=n[e.columnKey])||void 0===i?void 0:i.value)??n[e.columnKey],onChange:t=>o({target:{value:t.target.value,id:e.columnKey}}),row:n,rowData:n[e.columnKey]})??null:e.render?e.render(t[e.columnKey],t)??null:a().createElement("span",{style:{fontWeight:"normal"}},t[e.columnKey]??null);var l,i};U.propTypes={col:i().object.isRequired,row:i().object.isRequired,editRow:i().object.isRequired,isEditingRow:i().bool,onChange:i().func};const J=U;var Z=n(2393);const X="Xhu4_LGKTq3e40qfe5Wt",Y="UloruHeHpGPH5R7sq1kU",Q="MSifStCaXi3PkMXSJE_n",ee="LmYr4a7JbDJJhz4VmZZk",te="OpMx28gG4w8RWw4ugfTz";function ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(n),!0).forEach((function(t){F()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const oe=(e,t)=>re(re(re({},(0,K.mW)(e)),t&&e.editableField?{minWidth:250}:{}),e.customStyle),ae=e=>{const{row:t,columns:n,editEnabled:r,isSelected:o,editRow:l,onToggle:i,onFieldChange:c,onEdit:u,onDelete:m,idKey:p,collapseActions:g,actionsBreakpoint:b}=e,f=o&&r,y=[u&&{label:s().translate("general.edit"),onClick:()=>u(t)},m&&{label:s().translate("general.delete"),onClick:()=>m(t)}].filter(Boolean),x=e=>{const{value:t,id:n}=e.target;c(n,t)};return a().createElement(q(),{role:"row",hover:!0},a().createElement(h(),{align:"center",className:Y,sx:{backgroundColor:"#fff"}},a().createElement(R(),{checked:o,onChange:()=>{r||i()},disabled:r,slotProps:{input:{"aria-label":`Select row ${t[p]}`}}})),n.map((e=>a().createElement(h(),{key:`${t[p]}_${e.columnKey}`,className:f&&e.editableField?ee:"",sx:re({fontWeight:"normal"},oe(e,f))},a().createElement(J,{col:e,row:t,editRow:l,isEditingRow:f,onChange:x})))),(u||m)&&a().createElement(h(),{align:"center",className:`${Q} ${te}`,sx:{backgroundColor:"#fff"}},a().createElement(d(),{sx:{display:g?{xs:"none",[b]:"flex"}:"flex",justifyContent:"center",gap:1}},u&&a().createElement(I(),{size:"medium",onClick:()=>u(t),sx:{padding:0},"aria-label":`Edit row ${t[p]}`},a().createElement(N(),{fontSize:"large"})),m&&a().createElement(I(),{size:"medium",onClick:()=>m(t),sx:{padding:0},"aria-label":`Delete row ${t[p]}`},a().createElement(L(),{fontSize:"large"}))),g&&a().createElement(d(),{sx:{display:{xs:"flex",[b]:"none"},justifyContent:"center"}},a().createElement(Z.A,{actions:y}))))};ae.propTypes={row:i().object.isRequired,columns:i().array.isRequired,editEnabled:i().bool,isSelected:i().bool,editRow:i().object.isRequired,onToggle:i().func,onFieldChange:i().func,onEdit:i().func,onDelete:i().func,idKey:i().string,collapseActions:i().bool,actionsBreakpoint:i().string},ae.defaultProps={idKey:"id",onEdit:null,onDelete:null,collapseActions:!1,actionsBreakpoint:"md"};const le=ae;function ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(n),!0).forEach((function(t){F()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const se=(e="id")=>{const[t,n]=(0,o.useState)([]),[r,a]=(0,o.useState)(!1),l=n=>t.some((t=>t[e]===n)),i=()=>{n([]),a(!1)};return{selectedRows:t,isSelected:l,toggleRow:t=>{n((n=>n.some((n=>n[e]===t[e]))?n.filter((n=>n[e]!==t[e])):[...n,t]))},isAllSelected:t=>t.length>0&&t.every((t=>l(t[e]))),toggleAll:t=>{n((n=>t.length>0&&t.every((t=>n.some((n=>n[e]===t[e]))))?[]:t))},editField:(t,r,o)=>{n((n=>n.map((n=>n[e]===t?ce(ce({},n),{},{[r]:o}):n))))},editEnabled:r,enterEditMode:()=>a(!0),cancel:i,reset:i}};var ue=n(6737),de=n(6772),me=n(6130);const pe=({options:e,columns:t,data:n,onSort:r,onUpdate:l,totalRows:i,perPage:c,currentPage:u,onPageChange:m,onPerPageChange:g,paginationPosition:f,pageSliderVisible:x,idKey:E,onEdit:C,onDelete:P,getName:O,deleteDialogTitle:k,deleteDialogBody:T,deleteDialogConfirmText:j,confirmButtonColor:D})=>{const{selectedRows:_,isSelected:B,toggleRow:W,isAllSelected:M,toggleAll:F,editField:z,editEnabled:I,enterEditMode:$,cancel:N,reset:G}=se(E),L=(C?1:0)+(P?1:0)>=2,V=(0,K.GZ)(t.length),H=n.map((e=>e[E])).join(",");(0,o.useEffect)((()=>{G()}),[H]);const U=t=>t===e.sortCol?e.sortDir:null,J=async e=>{await(0,me.default)({title:k||s().translate("general.are_you_sure"),text:"function"==typeof T?T(O(e)):T||`${s().translate("general.row_remove_warning")} ${O(e)}`,iconType:"warning",confirmButtonColor:D||"error",confirmButtonText:j||s().translate("general.yes_delete")})&&P(e[E])},Z=!!(c&&u&&m),{showTop:ee,showBottom:te}=(0,de.A)(f),ne=e=>a().createElement(ue.default,{totalRows:i,perPage:c,currentPage:u,onPageChange:m,onPerPageChange:g,showRange:e,pageSliderVisible:x});return a().createElement(d(),{sx:{width:"100%"}},a().createElement(d(),{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:1.5,mb:2}},a().createElement(S,{editEnabled:I,selectedCount:_.length,onEdit:$,onApply:e=>{e.stopPropagation(),e.preventDefault(),Promise.resolve(l(_)).then((()=>G())).catch((e=>{console.error("Error updating events:",e)}))},onCancel:N}),Z&&ee&&a().createElement(d(),{sx:{display:{xs:"none",sm:"block"}}},ne(!1))),a().createElement(p(),{elevation:0,sx:{width:"100%",mb:2}},a().createElement(w(),{component:p(),className:X,sx:{borderRadius:0,boxShadow:"none"}},a().createElement(b(),{sx:K.sG},a().createElement(v(),{sx:{backgroundColor:"#EAEDF4"}},a().createElement(q(),null,a().createElement(h(),{align:"center",className:Y,sx:{backgroundColor:"#EAEDF4"}},a().createElement(R(),{checked:M(n),onChange:()=>{I||F(n)},disabled:I,slotProps:{input:{"aria-label":"select all"}}})),t.map(((e,t)=>{const n=!!e.sortable;return a().createElement(A,{editEnabled:I,onSort:r,sortDir:U(e.columnKey),sortable:n,columnIndex:t,columnKey:e.columnKey,col:e,key:`heading_${e.columnKey}`},e.header??e.label??e.value)})),(C||P)&&a().createElement(h(),{align:"center",className:Q,sx:{backgroundColor:"#EAEDF4"}},e.actionsHeader||" "))),a().createElement(y(),null,t.length>0&&n.map((e=>a().createElement(le,{key:`row_${e[E]}`,row:e,idKey:E,editEnabled:I,isSelected:B(e[E]),editRow:_.find((t=>t[E]===e[E]))||e,onToggle:()=>W(e),onFieldChange:(t,n)=>z(e[E],t,n),columns:t,onEdit:C,onDelete:P?J:null,collapseActions:L,actionsBreakpoint:V})))))),Z&&te&&ne(!0)))};pe.propTypes={options:i().object.isRequired,columns:i().array.isRequired,data:i().array.isRequired,onSort:i().func.isRequired,onUpdate:i().func.isRequired,idKey:i().string,totalRows:i().number,perPage:i().number,currentPage:i().number,onPageChange:i().func,onPerPageChange:i().func,paginationPosition:i().string,pageSliderVisible:i().bool,onEdit:i().func,onDelete:i().func,getName:i().func,deleteDialogTitle:i().string,deleteDialogBody:i().oneOfType([i().func,i().string]),deleteDialogConfirmText:i().string,confirmButtonColor:i().string},pe.defaultProps={idKey:"id",onEdit:null,onDelete:null,getName:e=>e.name,deleteDialogTitle:null,deleteDialogBody:null,deleteDialogConfirmText:null,confirmButtonColor:null};const ge=pe;return r})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={9299:(e,t,n)=>{var r=n(2015),o=n.n(r),a=n(9825),l=n.n(a),i=n(8619),c=n(8177),s=n.n(c),u=n(1519),d=n.n(u);const m=require("@mui/icons-material/Info");var p=n.n(m);const g=require("@mui/icons-material/Warning");var b=n.n(g);const f={warning:o().createElement(b(),{color:"warning"}),success:o().createElement(s(),{color:"success"}),error:o().createElement(d(),{color:"error"}),info:o().createElement(p(),{color:"info"})},y=({open:e,title:t,text:n,iconType:r="",onConfirm:a,onCancel:l,confirmButtonText:c="Confirm",confirmButtonColor:s="primary",cancelButtonText:u="Cancel",cancelButtonColor:d="primary"})=>o().createElement(i.Dialog,{open:e,onClose:l},o().createElement(i.DialogTitle,{sx:{p:2},component:"div"},o().createElement(i.Typography,{variant:"h5"},t)),o().createElement(i.Divider,null),o().createElement(i.DialogContent,{sx:{p:2}},o().createElement("div",{style:{display:"flex",alignItems:"center"}},f[r]&&o().createElement("div",{style:{marginRight:10}},f[r]),o().createElement(i.Typography,{variant:"body1"},n))),o().createElement(i.Divider,{sx:{margin:"10px 0px 10px 0px"}}),o().createElement(i.DialogActions,null,o().createElement(i.Button,{fullWidth:!0,onClick:l,color:d,variant:"outlined",sx:{whiteSpace:"nowrap",minWidth:100}},u),o().createElement(i.Button,{fullWidth:!0,onClick:a,color:s,variant:"contained",sx:{whiteSpace:"nowrap",minWidth:100}},c)));y.propTypes={open:l().bool,title:l().string.isRequired,text:l().string.isRequired,iconType:l().string,onConfirm:l().func.isRequired,onCancel:l().func.isRequired,confirmButtonText:l().string,confirmButtonColor:l().string,cancelButtonText:l().string,cancelButtonColor:l().string},y.defaultProps={open:!1,iconType:"warning",confirmButtonText:"Confirm",confirmButtonColor:"primary",cancelButtonText:"Cancel",cancelButtonColor:"default"}},6130:(e,t,n)=>{n.d(t,{default:()=>a});n(1116),n(2015),n(9299);const r="__oif_confirm_dialog_bridge__",o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{},a=({title:e,text:t,iconType:n="",confirmButtonText:a="Confirm",cancelButtonText:l="Cancel",confirmButtonColor:i="primary",cancelButtonColor:c="primary"})=>{if(!o[r])throw new Error("[openstack-uicore-foundation] showConfirmDialog: <GlobalConfirmDialog /> is not mounted. Add <GlobalConfirmDialog /> to the root of your app.");return o[r]({title:e,text:t,iconType:n,confirmButtonText:a,cancelButtonText:l,confirmButtonColor:i,cancelButtonColor:c})}},6737:(e,t,n)=>{n.d(t,{default:()=>D});var r=n(2015),o=n(6842),a=n.n(o),l=n(6989),i=n.n(l),c=n(785),s=n.n(c);const u=require("@mui/material/Select");var d=n.n(u),m=n(4988),p=n.n(m),g=n(9825),b=n.n(g),f=n(3209),y=n(909),x=n.n(y);const h=require("@mui/material/Slider");var E=n.n(h);const w=require("@mui/material/ClickAwayListener");var C=n.n(w);const v=require("@mui/icons-material/ChevronLeft");var P=n.n(v);const q=require("@mui/icons-material/ChevronRight");var O=n.n(q);const R=({currentPage:e,totalRows:t,perPage:n,onPageChange:o,initialExpanded:l})=>{const c=Math.max(1,Math.ceil((t??0)/n)),[u,d]=(0,r.useState)(l),[m,p]=(0,r.useState)(e),g=(0,r.useRef)(null),b=(0,r.useCallback)(((e,t)=>p(t)),[]),f=(0,r.useCallback)(((e,t)=>{o(t),g.current=setTimeout((()=>d(!1)),150)}),[o]);return r.createElement(C(),{onClickAway:()=>u&&d(!1)},r.createElement(i(),{sx:{display:"inline-flex",alignItems:"center",height:40,borderRadius:20,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",overflow:"hidden"}},r.createElement(x(),{size:"small",onClick:()=>{const t=Math.max(1,e-1);p(t),o(t)},disabled:e<=1,"aria-label":a().translate("mui_table.previous_page")},r.createElement(P(),{sx:{fontSize:"24px"}})),r.createElement(s(),{component:"button",type:"button",onClick:()=>{u?d(!1):(p(e),d(!0))},variant:"body1",color:"text.secondary",sx:{border:"none",background:"none",px:1.5,height:40,cursor:"pointer",whiteSpace:"nowrap"}},a().translate("mui_table.page_of",{page:u?m:e,totalPages:c})),r.createElement(i(),{sx:{width:u?220:0,overflow:"hidden",transition:e=>e.transitions.create("width"),display:"flex",alignItems:"center",px:u?2:0}},r.createElement(E(),{size:"small",min:1,max:c,step:1,value:m,onChange:b,onChangeCommitted:f,valueLabelDisplay:"auto",sx:{width:180}})),r.createElement(x(),{size:"small",onClick:()=>{const t=Math.min(c,e+1);p(t),o(t)},disabled:e>=c,"aria-label":a().translate("mui_table.next_page")},r.createElement(O(),{sx:{fontSize:"24px"}}))))};R.propTypes={currentPage:b().number.isRequired,totalRows:b().number,perPage:b().number.isRequired,onPageChange:b().func.isRequired,initialExpanded:b().bool},R.defaultProps={totalRows:0,initialExpanded:!1};const k=R,T=[f.WU,f.k6,f.Lr],j=({totalRows:e,perPage:t,currentPage:n,onPageChange:o,onPerPageChange:l,showRange:c,pageSliderVisible:u})=>{const m=r.useMemo((()=>T.includes(t)?T:[...T,t].sort(((e,t)=>e-t))),[t]),g=e??0,b=g>0?(n-1)*t+1:0,f=Math.min(n*t,g);return r.createElement(i(),{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:1.5,my:1}},r.createElement(i(),{sx:{display:{xs:"none",md:"block"}}},c&&r.createElement(s(),{variant:"body1",color:"text.secondary"},a().translate("mui_table.showing_range",{from:b,to:f,total:g}))),r.createElement(i(),{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",justifyContent:{xs:"space-between",md:"flex-end"},width:{xs:"100%",md:"auto"},gap:1.5,minWidth:0}},l&&r.createElement(i(),{sx:{display:"flex",alignItems:"center",gap:1}},r.createElement(s(),{variant:"body1",color:"text.secondary",sx:{whiteSpace:"nowrap"}},a().translate("mui_table.rows_per_page")),r.createElement(d(),{size:"small",value:t,onChange:e=>{l(Number(e.target.value))},sx:{height:40,borderRadius:"20px",minWidth:80,bgcolor:"background.paper","& .MuiOutlinedInput-notchedOutline":{borderColor:"divider"},"& .MuiSelect-select":{color:"text.secondary"}},inputProps:{"aria-label":a().translate("mui_table.rows_per_page")}},m.map((e=>r.createElement(p(),{key:e,value:e},e))))),r.createElement(k,{totalRows:e,perPage:t,currentPage:n,onPageChange:o,initialExpanded:u})))};j.propTypes={totalRows:b().number,perPage:b().number.isRequired,currentPage:b().number.isRequired,onPageChange:b().func.isRequired,onPerPageChange:b().func,showRange:b().bool,pageSliderVisible:b().bool},j.defaultProps={showRange:!1,pageSliderVisible:!1};const D=j},6772:(e,t,n)=>{n.d(t,{A:()=>r});const r=(e="top,bottom")=>{const t=e.split(",").map((e=>e.trim()));return{showTop:t.includes("top"),showBottom:t.includes("bottom")}}},2393:(e,t,n)=>{n.d(t,{A:()=>b});var r=n(2015),o=n(9825),a=n.n(o),l=n(909),i=n.n(l),c=n(535),s=n.n(c),u=n(4988),d=n.n(u);const m=require("@mui/icons-material/MoreVert");var p=n.n(m);const g=({actions:e})=>{const[t,n]=r.useState(null);return e.length?r.createElement(r.Fragment,null,r.createElement(i(),{size:"medium",onClick:e=>n(e.currentTarget),"data-testid":"row-actions-menu-trigger"},r.createElement(p(),null)),r.createElement(s(),{anchorEl:t,open:Boolean(t),onClose:()=>n(null)},e.map((e=>r.createElement(d(),{key:e.label,disabled:e.disabled,onClick:()=>{n(null),e.onClick()}},e.label))))):null};g.propTypes={actions:a().arrayOf(a().shape({label:a().string.isRequired,onClick:a().func.isRequired,disabled:a().bool})).isRequired};const b=g},5983:(e,t,n)=>{n.d(t,{GZ:()=>c,mW:()=>s,sG:()=>i});var r=n(1116),o=n.n(r);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const i={tableLayout:"auto"},c=e=>e<=3?"md":"lg",s=e=>l({minWidth:e.width??40},e.width&&{width:e.width,maxWidth:e.width})},3209:(e,t,n)=>{n.d(t,{Lr:()=>a,WU:()=>r,k6:()=>o});const r=10,o=20,a=50},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8177:e=>{e.exports=require("@mui/icons-material/CheckCircle")},6084:e=>{e.exports=require("@mui/icons-material/Delete")},9247:e=>{e.exports=require("@mui/icons-material/Edit")},1519:e=>{e.exports=require("@mui/icons-material/Error")},8619:e=>{e.exports=require("@mui/material")},6989:e=>{e.exports=require("@mui/material/Box")},6368:e=>{e.exports=require("@mui/material/Button")},909:e=>{e.exports=require("@mui/material/IconButton")},535:e=>{e.exports=require("@mui/material/Menu")},4988:e=>{e.exports=require("@mui/material/MenuItem")},270:e=>{e.exports=require("@mui/material/Paper")},9292:e=>{e.exports=require("@mui/material/Table")},9008:e=>{e.exports=require("@mui/material/TableBody")},5684:e=>{e.exports=require("@mui/material/TableCell")},5783:e=>{e.exports=require("@mui/material/TableContainer")},8202:e=>{e.exports=require("@mui/material/TableHead")},464:e=>{e.exports=require("@mui/material/TableRow")},38:e=>{e.exports=require("@mui/material/TableSortLabel")},7633:e=>{e.exports=require("@mui/material/TextField")},785:e=>{e.exports=require("@mui/material/Typography")},6831:e=>{e.exports=require("@mui/utils")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};n.r(r),n.d(r,{default:()=>ge});var o=n(2015),a=n.n(o),l=n(9825),i=n.n(l),c=n(6842),s=n.n(c),u=n(6989),d=n.n(u),m=n(270),p=n.n(m),g=n(9292),b=n.n(g),f=n(9008),y=n.n(f),x=n(5684),h=n.n(x),E=n(5783),w=n.n(E),C=n(8202),v=n.n(C),P=n(464),q=n.n(P);const O=require("@mui/material/Checkbox");var R=n.n(O),k=n(6368),T=n.n(k);const j=({editEnabled:e,selectedCount:t,onEdit:n,onApply:r,onCancel:o})=>a().createElement(d(),{sx:{display:"flex",gap:1,width:{xs:"100%",sm:"auto"}}},e?a().createElement(a().Fragment,null,a().createElement(T(),{variant:"contained",onClick:r,sx:{flex:{xs:1,sm:"0 0 auto"}}},s().translate("bulk_edit_table.apply_changes")),a().createElement(T(),{variant:"outlined",onClick:o,sx:{flex:{xs:1,sm:"0 0 auto"}}},s().translate("general.cancel"))):a().createElement(T(),{variant:"contained",onClick:n,disabled:0===t,sx:{width:{xs:"100%",sm:"auto"}}},s().translate("bulk_edit_table.edit_selected"),t>0?` (${t})`:""));j.propTypes={editEnabled:i().bool,selectedCount:i().number,onEdit:i().func,onApply:i().func,onCancel:i().func},j.defaultProps={selectedCount:0};const D=j;var S=n(38),_=n.n(S),B=n(6831),K=n(5983);const W=e=>{const{editEnabled:t,sortable:n,sortDir:r,onSort:o,columnIndex:l,columnKey:i,col:c,children:u}=e,m=(0,K.mW)(c);return!n||t?a().createElement(h(),{sx:m},u):a().createElement(h(),{sx:m},a().createElement(_(),{active:!!r,direction:-1===r?"desc":"asc",onClick:()=>{o&&n&&!t&&o(l,i,r?-1*r:1)}},u,r?a().createElement(d(),{component:"span",sx:B.visuallyHidden},-1===r?s().translate("bulk_edit_table.sorted_desc"):s().translate("bulk_edit_table.sorted_asc")):null))};W.propTypes={editEnabled:i().bool,onSort:i().func,sortDir:i().number,columnIndex:i().number,columnKey:i().oneOfType([i().string,i().number]),sortable:i().bool,col:i().object.isRequired,children:i().node};const A=W;var M=n(1116),F=n.n(M),I=n(909),z=n.n(I),$=n(9247),N=n.n($),G=n(6084),L=n.n(G),V=n(7633),H=n.n(V);const U=({col:e,row:t,editRow:n,isEditingRow:r,onChange:o})=>{return r&&!0===e.editableField?a().createElement(H(),{id:e.columnKey,placeholder:e.placeholder||s().translate("placeholders.text"),multiline:!0,minRows:2,fullWidth:!0,size:"small",onChange:o,value:n[e.columnKey]??""}):r&&e.editableField?e.editableField({value:(null===(l=n[e.columnKey])||void 0===l?void 0:l.id)??(null===(i=n[e.columnKey])||void 0===i?void 0:i.value)??n[e.columnKey],onChange:t=>o({target:{value:t.target.value,id:e.columnKey}}),row:n,rowData:n[e.columnKey]})??null:e.render?e.render(t[e.columnKey],t)??null:a().createElement("span",{style:{fontWeight:"normal"}},t[e.columnKey]??null);var l,i};U.propTypes={col:i().object.isRequired,row:i().object.isRequired,editRow:i().object.isRequired,isEditingRow:i().bool,onChange:i().func};const J=U;var Z=n(2393);const X="Xhu4_LGKTq3e40qfe5Wt",Y="UloruHeHpGPH5R7sq1kU",Q="MSifStCaXi3PkMXSJE_n",ee="LmYr4a7JbDJJhz4VmZZk",te="OpMx28gG4w8RWw4ugfTz";function ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(n),!0).forEach((function(t){F()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const oe=(e,t)=>re(re(re({},(0,K.mW)(e)),t&&e.editableField?{minWidth:250}:{}),e.customStyle),ae=e=>{const{row:t,columns:n,editEnabled:r,isSelected:o,editRow:l,onToggle:i,onFieldChange:c,onEdit:u,onDelete:m,idKey:p,collapseActions:g,actionsBreakpoint:b}=e,f=o&&r,y=[u&&{label:s().translate("general.edit"),onClick:()=>u(t)},m&&{label:s().translate("general.delete"),onClick:()=>m(t)}].filter(Boolean),x=e=>{const{value:t,id:n}=e.target;c(n,t)};return a().createElement(q(),{role:"row",hover:!0},a().createElement(h(),{align:"center",className:Y,sx:{backgroundColor:"#fff"}},a().createElement(R(),{checked:o,onChange:()=>{r||i()},disabled:r,slotProps:{input:{"aria-label":`Select row ${t[p]}`}}})),n.map((e=>a().createElement(h(),{key:`${t[p]}_${e.columnKey}`,className:f&&e.editableField?ee:"",sx:re({fontWeight:"normal"},oe(e,f))},a().createElement(J,{col:e,row:t,editRow:l,isEditingRow:f,onChange:x})))),(u||m)&&a().createElement(h(),{align:"center",className:`${Q} ${te}`,sx:{backgroundColor:"#fff"}},a().createElement(d(),{sx:{display:g?{xs:"none",[b]:"flex"}:"flex",justifyContent:"center",gap:1}},u&&a().createElement(z(),{size:"medium",onClick:()=>u(t),sx:{padding:0},"aria-label":`Edit row ${t[p]}`},a().createElement(N(),null)),m&&a().createElement(z(),{size:"medium",onClick:()=>m(t),sx:{padding:0},"aria-label":`Delete row ${t[p]}`},a().createElement(L(),null))),g&&a().createElement(d(),{sx:{display:{xs:"flex",[b]:"none"},justifyContent:"center"}},a().createElement(Z.A,{actions:y}))))};ae.propTypes={row:i().object.isRequired,columns:i().array.isRequired,editEnabled:i().bool,isSelected:i().bool,editRow:i().object.isRequired,onToggle:i().func,onFieldChange:i().func,onEdit:i().func,onDelete:i().func,idKey:i().string,collapseActions:i().bool,actionsBreakpoint:i().string},ae.defaultProps={idKey:"id",onEdit:null,onDelete:null,collapseActions:!1,actionsBreakpoint:"md"};const le=ae;function ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(n),!0).forEach((function(t){F()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const se=(e="id")=>{const[t,n]=(0,o.useState)([]),[r,a]=(0,o.useState)(!1),l=n=>t.some((t=>t[e]===n)),i=()=>{n([]),a(!1)};return{selectedRows:t,isSelected:l,toggleRow:t=>{n((n=>n.some((n=>n[e]===t[e]))?n.filter((n=>n[e]!==t[e])):[...n,t]))},isAllSelected:t=>t.length>0&&t.every((t=>l(t[e]))),toggleAll:t=>{n((n=>t.length>0&&t.every((t=>n.some((n=>n[e]===t[e]))))?[]:t))},editField:(t,r,o)=>{n((n=>n.map((n=>n[e]===t?ce(ce({},n),{},{[r]:o}):n))))},editEnabled:r,enterEditMode:()=>a(!0),cancel:i,reset:i}};var ue=n(6737),de=n(6772),me=n(6130);const pe=({options:e,columns:t,data:n,onSort:r,onUpdate:l,totalRows:i,perPage:c,currentPage:u,onPageChange:m,onPerPageChange:g,paginationPosition:f,pageSliderVisible:x,idKey:E,onEdit:C,onDelete:P,getName:O,deleteDialogTitle:k,deleteDialogBody:T,deleteDialogConfirmText:j,confirmButtonColor:S})=>{const{selectedRows:_,isSelected:B,toggleRow:W,isAllSelected:M,toggleAll:F,editField:I,editEnabled:z,enterEditMode:$,cancel:N,reset:G}=se(E),L=(C?1:0)+(P?1:0)>=2,V=(0,K.GZ)(t.length),H=n.map((e=>e[E])).join(",");(0,o.useEffect)((()=>{G()}),[H]);const U=t=>t===e.sortCol?e.sortDir:null,J=async e=>{await(0,me.default)({title:k||s().translate("general.are_you_sure"),text:"function"==typeof T?T(O(e)):T||`${s().translate("general.row_remove_warning")} ${O(e)}`,iconType:"warning",confirmButtonColor:S||"error",confirmButtonText:j||s().translate("general.yes_delete")})&&P(e[E])},Z=!!(c&&u&&m),{showTop:ee,showBottom:te}=(0,de.A)(f),ne=e=>a().createElement(ue.default,{totalRows:i,perPage:c,currentPage:u,onPageChange:m,onPerPageChange:g,showRange:e,pageSliderVisible:x});return a().createElement(d(),{sx:{width:"100%"}},a().createElement(d(),{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:1.5,mb:2}},a().createElement(D,{editEnabled:z,selectedCount:_.length,onEdit:$,onApply:e=>{e.stopPropagation(),e.preventDefault(),Promise.resolve(l(_)).then((()=>G())).catch((e=>{console.error("Error updating events:",e)}))},onCancel:N}),Z&&ee&&a().createElement(d(),{sx:{display:{xs:"none",sm:"block"}}},ne(!1))),a().createElement(p(),{elevation:0,sx:{width:"100%",mb:2}},a().createElement(w(),{component:p(),className:X,sx:{borderRadius:0,boxShadow:"none"}},a().createElement(b(),{sx:K.sG},a().createElement(v(),{sx:{backgroundColor:"#EAEDF4"}},a().createElement(q(),null,a().createElement(h(),{align:"center",className:Y,sx:{backgroundColor:"#EAEDF4"}},a().createElement(R(),{checked:M(n),onChange:()=>{z||F(n)},disabled:z,slotProps:{input:{"aria-label":"select all"}}})),t.map(((e,t)=>{const n=!!e.sortable;return a().createElement(A,{editEnabled:z,onSort:r,sortDir:U(e.columnKey),sortable:n,columnIndex:t,columnKey:e.columnKey,col:e,key:`heading_${e.columnKey}`},e.header??e.label??e.value)})),(C||P)&&a().createElement(h(),{align:"center",className:Q,sx:{backgroundColor:"#EAEDF4"}},e.actionsHeader||" "))),a().createElement(y(),null,t.length>0&&n.map((e=>a().createElement(le,{key:`row_${e[E]}`,row:e,idKey:E,editEnabled:z,isSelected:B(e[E]),editRow:_.find((t=>t[E]===e[E]))||e,onToggle:()=>W(e),onFieldChange:(t,n)=>I(e[E],t,n),columns:t,onEdit:C,onDelete:P?J:null,collapseActions:L,actionsBreakpoint:V})))))),Z&&te&&ne(!0)))};pe.propTypes={options:i().object.isRequired,columns:i().array.isRequired,data:i().array.isRequired,onSort:i().func.isRequired,onUpdate:i().func.isRequired,idKey:i().string,totalRows:i().number,perPage:i().number,currentPage:i().number,onPageChange:i().func,onPerPageChange:i().func,paginationPosition:i().string,pageSliderVisible:i().bool,onEdit:i().func,onDelete:i().func,getName:i().func,deleteDialogTitle:i().string,deleteDialogBody:i().oneOfType([i().func,i().string]),deleteDialogConfirmText:i().string,confirmButtonColor:i().string},pe.defaultProps={idKey:"id",onEdit:null,onDelete:null,getName:e=>e.name,deleteDialogTitle:null,deleteDialogBody:null,deleteDialogConfirmText:null,confirmButtonColor:null};const ge=pe;return r})()));
|
|
2
2
|
//# sourceMappingURL=bulk-edit-table.js.map
|