openstack-uicore-foundation 5.0.10-beta.1 → 5.0.10-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/index.js +1 -1
- package/lib/components/index.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/snackbar-notification-context.js +2 -0
- package/lib/components/mui/snackbar-notification-context.js.map +1 -0
- package/lib/components/mui/snackbar-notification.js +1 -1
- package/lib/components/mui/snackbar-notification.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/stripe-payment.js +1 -1
- package/lib/components/mui/stripe-payment.js.map +1 -1
- package/lib/components/mui/table.js +1 -1
- package/lib/components/mui/table.js.map +1 -1
- package/lib/css/components/index.css +1 -1
- package/lib/css/components/index.css.map +1 -1
- package/lib/css/components/mui/editable-table.css +2 -0
- package/lib/css/components/mui/editable-table.css.map +1 -0
- package/lib/security/actions.js +1 -1
- package/lib/security/actions.js.map +1 -1
- package/lib/security/methods.js.map +1 -1
- package/lib/security/reducers.js.map +1 -1
- package/lib/security/session-checker.js.map +1 -1
- package/lib/utils/actions.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/mui/sortable-table.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,uGCiBT,MAAMC,EAAU,CACdC,QAASC,IAAAA,cAACC,EAAAA,QAAO,CAACC,MAAM,YACxBC,QAASH,IAAAA,cAACI,EAAAA,YAAW,CAACF,MAAM,YAC5BG,MAAOL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CAACoE,QAAS5G,EAAQ2G,OAAQhE,MAAM,UACvCO,IAAAA,UAAY,8BAY9B5C,GAAmBD,GAClBpF,EAAAA,cAAC4L,IAAe,CACdnK,UAAU,MACVoK,MAAO5G,EACP6G,mBAAoBzF,EACpB0F,YAAa7G,EACb8G,KAAM7G,EAAc,EACpBC,aAxOe6G,CAACC,EAAGC,KAC3B/G,EAAa+G,EAAU,EAAE,EAwOjBC,oBArOuBC,IAC/BhH,EAAgBgH,EAAGC,OAAOzH,MAAM,EAqOxB0H,iBAAkBtE,IAAAA,UAAY,2BAC9B1G,GAAI,CACF,8BAA+B,CAC7BS,WAAY,WACZwK,UAAW,UAEb,6BAA8B,CAC5BzK,QAAS,QAEX,oCAAqC,CACnC0K,WAAY,YAMlB,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/mui/confirm-dialog.js","webpack://openstack-uicore-foundation/./src/components/mui/showConfirmDialog.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material\"","webpack://openstack-uicore-foundation/external commonjs \"prop-types\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react/dist/i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Box\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Table\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TableBody\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TableCell\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TableContainer\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TableHead\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TablePagination\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TableSortLabel\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TableRow\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Paper\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/UnfoldMore\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Edit\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Delete\"","webpack://openstack-uicore-foundation/external commonjs \"react-beautiful-dnd\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/utils\"","webpack://openstack-uicore-foundation/./src/components/mui/sortable-table/styles.module.less?adcf","webpack://openstack-uicore-foundation/./src/components/mui/sortable-table/mui-table-sortable.js","webpack://openstack-uicore-foundation/./src/utils/constants.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n Divider,\n Typography\n} from \"@mui/material\";\nimport { CheckCircle, Error, Info, Warning } from \"@mui/icons-material\";\n\nconst iconMap = {\n warning: <Warning color=\"warning\" />,\n success: <CheckCircle color=\"success\" />,\n error: <Error color=\"error\" />,\n info: <Info color=\"info\" />\n};\n\nconst ConfirmDialog = ({\n open,\n title,\n text,\n iconType = \"\",\n onConfirm,\n onCancel,\n confirmButtonText = \"Confirm\",\n confirmButtonColor = \"primary\",\n cancelButtonText = \"Cancel\",\n cancelButtonColor = \"primary\"\n}) => (\n <Dialog open={open} onClose={onCancel}>\n <DialogTitle sx={{ p: 2 }} component=\"div\">\n <Typography variant=\"h5\">{title}</Typography>\n </DialogTitle>\n <Divider />\n <DialogContent sx={{ p: 2 }}>\n <div style={{ display: \"flex\", alignItems: \"center\" }}>\n {iconMap[iconType] && (\n <div style={{ marginRight: 10 }}>{iconMap[iconType]}</div>\n )}\n <Typography variant=\"body1\">{text}</Typography>\n </div>\n </DialogContent>\n <Divider sx={{ margin: \"10px 0px 10px 0px\" }} />\n <DialogActions>\n <Button\n fullWidth\n onClick={onCancel}\n color={cancelButtonColor}\n variant=\"outlined\"\n sx={{ whiteSpace: \"nowrap\", minWidth: 100 }}\n >\n {cancelButtonText}\n </Button>\n <Button\n fullWidth\n onClick={onConfirm}\n color={confirmButtonColor}\n variant=\"contained\"\n sx={{ whiteSpace: \"nowrap\", minWidth: 100 }}\n >\n {confirmButtonText}\n </Button>\n </DialogActions>\n </Dialog>\n);\n\nConfirmDialog.propTypes = {\n open: PropTypes.bool,\n title: PropTypes.string.isRequired,\n text: PropTypes.string.isRequired,\n iconType: PropTypes.string,\n onConfirm: PropTypes.func.isRequired,\n onCancel: PropTypes.func.isRequired,\n confirmButtonText: PropTypes.string,\n confirmButtonColor: PropTypes.string,\n cancelButtonText: PropTypes.string,\n cancelButtonColor: PropTypes.string\n};\n\nConfirmDialog.defaultProps = {\n open: false,\n iconType: \"warning\",\n confirmButtonText: \"Confirm\",\n confirmButtonColor: \"primary\",\n cancelButtonText: \"Cancel\",\n cancelButtonColor: \"default\"\n};\n\nexport default ConfirmDialog;\n","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React, { useState, useEffect } from \"react\";\nimport ConfirmDialog from \"./confirm-dialog\";\n\n/**\n * Imperative confirm dialog API.\n *\n * SETUP (required):\n * Place <GlobalConfirmDialog /> at the root of your app:\n *\n * import { GlobalConfirmDialog } from\n * 'openstack-uicore-foundation/lib/components/mui/show-confirm-dialog';\n *\n * function App() {\n * return (\n * <>\n * <YourApp />\n * <GlobalConfirmDialog />\n * </>\n * );\n * }\n *\n * USAGE (works from any file — the bridge is shared via globalThis):\n * import showConfirmDialog from\n * 'openstack-uicore-foundation/lib/components/mui/show-confirm-dialog';\n *\n * const confirmed = await showConfirmDialog({\n * title: 'Delete Item?',\n * text: 'This cannot be undone'\n * });\n */\n\n// Shared bridge reference stored on globalThis so that all webpack bundles\n// (table, sortable-table, show-confirm-dialog, index, etc.) read/write the\n// same callback. A module-level variable would be duplicated per bundle.\nconst BRIDGE_KEY = \"__oif_confirm_dialog_bridge__\";\nconst _global = typeof globalThis !== \"undefined\" ? globalThis : typeof window !== \"undefined\" ? window : {};\n\n/**\n * @param param0\n * @param param0.title\n * @param param0.text\n * @param param0.iconType\n * @param param0.confirmButtonText\n * @param param0.cancelButtonText\n * @param param0.confirmButtonColor\n * @param param0.cancelButtonColor\n * @returns {Promise<boolean>}\n */\nconst showConfirmDialog = ({\n title,\n text,\n iconType = \"\",\n confirmButtonText = \"Confirm\",\n cancelButtonText = \"Cancel\",\n confirmButtonColor = \"primary\",\n cancelButtonColor = \"primary\"\n}) => {\n if (!_global[BRIDGE_KEY]) {\n throw new Error(\n \"[openstack-uicore-foundation] showConfirmDialog: <GlobalConfirmDialog /> is not mounted. \" +\n \"Add <GlobalConfirmDialog /> to the root of your app.\"\n );\n }\n\n return _global[BRIDGE_KEY]({\n title,\n text,\n iconType,\n confirmButtonText,\n cancelButtonText,\n confirmButtonColor,\n cancelButtonColor\n });\n};\n\n/**\n * Global confirm dialog component. Place at the root of your app:\n *\n * <App>\n * ...\n * <GlobalConfirmDialog />\n * </App>\n *\n * Then call showConfirmDialog() anywhere.\n */\nexport const GlobalConfirmDialog = () => {\n const [dialogState, setDialogState] = useState(null);\n\n useEffect(() => {\n _global[BRIDGE_KEY] = (options) => {\n return new Promise((resolve) => {\n setDialogState({ ...options, open: true, onResolve: resolve });\n });\n };\n return () => { _global[BRIDGE_KEY] = null; };\n }, []);\n\n const handleConfirm = () => {\n if (dialogState?.onResolve) dialogState.onResolve(true);\n setDialogState(null);\n };\n\n const handleCancel = () => {\n if (dialogState?.onResolve) dialogState.onResolve(false);\n setDialogState(null);\n };\n\n if (!dialogState) return null;\n\n return (\n <ConfirmDialog\n open={dialogState.open}\n title={dialogState.title}\n text={dialogState.text}\n iconType={dialogState.iconType}\n confirmButtonText={dialogState.confirmButtonText}\n cancelButtonText={dialogState.cancelButtonText}\n confirmButtonColor={dialogState.confirmButtonColor}\n cancelButtonColor={dialogState.cancelButtonColor}\n onConfirm={handleConfirm}\n onCancel={handleCancel}\n />\n );\n};\n\nexport default showConfirmDialog;\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@mui/icons-material\");","module.exports = require(\"@mui/material\");","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/extends\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"i18n-react/dist/i18n-react\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/Box\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/Table\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/TableBody\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/TableCell\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/TableContainer\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/TableHead\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/TablePagination\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/TableSortLabel\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/TableRow\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/Paper\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/icons-material/UnfoldMore\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/icons-material/Edit\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/icons-material/Delete\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react-beautiful-dnd\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/utils\");","// extracted by mini-css-extract-plugin\nexport default {\"dottedBorderLeft\":\"pAjoKOwibtPxYWEmjS7g\"};","/**\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 * as React from \"react\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport Box from \"@mui/material/Box\";\nimport Table from \"@mui/material/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableContainer from \"@mui/material/TableContainer\";\nimport TableHead from \"@mui/material/TableHead\";\nimport TablePagination from \"@mui/material/TablePagination\";\nimport TableSortLabel from \"@mui/material/TableSortLabel\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Paper from \"@mui/material/Paper\";\nimport UnfoldMoreIcon from \"@mui/icons-material/UnfoldMore\";\nimport { IconButton } from \"@mui/material\";\nimport EditIcon from \"@mui/icons-material/Edit\";\nimport DeleteIcon from \"@mui/icons-material/Delete\";\nimport { DragDropContext, Draggable, Droppable } from \"react-beautiful-dnd\";\nimport { visuallyHidden } from \"@mui/utils\";\n\nimport styles from \"./styles.module.less\";\n\nimport {\n DEFAULT_PER_PAGE,\n FIFTY_PER_PAGE,\n TWENTY_PER_PAGE\n} from \"../../../utils/constants\";\nimport showConfirmDialog from \"../showConfirmDialog\";\n\nconst MuiTableSortable = ({\n columns = [],\n data = [],\n totalRows,\n perPage,\n currentPage,\n onPageChange,\n onPerPageChange,\n onSort,\n options = { sortCol: \"\", sortDir: 1 },\n getName = (item) => item.name,\n onEdit,\n onDelete,\n deleteDialogTitle = null,\n deleteDialogBody = null,\n onReorder,\n idKey = \"id\",\n updateOrderKey = \"order\"\n}) => {\n const handleChangePage = (_, newPage) => {\n onPageChange(newPage + 1);\n };\n\n const handleChangeRowsPerPage = (ev) => {\n onPerPageChange(ev.target.value);\n };\n\n const basePerPageOptions = [\n DEFAULT_PER_PAGE,\n TWENTY_PER_PAGE,\n FIFTY_PER_PAGE\n ];\n\n const customPerPageOptions = basePerPageOptions.includes(perPage)\n ? basePerPageOptions\n : [...basePerPageOptions, perPage].sort((a, b) => a - b);\n\n const { sortCol, sortDir } = options;\n\n const handleDragEnd = (result) => {\n if (!result.destination || result.source.index === result.destination.index)\n return;\n\n const reordered = [...data];\n const [movedItem] = reordered.splice(result.source.index, 1);\n reordered.splice(result.destination.index, 0, movedItem);\n\n // change value based on updateOrderKey\n if (updateOrderKey) {\n reordered.forEach((item, idx) => {\n item[updateOrderKey] = idx + 1;\n });\n }\n\n const movedItemId = movedItem.id;\n const newOrder = reordered.find(\n (item) => item[idKey || \"id\"] === movedItemId\n )?.[updateOrderKey];\n\n onReorder?.(reordered, movedItemId, newOrder);\n };\n\n const handleDelete = async (item) => {\n const isConfirmed = await showConfirmDialog({\n title: deleteDialogTitle || T.translate(\"general.are_you_sure\"),\n text:\n typeof deleteDialogBody === \"function\"\n ? deleteDialogBody(getName(item))\n : deleteDialogBody ||\n `${T.translate(\"general.row_remove_warning\")} ${getName(item)}`,\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: T.translate(\"general.yes_delete\")\n });\n\n if (isConfirmed) {\n onDelete(item.id);\n }\n };\n\n return (\n <Box sx={{ width: \"100%\" }}>\n <Paper elevation={0} sx={{ width: \"100%\", mb: 2 }}>\n <TableContainer\n component={Paper}\n sx={{ borderRadius: 0, boxShadow: \"none\" }}\n >\n <Table>\n {/* TABLE HEADER */}\n <TableHead sx={{ backgroundColor: \"#EAEAEA\" }}>\n <TableRow>\n {columns.map((col) => (\n <TableCell\n key={col.columnKey}\n sx={{\n width: col.width,\n minWidth: col.width,\n maxWidth: col.width\n }}\n align={col.align ?? \"left\"}\n >\n {col.sortable ? (\n <TableSortLabel\n active={sortCol === col.columnKey}\n direction={\n sortCol === col.columnKey && sortDir === -1\n ? \"desc\"\n : \"asc\"\n }\n onClick={() => onSort(col.columnKey, sortDir * -1)}\n >\n {col.header}\n {sortCol === col.columnKey ? (\n <Box component=\"span\" sx={visuallyHidden}>\n {sortDir === -1\n ? T.translate(\"mui_table.sorted_desc\")\n : T.translate(\"mui_table.sorted_asc\")}\n </Box>\n ) : null}\n </TableSortLabel>\n ) : (\n col.header\n )}\n </TableCell>\n ))}\n {onEdit && <TableCell sx={{ width: 40 }} />}\n {onDelete && <TableCell sx={{ width: 40 }} />}\n {onReorder && <TableCell sx={{ width: 40 }} />}\n </TableRow>\n </TableHead>\n\n {/* TABLE BODY */}\n <DragDropContext onDragEnd={handleDragEnd}>\n <Droppable droppableId=\"mui-table-droppable\">\n {(droppableProvided) => (\n <TableBody\n ref={droppableProvided.innerRef}\n {...droppableProvided.droppableProps}\n >\n {data.map((row, rowIndex) => (\n <Draggable\n key={row[idKey] || rowIndex}\n draggableId={String(row[idKey] || rowIndex)}\n index={rowIndex}\n >\n {(provided, snapshot) => (\n <TableRow\n ref={provided.innerRef}\n {...provided.draggableProps}\n sx={{\n ...(snapshot.isDragging\n ? {\n display: \"table\",\n width: \"100%\",\n tableLayout: \"fixed\",\n backgroundColor: \"#f0f0f0\",\n transform: \"scale(1.01)\",\n boxShadow: \"0 4px 12px rgba(0, 0, 0, 0.1)\",\n zIndex: 1,\n position: \"relative\",\n transition:\n \"transform 0.2s ease, background-color 0.2s ease\"\n }\n : {\n transition: \"background-color 0.2s ease\"\n })\n }}\n >\n {/* Main content columns */}\n {columns.map((col) => (\n <TableCell\n key={col.columnKey}\n align={col.align ?? \"left\"}\n className={`${\n col.dottedBorder && styles.dottedBorderLeft\n } ${col.className}`}\n >\n {col.render?.(row) || row[col.columnKey]}\n </TableCell>\n ))}\n {/* Edit column */}\n {onEdit && (\n <TableCell\n align=\"center\"\n sx={{ width: 40 }}\n className={styles.dottedBorderLeft}\n >\n <IconButton\n size=\"large\"\n onClick={() => onEdit(row)}\n >\n <EditIcon fontSize=\"large\" />\n </IconButton>\n </TableCell>\n )}\n {/* Delete column */}\n {onDelete && (\n <TableCell\n align=\"center\"\n sx={{ width: 40 }}\n className={styles.dottedBorderLeft}\n >\n <IconButton\n size=\"large\"\n onClick={() => handleDelete(row)}\n >\n <DeleteIcon fontSize=\"large\" />\n </IconButton>\n </TableCell>\n )}\n {/* Re order column */}\n {onReorder && (\n <TableCell\n align=\"center\"\n sx={{ width: 40 }}\n className={styles.dottedBorderLeft}\n {...provided.dragHandleProps}\n >\n <IconButton size=\"large\">\n <UnfoldMoreIcon fontSize=\"large\" />\n </IconButton>\n </TableCell>\n )}\n </TableRow>\n )}\n </Draggable>\n ))}\n {droppableProvided.placeholder}\n {data.length === 0 && (\n <TableRow>\n <TableCell colSpan={columns.length} align=\"center\">\n {T.translate(\"mui_table.no_items\")}\n </TableCell>\n </TableRow>\n )}\n </TableBody>\n )}\n </Droppable>\n </DragDropContext>\n </Table>\n </TableContainer>\n\n {/* PAGINATION */}\n {onPerPageChange && onPageChange && (\n <TablePagination\n component=\"div\"\n count={totalRows}\n rowsPerPageOptions={customPerPageOptions}\n rowsPerPage={perPage}\n page={currentPage - 1}\n onPageChange={handleChangePage}\n onRowsPerPageChange={handleChangeRowsPerPage}\n labelRowsPerPage={T.translate(\"mui_table.rows_per_page\")}\n sx={{\n \".MuiTablePagination-toolbar\": {\n alignItems: \"baseline\",\n marginTop: \"1.6rem\"\n },\n \".MuiTablePagination-spacer\": {\n display: \"none\"\n },\n \".MuiTablePagination-displayedRows\": {\n marginLeft: \"auto\"\n }\n }}\n />\n )}\n </Paper>\n </Box>\n );\n};\n\nexport default MuiTableSortable;\n","export const CENTS_FACTOR = 100n;\nexport const TWO_DECIMAL_PLACES = 2;\nexport const THREE_DECIMAL_PLACES = 3;\nexport const ONE_CENT = 1n;\nexport const ZERO_INT = 0;\n\nexport const CODE_200 = 200;\n\nexport const DEBOUNCE_WAIT_250 = 250;\nexport const DEBOUNCE_WAIT = 500;\n\nexport const NOTIFICATION_TIMEOUT = 2000;\nexport const DEFAULT_PER_PAGE = 10;\nexport const TWENTY_PER_PAGE = 20;\nexport const FIFTY_PER_PAGE = 50;\nexport const MAX_PER_PAGE = 100;\n\nexport const INT_BASE = 10;\n\nexport const ONE_HUNDRED = 100;\nexport const MILLISECONDS_IN_SECOND = 1000;\n\nexport const MILLISECONDS_TO_SECONDS = 1000;\n\nexport const BYTES_PER_MB = 1_048_576; // 1024 * 1024\n\nexport const MAX_INVENTORY_IMAGE_UPLOAD_SIZE = 512000;\nexport const MAX_INVENTORY_IMAGES_UPLOAD_QTY = 5;\nexport const ALLOWED_INVENTORY_IMAGE_FORMATS = [\"jpg\", \"jpeg\", \"png\"];\n\nexport const METAFIELD_TYPES_WITH_OPTIONS = [\n \"CheckBoxList\",\n \"ComboBox\",\n \"RadioButtonList\"\n];\n\nexport const METAFIELD_TYPES = [\n \"CheckBox\",\n ...METAFIELD_TYPES_WITH_OPTIONS,\n \"Text\",\n \"TextArea\",\n \"Quantity\",\n \"DateTime\",\n \"Time\"\n];\n\nexport const DISCOUNT_TYPES = {\n AMOUNT: \"Amount\",\n RATE: \"Rate\"\n};\n\nexport const RATE_FIELDS = {\n EARLY_BIRD: \"early_bird_rate\",\n STANDARD: \"standard_rate\",\n ONSITE: \"onsite_rate\"\n};\n\nexport const DECIMAL_DIGITS = 2;\n\nexport const FILE_UPLOAD_STATUS = {\n PENDING: \"PENDING\",\n DEADLINE_ALERT: \"DEADLINE ALERT\",\n DEADLINE_MISSED: \"DEADLINE MISSED\",\n COMPLETE: \"COMPLETE\"\n};\n\nexport const FILE_UPLOAD_STATUS_COLOR = {\n [FILE_UPLOAD_STATUS.COMPLETE]: \"success.light\",\n [FILE_UPLOAD_STATUS.DEADLINE_MISSED]: \"error\",\n [FILE_UPLOAD_STATUS.DEADLINE_ALERT]: \"warning.light\",\n [FILE_UPLOAD_STATUS.PENDING]: \"default\"\n};\n\nexport const FILE_UPLOAD_STATUS_BKGR_COLOR = {\n [FILE_UPLOAD_STATUS.COMPLETE]: \"white\",\n [FILE_UPLOAD_STATUS.DEADLINE_MISSED]: \"#D32F2F0A\",\n [FILE_UPLOAD_STATUS.DEADLINE_ALERT]: \"#EF6C000A\",\n [FILE_UPLOAD_STATUS.PENDING]: \"white\"\n};"],"names":["root","factory","exports","module","define","amd","this","iconMap","warning","React","Warning","color","success","CheckCircle","error","Error","info","Info","ConfirmDialog","open","title","text","iconType","onConfirm","onCancel","confirmButtonText","confirmButtonColor","cancelButtonText","cancelButtonColor","Dialog","onClose","DialogTitle","sx","p","component","Typography","variant","Divider","DialogContent","style","display","alignItems","marginRight","margin","DialogActions","Button","fullWidth","onClick","whiteSpace","minWidth","propTypes","PropTypes","isRequired","defaultProps","BRIDGE_KEY","_global","globalThis","window","showConfirmDialog","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","MuiTableSortable","columns","data","totalRows","perPage","currentPage","onPageChange","onPerPageChange","onSort","options","sortCol","sortDir","getName","item","name","onEdit","onDelete","deleteDialogTitle","deleteDialogBody","onReorder","idKey","updateOrderKey","basePerPageOptions","customPerPageOptions","includes","sort","b","Box","width","Paper","elevation","mb","TableContainer","borderRadius","boxShadow","Table","TableHead","backgroundColor","TableRow","map","col","TableCell","columnKey","maxWidth","align","sortable","TableSortLabel","active","direction","header","visuallyHidden","T","DragDropContext","onDragEnd","result","_reordered$find","destination","source","index","reordered","movedItem","splice","forEach","idx","movedItemId","id","newOrder","find","Droppable","droppableId","droppableProvided","TableBody","_extends","ref","innerRef","droppableProps","row","rowIndex","Draggable","draggableId","String","provided","snapshot","draggableProps","_objectSpread","isDragging","tableLayout","transform","zIndex","position","transition","_col$render","className","dottedBorder","styles","render","IconButton","size","EditIcon","fontSize","async","type","showCancelButton","handleDelete","DeleteIcon","dragHandleProps","UnfoldMoreIcon","placeholder","length","colSpan","TablePagination","count","rowsPerPageOptions","rowsPerPage","page","handleChangePage","_","newPage","onRowsPerPageChange","ev","target","labelRowsPerPage","marginTop","marginLeft"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"components/mui/sortable-table.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,uGCiBT,MAAMC,EAAU,CACdC,QAASC,IAAAA,cAACC,EAAAA,QAAO,CAACC,MAAM,YACxBC,QAASH,IAAAA,cAACI,EAAAA,YAAW,CAACF,MAAM,YAC5BG,MAAOL,IAAAA,cAACM,EAAAA,MAAK,CAACJ,MAAM,UACpBK,KAAMP,IAAAA,cAACQ,EAAAA,KAAI,CAACN,MAAM,UAGdO,EAAgBA,EACpBC,OACAC,QACAC,OACAC,WAAW,GACXC,YACAC,WACAC,oBAAoB,UACpBC,qBAAqB,UACrBC,mBAA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,CACdrK,UAAU,MACVsK,MAAO9G,EACP+G,mBAAoB3F,EACpB4F,YAAa/G,EACbgH,KAAM/G,EAAc,EACpBC,aA3Oe+G,CAACC,EAAGC,KAC3BjH,EAAaiH,EAAU,EAAE,EA2OjBC,oBAxOuBC,IAC/BlH,EAAgBkH,EAAGC,OAAO3H,MAAM,EAwOxB4H,iBAAkBxE,IAAAA,UAAY,2BAC9B1G,GAAI,CACF,8BAA+B,CAC7BS,WAAY,WACZ0K,UAAW,UAEb,6BAA8B,CAC5B3K,QAAS,QAEX,oCAAqC,CACnC4K,WAAY,YAMlB,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/mui/confirm-dialog.js","webpack://openstack-uicore-foundation/./src/components/mui/showConfirmDialog.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material\"","webpack://openstack-uicore-foundation/external commonjs \"prop-types\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react/dist/i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Box\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Table\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TableBody\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TableCell\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TableContainer\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TableHead\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TablePagination\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TableSortLabel\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TableRow\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Paper\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/UnfoldMore\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Edit\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Delete\"","webpack://openstack-uicore-foundation/external commonjs \"react-beautiful-dnd\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/utils\"","webpack://openstack-uicore-foundation/./src/components/mui/sortable-table/styles.module.less?adcf","webpack://openstack-uicore-foundation/./src/components/mui/sortable-table/mui-table-sortable.js","webpack://openstack-uicore-foundation/./src/utils/constants.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n Divider,\n Typography\n} from \"@mui/material\";\nimport { CheckCircle, Error, Info, Warning } from \"@mui/icons-material\";\n\nconst iconMap = {\n warning: <Warning color=\"warning\" />,\n success: <CheckCircle color=\"success\" />,\n error: <Error color=\"error\" />,\n info: <Info color=\"info\" />\n};\n\nconst ConfirmDialog = ({\n open,\n title,\n text,\n iconType = \"\",\n onConfirm,\n onCancel,\n confirmButtonText = \"Confirm\",\n confirmButtonColor = \"primary\",\n cancelButtonText = \"Cancel\",\n cancelButtonColor = \"primary\"\n}) => (\n <Dialog open={open} onClose={onCancel}>\n <DialogTitle sx={{ p: 2 }} component=\"div\">\n <Typography variant=\"h5\">{title}</Typography>\n </DialogTitle>\n <Divider />\n <DialogContent sx={{ p: 2 }}>\n <div style={{ display: \"flex\", alignItems: \"center\" }}>\n {iconMap[iconType] && (\n <div style={{ marginRight: 10 }}>{iconMap[iconType]}</div>\n )}\n <Typography variant=\"body1\">{text}</Typography>\n </div>\n </DialogContent>\n <Divider sx={{ margin: \"10px 0px 10px 0px\" }} />\n <DialogActions>\n <Button\n fullWidth\n onClick={onCancel}\n color={cancelButtonColor}\n variant=\"outlined\"\n sx={{ whiteSpace: \"nowrap\", minWidth: 100 }}\n >\n {cancelButtonText}\n </Button>\n <Button\n fullWidth\n onClick={onConfirm}\n color={confirmButtonColor}\n variant=\"contained\"\n sx={{ whiteSpace: \"nowrap\", minWidth: 100 }}\n >\n {confirmButtonText}\n </Button>\n </DialogActions>\n </Dialog>\n);\n\nConfirmDialog.propTypes = {\n open: PropTypes.bool,\n title: PropTypes.string.isRequired,\n text: PropTypes.string.isRequired,\n iconType: PropTypes.string,\n onConfirm: PropTypes.func.isRequired,\n onCancel: PropTypes.func.isRequired,\n confirmButtonText: PropTypes.string,\n confirmButtonColor: PropTypes.string,\n cancelButtonText: PropTypes.string,\n cancelButtonColor: PropTypes.string\n};\n\nConfirmDialog.defaultProps = {\n open: false,\n iconType: \"warning\",\n confirmButtonText: \"Confirm\",\n confirmButtonColor: \"primary\",\n cancelButtonText: \"Cancel\",\n cancelButtonColor: \"default\"\n};\n\nexport default ConfirmDialog;\n","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React, { useState, useEffect } from \"react\";\nimport ConfirmDialog from \"./confirm-dialog\";\n\n/**\n * Imperative confirm dialog API.\n *\n * SETUP (required):\n * Place <GlobalConfirmDialog /> at the root of your app:\n *\n * import { GlobalConfirmDialog } from\n * 'openstack-uicore-foundation/lib/components/mui/show-confirm-dialog';\n *\n * function App() {\n * return (\n * <>\n * <YourApp />\n * <GlobalConfirmDialog />\n * </>\n * );\n * }\n *\n * USAGE (works from any file — the bridge is shared via globalThis):\n * import showConfirmDialog from\n * 'openstack-uicore-foundation/lib/components/mui/show-confirm-dialog';\n *\n * const confirmed = await showConfirmDialog({\n * title: 'Delete Item?',\n * text: 'This cannot be undone'\n * });\n */\n\n// Shared bridge reference stored on globalThis so that all webpack bundles\n// (table, sortable-table, show-confirm-dialog, index, etc.) read/write the\n// same callback. A module-level variable would be duplicated per bundle.\nconst BRIDGE_KEY = \"__oif_confirm_dialog_bridge__\";\nconst _global = typeof globalThis !== \"undefined\" ? globalThis : typeof window !== \"undefined\" ? window : {};\n\n/**\n * @param param0\n * @param param0.title\n * @param param0.text\n * @param param0.iconType\n * @param param0.confirmButtonText\n * @param param0.cancelButtonText\n * @param param0.confirmButtonColor\n * @param param0.cancelButtonColor\n * @returns {Promise<boolean>}\n */\nconst showConfirmDialog = ({\n title,\n text,\n iconType = \"\",\n confirmButtonText = \"Confirm\",\n cancelButtonText = \"Cancel\",\n confirmButtonColor = \"primary\",\n cancelButtonColor = \"primary\"\n}) => {\n if (!_global[BRIDGE_KEY]) {\n throw new Error(\n \"[openstack-uicore-foundation] showConfirmDialog: <GlobalConfirmDialog /> is not mounted. \" +\n \"Add <GlobalConfirmDialog /> to the root of your app.\"\n );\n }\n\n return _global[BRIDGE_KEY]({\n title,\n text,\n iconType,\n confirmButtonText,\n cancelButtonText,\n confirmButtonColor,\n cancelButtonColor\n });\n};\n\n/**\n * Global confirm dialog component. Place at the root of your app:\n *\n * <App>\n * ...\n * <GlobalConfirmDialog />\n * </App>\n *\n * Then call showConfirmDialog() anywhere.\n */\nexport const GlobalConfirmDialog = () => {\n const [dialogState, setDialogState] = useState(null);\n\n useEffect(() => {\n _global[BRIDGE_KEY] = (options) => {\n return new Promise((resolve) => {\n setDialogState({ ...options, open: true, onResolve: resolve });\n });\n };\n return () => { _global[BRIDGE_KEY] = null; };\n }, []);\n\n const handleConfirm = () => {\n if (dialogState?.onResolve) dialogState.onResolve(true);\n setDialogState(null);\n };\n\n const handleCancel = () => {\n if (dialogState?.onResolve) dialogState.onResolve(false);\n setDialogState(null);\n };\n\n if (!dialogState) return null;\n\n return (\n <ConfirmDialog\n open={dialogState.open}\n title={dialogState.title}\n text={dialogState.text}\n iconType={dialogState.iconType}\n confirmButtonText={dialogState.confirmButtonText}\n cancelButtonText={dialogState.cancelButtonText}\n confirmButtonColor={dialogState.confirmButtonColor}\n cancelButtonColor={dialogState.cancelButtonColor}\n onConfirm={handleConfirm}\n onCancel={handleCancel}\n />\n );\n};\n\nexport default showConfirmDialog;\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@mui/icons-material\");","module.exports = require(\"@mui/material\");","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/extends\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"i18n-react/dist/i18n-react\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/Box\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/Table\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/TableBody\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/TableCell\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/TableContainer\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/TableHead\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/TablePagination\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/TableSortLabel\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/TableRow\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/Paper\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/icons-material/UnfoldMore\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/icons-material/Edit\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/icons-material/Delete\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react-beautiful-dnd\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/utils\");","// extracted by mini-css-extract-plugin\nexport default {\"dottedBorderLeft\":\"pAjoKOwibtPxYWEmjS7g\"};","/**\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 * as React from \"react\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport Box from \"@mui/material/Box\";\nimport Table from \"@mui/material/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableContainer from \"@mui/material/TableContainer\";\nimport TableHead from \"@mui/material/TableHead\";\nimport TablePagination from \"@mui/material/TablePagination\";\nimport TableSortLabel from \"@mui/material/TableSortLabel\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Paper from \"@mui/material/Paper\";\nimport UnfoldMoreIcon from \"@mui/icons-material/UnfoldMore\";\nimport { IconButton } from \"@mui/material\";\nimport EditIcon from \"@mui/icons-material/Edit\";\nimport DeleteIcon from \"@mui/icons-material/Delete\";\nimport { DragDropContext, Draggable, Droppable } from \"react-beautiful-dnd\";\nimport { visuallyHidden } from \"@mui/utils\";\n\nimport styles from \"./styles.module.less\";\n\nimport {\n DEFAULT_PER_PAGE,\n FIFTY_PER_PAGE,\n TWENTY_PER_PAGE\n} from \"../../../utils/constants\";\nimport showConfirmDialog from \"../showConfirmDialog\";\n\nconst MuiTableSortable = ({\n columns = [],\n data = [],\n totalRows,\n perPage,\n currentPage,\n onPageChange,\n onPerPageChange,\n onSort,\n options = { sortCol: \"\", sortDir: 1 },\n getName = (item) => item.name,\n onEdit,\n onDelete,\n deleteDialogTitle = null,\n deleteDialogBody = null,\n onReorder,\n idKey = \"id\",\n updateOrderKey = \"order\"\n}) => {\n const handleChangePage = (_, newPage) => {\n onPageChange(newPage + 1);\n };\n\n const handleChangeRowsPerPage = (ev) => {\n onPerPageChange(ev.target.value);\n };\n\n const basePerPageOptions = [\n DEFAULT_PER_PAGE,\n TWENTY_PER_PAGE,\n FIFTY_PER_PAGE\n ];\n\n const customPerPageOptions = basePerPageOptions.includes(perPage)\n ? basePerPageOptions\n : [...basePerPageOptions, perPage].sort((a, b) => a - b);\n\n const { sortCol, sortDir } = options;\n\n const handleDragEnd = (result) => {\n if (!result.destination || result.source.index === result.destination.index)\n return;\n\n const reordered = [...data];\n const [movedItem] = reordered.splice(result.source.index, 1);\n reordered.splice(result.destination.index, 0, movedItem);\n\n // change value based on updateOrderKey\n if (updateOrderKey) {\n reordered.forEach((item, idx) => {\n item[updateOrderKey] = idx + 1;\n });\n }\n\n const movedItemId = movedItem.id;\n const newOrder = reordered.find(\n (item) => item[idKey || \"id\"] === movedItemId\n )?.[updateOrderKey];\n\n onReorder?.(reordered, movedItemId, newOrder);\n };\n\n const handleDelete = async (item) => {\n const isConfirmed = await showConfirmDialog({\n title: deleteDialogTitle || T.translate(\"general.are_you_sure\"),\n text:\n typeof deleteDialogBody === \"function\"\n ? deleteDialogBody(getName(item))\n : deleteDialogBody ||\n `${T.translate(\"general.row_remove_warning\")} ${getName(item)}`,\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: T.translate(\"general.yes_delete\")\n });\n\n if (isConfirmed) {\n onDelete(item.id);\n }\n };\n\n return (\n <Box sx={{ width: \"100%\" }}>\n <Paper elevation={0} sx={{ width: \"100%\", mb: 2 }}>\n <TableContainer\n component={Paper}\n sx={{ borderRadius: 0, boxShadow: \"none\" }}\n >\n <Table>\n {/* TABLE HEADER */}\n <TableHead sx={{ backgroundColor: \"#EAEAEA\" }}>\n <TableRow>\n {columns.map((col) => (\n <TableCell\n key={col.columnKey}\n sx={{\n width: col.width,\n minWidth: col.width,\n maxWidth: col.width\n }}\n align={col.align ?? \"left\"}\n >\n {col.sortable ? (\n <TableSortLabel\n active={sortCol === col.columnKey}\n direction={\n sortCol === col.columnKey && sortDir === -1\n ? \"desc\"\n : \"asc\"\n }\n onClick={() => onSort(col.columnKey, sortDir * -1)}\n >\n {col.header}\n {sortCol === col.columnKey ? (\n <Box component=\"span\" sx={visuallyHidden}>\n {sortDir === -1\n ? T.translate(\"mui_table.sorted_desc\")\n : T.translate(\"mui_table.sorted_asc\")}\n </Box>\n ) : null}\n </TableSortLabel>\n ) : (\n col.header\n )}\n </TableCell>\n ))}\n {onEdit && <TableCell sx={{ width: 40 }} />}\n {onDelete && <TableCell sx={{ width: 40 }} />}\n {onReorder && <TableCell sx={{ width: 40 }} />}\n </TableRow>\n </TableHead>\n\n {/* TABLE BODY */}\n <DragDropContext onDragEnd={handleDragEnd}>\n <Droppable droppableId=\"mui-table-droppable\">\n {(droppableProvided) => (\n <TableBody\n ref={droppableProvided.innerRef}\n {...droppableProvided.droppableProps}\n >\n {data.map((row, rowIndex) => (\n <Draggable\n key={row[idKey] || rowIndex}\n draggableId={String(row[idKey] || rowIndex)}\n index={rowIndex}\n >\n {(provided, snapshot) => (\n <TableRow\n ref={provided.innerRef}\n {...provided.draggableProps}\n sx={{\n ...(snapshot.isDragging\n ? {\n display: \"table\",\n width: \"100%\",\n tableLayout: \"fixed\",\n backgroundColor: \"#f0f0f0\",\n transform: \"scale(1.01)\",\n boxShadow: \"0 4px 12px rgba(0, 0, 0, 0.1)\",\n zIndex: 1,\n position: \"relative\",\n transition:\n \"transform 0.2s ease, background-color 0.2s ease\"\n }\n : {\n transition: \"background-color 0.2s ease\"\n })\n }}\n >\n {/* Main content columns */}\n {columns.map((col) => (\n <TableCell\n key={col.columnKey}\n align={col.align ?? \"left\"}\n className={`${\n col.dottedBorder && styles.dottedBorderLeft\n } ${col.className}`}\n sx={{ fontWeight: \"normal\" }}\n >\n {col.render?.(row) || row[col.columnKey]}\n </TableCell>\n ))}\n {/* Edit column */}\n {onEdit && (\n <TableCell\n align=\"center\"\n sx={{ width: 40 }}\n className={styles.dottedBorderLeft}\n >\n <IconButton\n size=\"large\"\n onClick={() => onEdit(row)}\n sx={{ padding: 0 }}\n >\n <EditIcon fontSize=\"large\" />\n </IconButton>\n </TableCell>\n )}\n {/* Delete column */}\n {onDelete && (\n <TableCell\n align=\"center\"\n sx={{ width: 40 }}\n className={styles.dottedBorderLeft}\n >\n <IconButton\n size=\"large\"\n onClick={() => handleDelete(row)}\n sx={{ padding: 0 }}\n >\n <DeleteIcon fontSize=\"large\" />\n </IconButton>\n </TableCell>\n )}\n {/* Re order column */}\n {onReorder && (\n <TableCell\n align=\"center\"\n sx={{ width: 40 }}\n className={styles.dottedBorderLeft}\n {...provided.dragHandleProps}\n >\n <IconButton size=\"large\">\n <UnfoldMoreIcon fontSize=\"large\" />\n </IconButton>\n </TableCell>\n )}\n </TableRow>\n )}\n </Draggable>\n ))}\n {droppableProvided.placeholder}\n {data.length === 0 && (\n <TableRow>\n <TableCell colSpan={columns.length} align=\"center\">\n {T.translate(\"mui_table.no_items\")}\n </TableCell>\n </TableRow>\n )}\n </TableBody>\n )}\n </Droppable>\n </DragDropContext>\n </Table>\n </TableContainer>\n\n {/* PAGINATION */}\n {onPerPageChange && onPageChange && (\n <TablePagination\n component=\"div\"\n count={totalRows}\n rowsPerPageOptions={customPerPageOptions}\n rowsPerPage={perPage}\n page={currentPage - 1}\n onPageChange={handleChangePage}\n onRowsPerPageChange={handleChangeRowsPerPage}\n labelRowsPerPage={T.translate(\"mui_table.rows_per_page\")}\n sx={{\n \".MuiTablePagination-toolbar\": {\n alignItems: \"baseline\",\n marginTop: \"1.6rem\"\n },\n \".MuiTablePagination-spacer\": {\n display: \"none\"\n },\n \".MuiTablePagination-displayedRows\": {\n marginLeft: \"auto\"\n }\n }}\n />\n )}\n </Paper>\n </Box>\n );\n};\n\nexport default MuiTableSortable;\n","export const CENTS_FACTOR = 100n;\nexport const TWO_DECIMAL_PLACES = 2;\nexport const THREE_DECIMAL_PLACES = 3;\nexport const ONE_CENT = 1n;\nexport const ZERO_INT = 0;\n\nexport const CODE_200 = 200;\n\nexport const DEBOUNCE_WAIT_250 = 250;\nexport const DEBOUNCE_WAIT = 500;\n\nexport const NOTIFICATION_TIMEOUT = 2000;\nexport const DEFAULT_PER_PAGE = 10;\nexport const TWENTY_PER_PAGE = 20;\nexport const FIFTY_PER_PAGE = 50;\nexport const MAX_PER_PAGE = 100;\n\nexport const INT_BASE = 10;\n\nexport const ONE_HUNDRED = 100;\nexport const MILLISECONDS_IN_SECOND = 1000;\n\nexport const MILLISECONDS_TO_SECONDS = 1000;\n\nexport const BYTES_PER_MB = 1_048_576; // 1024 * 1024\n\nexport const MAX_INVENTORY_IMAGE_UPLOAD_SIZE = 512000;\nexport const MAX_INVENTORY_IMAGES_UPLOAD_QTY = 5;\nexport const ALLOWED_INVENTORY_IMAGE_FORMATS = [\"jpg\", \"jpeg\", \"png\"];\n\nexport const METAFIELD_TYPES_WITH_OPTIONS = [\n \"CheckBoxList\",\n \"ComboBox\",\n \"RadioButtonList\"\n];\n\nexport const METAFIELD_TYPES = [\n \"CheckBox\",\n ...METAFIELD_TYPES_WITH_OPTIONS,\n \"Text\",\n \"TextArea\",\n \"Quantity\",\n \"DateTime\",\n \"Time\"\n];\n\nexport const DISCOUNT_TYPES = {\n AMOUNT: \"Amount\",\n RATE: \"Rate\"\n};\n\nexport const RATE_FIELDS = {\n EARLY_BIRD: \"early_bird_rate\",\n STANDARD: \"standard_rate\",\n ONSITE: \"onsite_rate\"\n};\n\nexport const DECIMAL_DIGITS = 2;\n\nexport const FILE_UPLOAD_STATUS = {\n PENDING: \"PENDING\",\n DEADLINE_ALERT: \"DEADLINE ALERT\",\n DEADLINE_MISSED: \"DEADLINE MISSED\",\n COMPLETE: \"COMPLETE\"\n};\n\nexport const FILE_UPLOAD_STATUS_COLOR = {\n [FILE_UPLOAD_STATUS.COMPLETE]: \"success.light\",\n [FILE_UPLOAD_STATUS.DEADLINE_MISSED]: \"error\",\n [FILE_UPLOAD_STATUS.DEADLINE_ALERT]: \"warning.light\",\n [FILE_UPLOAD_STATUS.PENDING]: \"default\"\n};\n\nexport const FILE_UPLOAD_STATUS_BKGR_COLOR = {\n [FILE_UPLOAD_STATUS.COMPLETE]: \"white\",\n [FILE_UPLOAD_STATUS.DEADLINE_MISSED]: \"#D32F2F0A\",\n [FILE_UPLOAD_STATUS.DEADLINE_ALERT]: \"#EF6C000A\",\n [FILE_UPLOAD_STATUS.PENDING]: \"white\"\n};"],"names":["root","factory","exports","module","define","amd","this","iconMap","warning","React","Warning","color","success","CheckCircle","error","Error","info","Info","ConfirmDialog","open","title","text","iconType","onConfirm","onCancel","confirmButtonText","confirmButtonColor","cancelButtonText","cancelButtonColor","Dialog","onClose","DialogTitle","sx","p","component","Typography","variant","Divider","DialogContent","style","display","alignItems","marginRight","margin","DialogActions","Button","fullWidth","onClick","whiteSpace","minWidth","propTypes","PropTypes","isRequired","defaultProps","BRIDGE_KEY","_global","globalThis","window","showConfirmDialog","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","MuiTableSortable","columns","data","totalRows","perPage","currentPage","onPageChange","onPerPageChange","onSort","options","sortCol","sortDir","getName","item","name","onEdit","onDelete","deleteDialogTitle","deleteDialogBody","onReorder","idKey","updateOrderKey","basePerPageOptions","customPerPageOptions","includes","sort","b","Box","width","Paper","elevation","mb","TableContainer","borderRadius","boxShadow","Table","TableHead","backgroundColor","TableRow","map","col","TableCell","columnKey","maxWidth","align","sortable","TableSortLabel","active","direction","header","visuallyHidden","T","DragDropContext","onDragEnd","result","_reordered$find","destination","source","index","reordered","movedItem","splice","forEach","idx","movedItemId","id","newOrder","find","Droppable","droppableId","droppableProvided","TableBody","_extends","ref","innerRef","droppableProps","row","rowIndex","Draggable","draggableId","String","provided","snapshot","draggableProps","_objectSpread","isDragging","tableLayout","transform","zIndex","position","transition","_col$render","className","dottedBorder","styles","fontWeight","render","IconButton","size","padding","EditIcon","fontSize","async","type","showCancelButton","handleDelete","DeleteIcon","dragHandleProps","UnfoldMoreIcon","placeholder","length","colSpan","TablePagination","count","rowsPerPageOptions","rowsPerPage","page","handleChangePage","_","newPage","onRowsPerPageChange","ev","target","labelRowsPerPage","marginTop","marginLeft"],"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={3209:(e,t,r)=>{r.d(t,{OP:()=>o,fJ:()=>i,q9:()=>n});const n=100n,o=2,i=0},9558:(e,t,r)=>{r.d(t,{isSentryInitialized:()=>n});r(5812),r(8041);const n=()=>"undefined"!=typeof window&&!!window.SENTRY_DSN},8400:(e,t,r)=>{r.d(t,{currencyAmountFromCents:()=>i});var n=r(3209);const o={USD:"$",EUR:"€",GBP:"£",CAD:"C$",AUD:"A$",NZD:"NZ$",CHF:"CHF",ARS:"AR$",BRL:"R$",MXN:"MX$"};function i(e,t="USD"){if("number"!=typeof e||!Number.isInteger(e))throw new Error("cents must be an integer number");const r=function(e){let t;if("bigint"==typeof e)t=e;else if("number"==typeof e){if(!Number.isSafeInteger(e))throw new Error("cents must be a safe integer Number (or pass BigInt/string).");t=BigInt(e)}else{if("string"!=typeof e)throw new Error("cents must be a bigint, number, or numeric string.");{const r=e.trim();if(!/^\d+$/.test(r))throw new Error("cents string must contain digits only (e.g., '1234').");t=BigInt(r)}}if(t<n.fJ)throw new Error("cents must be non-negative.");const r=t/n.q9,o=t%n.q9;return`${r.toString()}.${o.toString().padStart(n.OP,"0")}`}(e);return`${o[t]??"$"}${r}`}},5812:e=>{e.exports=require("moment-timezone")},8041:e=>{e.exports=require("urijs")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var n={};r.r(n),r.d(n,{default:()=>
|
|
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={3209:(e,t,r)=>{r.d(t,{OP:()=>o,fJ:()=>i,q9:()=>n});const n=100n,o=2,i=0},9558:(e,t,r)=>{r.d(t,{isSentryInitialized:()=>n});r(5812),r(8041);const n=()=>"undefined"!=typeof window&&!!window.SENTRY_DSN},8400:(e,t,r)=>{r.d(t,{currencyAmountFromCents:()=>i});var n=r(3209);const o={USD:"$",EUR:"€",GBP:"£",CAD:"C$",AUD:"A$",NZD:"NZ$",CHF:"CHF",ARS:"AR$",BRL:"R$",MXN:"MX$"};function i(e,t="USD"){if("number"!=typeof e||!Number.isInteger(e))throw new Error("cents must be an integer number");const r=function(e){let t;if("bigint"==typeof e)t=e;else if("number"==typeof e){if(!Number.isSafeInteger(e))throw new Error("cents must be a safe integer Number (or pass BigInt/string).");t=BigInt(e)}else{if("string"!=typeof e)throw new Error("cents must be a bigint, number, or numeric string.");{const r=e.trim();if(!/^\d+$/.test(r))throw new Error("cents string must contain digits only (e.g., '1234').");t=BigInt(r)}}if(t<n.fJ)throw new Error("cents must be non-negative.");const r=t/n.q9,o=t%n.q9;return`${r.toString()}.${o.toString().padStart(n.OP,"0")}`}(e);return`${o[t]??"$"}${r}`}},5812:e=>{e.exports=require("moment-timezone")},8041:e=>{e.exports=require("urijs")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var n={};r.r(n),r.d(n,{default:()=>v});const o=require("react");var i=r.n(o);const s=require("@stripe/stripe-js"),a=require("@stripe/react-stripe-js"),c=require("@babel/runtime/helpers/defineProperty");var u=r.n(c);const l=require("@mui/material"),p=require("i18n-react");var m=r.n(p),d=r(8400);const f=require("@sentry/react");var y=r(9558);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){u()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const _=(e={})=>{const t={};return e.locality&&(t.city=e.locality),e.country&&(t.country=e.country),e.address1&&(t.line1=e.address1),e.address2&&(t.line2=e.address2),e.postal_code&&(t.postal_code=e.postal_code),e.region&&(t.state=e.region),Object.keys(t).length>0?{address:t}:{}},O=({title:e,amount:t=0,client:r,redirectUrl:n,paymentOptions:s={},onSuccess:c,onError:u,onPaymentMethodChange:p})=>{const b=(0,a.useStripe)(),O=(0,a.useElements)(),[v,h]=(0,o.useState)(!1);(0,o.useEffect)((()=>{if(O){const e=O.getElement("payment"),t=e=>{e.value.type&&p(e.value.type)};return e.on("change",t),()=>{e.off("change",t)}}}),[O]);return i().createElement(l.Box,{component:"form",onSubmit:async e=>{if(e.preventDefault(),!b||!O||v)return;h(!0);const{error:t,paymentIntent:o}=await b.confirmPayment({elements:O,confirmParams:{return_url:`${window.location.origin}${n}`,payment_method_data:{billing_details:g({name:r.full_name||`${r.first_name} ${r.last_name}`,email:r.email},_(r.address))}},redirect:"if_required"});if(t)null==u||u(t.message),h(!1);else if("succeeded"===(null==o?void 0:o.status))try{await(null==c?void 0:c(o))}catch(e){(e=>{(0,y.isSentryInitialized)()?f.captureException(e):console.log("Error on registration: ",e)})(e),null==u||u(m().translate("stripe_form.payment_confirmation_error"))}else"processing"===(null==o?void 0:o.status)||h(!1)},sx:{p:3}},e&&i().createElement(l.Typography,{sx:{mb:2}},e||m().translate("stripe_form.title")),i().createElement(a.PaymentElement,{options:g({layout:"tabs"},s)}),i().createElement(l.Button,{fullWidth:!0,type:"submit",variant:"contained",disabled:!b||v,sx:{mt:2}},v?m().translate("stripe_form.processing"):m().translate("stripe_form.button_cta",{amount:(0,d.currencyAmountFromCents)(t)})))},v=({paymentIntent:e,paymentProfile:t,client:r,redirectUrl:n,paymentOptions:c,stripeFormTitle:u,onPaymentSuccess:l,onPaymentError:p,updatePaymentIntent:m})=>{const{test_mode_enabled:d,test_publishable_key:f,live_publishable_key:y}=t||{},b=d?f:y,g=(0,o.useMemo)((()=>b?(0,s.loadStripe)(b):null),[b]);if(!t||null==e||!e.client_secret||!b)return null;const _={clientSecret:e.client_secret,appearance:{theme:"stripe"}};return i().createElement(a.Elements,{stripe:g,options:_},i().createElement(O,{title:u,client:r,amount:e.total_amount,redirectUrl:n,paymentOptions:c,onSuccess:l,onError:p,onPaymentMethodChange:m}))};return n})()));
|
|
2
2
|
//# sourceMappingURL=stripe-payment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/mui/stripe-payment.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,6ECTF,MAAMC,EAAe,KACfC,EAAqB,EAGrBC,EAAW,C,oECYjB,MAwSMC,EAAsBA,IAAwB,oBAAXC,UAA4BA,OAAOC,U,sECnSnF,MAAMC,EAAkB,CACpBC,IAAK,IACLC,IAAK,IACLC,IAAK,IACLC,IAAK,KACLC,IAAK,KACLC,IAAK,MACLC,IAAK,MACLC,IAAK,MACLC,IAAK,KACLC,IAAK,OA+HF,SAASC,EAAwBC,EAAOC,EAAY,OACvD,GAAqB,iBAAVD,IAAuBE,OAAOC,UAAUH,GAC/C,MAAM,IAAII,MAAM,mCAGpB,MAAMC,EA3CH,SAAyBL,GAC5B,IAAIM,EAGJ,GAAqB,iBAAVN,EACPM,EAAIN,OACD,GAAqB,iBAAVA,EAAoB,CAElC,IAAKE,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,gBACAmC,iBACA/D,SACAC,cACA+D,kBACAC,mBACAC,iBACAC,0BAEA,MAAM,kBAAEC,EAAiB,qBAAEC,EAAoB,qBAAEC,GAAyBP,GAAkB,CAAC,EACvFQ,EAAcH,EAAoBC,EAAuBC,EACzDE,GAAgBC,EAAAA,EAAAA,UACpB,IAAOF,GAAcG,EAAAA,EAAAA,YAAWH,GAAe,MAC/C,CAACA,IAGH,IAAKR,GAAmBnC,UAAAA,EAAe+C,gBAAkBJ,EAAa,OAAO,KAE7E,MAAMhB,EAAU,CACdqB,aAAchD,EAAc+C,cAC5BE,WAAY,CAAEC,MAAO,WAGvB,OACE1D,IAAAA,cAAC2D,EAAAA,SAAQ,CAAC1E,OAAQmE,EAAejB,QAASA,GACxCnC,IAAAA,cAACtB,EAAU,CACTC,MAAOiE,EACPhE,OAAQA,EACRxD,OAAQoF,EAAcoD,aACtB/E,YAAaA,EACbC,UAAW+D,EACX9D,QAAS+D,EACT9D,sBAAuB+D,IAEhB,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/utils/constants.js","webpack://openstack-uicore-foundation/./src/utils/methods.js","webpack://openstack-uicore-foundation/./src/utils/money.js","webpack://openstack-uicore-foundation/external commonjs \"moment-timezone\"","webpack://openstack-uicore-foundation/external commonjs \"urijs\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"@stripe/stripe-js\"","webpack://openstack-uicore-foundation/external commonjs \"@stripe/react-stripe-js\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"@sentry/react\"","webpack://openstack-uicore-foundation/./src/components/mui/StripePayment/stripe-form.jsx","webpack://openstack-uicore-foundation/./src/components/mui/StripePayment/helpers.js","webpack://openstack-uicore-foundation/./src/components/mui/StripePayment/index.jsx"],"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 ","export const CENTS_FACTOR = 100n;\nexport const TWO_DECIMAL_PLACES = 2;\nexport const THREE_DECIMAL_PLACES = 3;\nexport const ONE_CENT = 1n;\nexport const ZERO_INT = 0;\n\nexport const CODE_200 = 200;\n\nexport const DEBOUNCE_WAIT_250 = 250;\nexport const DEBOUNCE_WAIT = 500;\n\nexport const NOTIFICATION_TIMEOUT = 2000;\nexport const DEFAULT_PER_PAGE = 10;\nexport const TWENTY_PER_PAGE = 20;\nexport const FIFTY_PER_PAGE = 50;\nexport const MAX_PER_PAGE = 100;\n\nexport const INT_BASE = 10;\n\nexport const ONE_HUNDRED = 100;\nexport const MILLISECONDS_IN_SECOND = 1000;\n\nexport const MILLISECONDS_TO_SECONDS = 1000;\n\nexport const BYTES_PER_MB = 1_048_576; // 1024 * 1024\n\nexport const MAX_INVENTORY_IMAGE_UPLOAD_SIZE = 512000;\nexport const MAX_INVENTORY_IMAGES_UPLOAD_QTY = 5;\nexport const ALLOWED_INVENTORY_IMAGE_FORMATS = [\"jpg\", \"jpeg\", \"png\"];\n\nexport const METAFIELD_TYPES_WITH_OPTIONS = [\n \"CheckBoxList\",\n \"ComboBox\",\n \"RadioButtonList\"\n];\n\nexport const METAFIELD_TYPES = [\n \"CheckBox\",\n ...METAFIELD_TYPES_WITH_OPTIONS,\n \"Text\",\n \"TextArea\",\n \"Quantity\",\n \"DateTime\",\n \"Time\"\n];\n\nexport const DISCOUNT_TYPES = {\n AMOUNT: \"Amount\",\n RATE: \"Rate\"\n};\n\nexport const RATE_FIELDS = {\n EARLY_BIRD: \"early_bird_rate\",\n STANDARD: \"standard_rate\",\n ONSITE: \"onsite_rate\"\n};\n\nexport const DECIMAL_DIGITS = 2;\n\nexport const FILE_UPLOAD_STATUS = {\n PENDING: \"PENDING\",\n DEADLINE_ALERT: \"DEADLINE ALERT\",\n DEADLINE_MISSED: \"DEADLINE MISSED\",\n COMPLETE: \"COMPLETE\"\n};\n\nexport const FILE_UPLOAD_STATUS_COLOR = {\n [FILE_UPLOAD_STATUS.COMPLETE]: \"success.light\",\n [FILE_UPLOAD_STATUS.DEADLINE_MISSED]: \"error\",\n [FILE_UPLOAD_STATUS.DEADLINE_ALERT]: \"warning.light\",\n [FILE_UPLOAD_STATUS.PENDING]: \"default\"\n};\n\nexport const FILE_UPLOAD_STATUS_BKGR_COLOR = {\n [FILE_UPLOAD_STATUS.COMPLETE]: \"white\",\n [FILE_UPLOAD_STATUS.DEADLINE_MISSED]: \"#D32F2F0A\",\n [FILE_UPLOAD_STATUS.DEADLINE_ALERT]: \"#EF6C000A\",\n [FILE_UPLOAD_STATUS.PENDING]: \"white\"\n};","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport moment from 'moment-timezone';\nimport URI from \"urijs\";\n\nexport const findElementPos = (obj) => {\n var curtop = -70;\n if (obj.offsetParent) {\n do {\n curtop += obj.offsetTop;\n } while (obj = obj.offsetParent);\n return [curtop];\n }\n};\n\nexport const epochToMoment = (atime) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime);\n};\n\nexport const epochToMomentTimeZone = (atime, time_zone) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime).tz(time_zone);\n};\n\nexport const formatEpoch = (atime, format = 'M/D/YYYY h:mm a') => {\n if(!atime) return atime;\n return epochToMoment(atime).format(format);\n};\n\nexport const parseLocationHour = (hour) => {\n let parsedHour = hour.toString();\n if(parsedHour.length < 4) parsedHour = `0${parsedHour}`;\n parsedHour = parsedHour.match(/.{2}/g);\n parsedHour = parsedHour.join(':');\n return parsedHour;\n}\n\nexport const objectToQueryString = (obj) => {\n var str = \"\";\n for (var key in obj) {\n if (str != \"\") {\n str += \"&\";\n }\n str += key + \"=\" + encodeURIComponent(obj[key]);\n }\n\n return str;\n};\n\nexport const getBackURL = () => {\n let url = URI(window.location.href);\n let query = url.search(true);\n let fragment = url.fragment();\n let backUrl = query.hasOwnProperty('BackUrl') ? query['BackUrl'] : null;\n if(backUrl != null && fragment != null && fragment != ''){\n backUrl += `#${fragment}`;\n }\n return backUrl;\n};\n\nexport const toSlug = (text) =>{\n text = text.toLowerCase();\n return text.replace(/[^a-zA-Z0-9]+/g,'_');\n}\n\nexport const getAuthCallback = () => {\n if(typeof window !== 'undefined') {\n return `${window.location.origin}/auth/callback`;\n }\n return null;\n};\n\nexport const getCurrentLocation = () => {\n let location = '';\n if(typeof window !== 'undefined') {\n location = window.location;\n // check if we are on iframe\n if (window.top)\n location = window.top.location;\n }\n return location;\n};\n\nexport const getOrigin = () => {\n if(typeof window !== 'undefined') {\n return window.location.origin;\n }\n return null;\n};\n\nexport const getCurrentPathName = () => {\n if(typeof window !== 'undefined') {\n return window.location.pathname;\n }\n return null;\n};\n\nexport const getCurrentHref = () => {\n if(typeof window !== 'undefined') {\n return window.location.href;\n }\n return null;\n};\n\nexport const getAllowedUserGroups = () => {\n if(typeof window !== 'undefined') {\n return window.ALLOWED_USER_GROUPS || '';\n }\n return null;\n};\n\nexport const buildAPIBaseUrl = (relativeUrl) => {\n if(typeof window !== 'undefined'){\n return `${window.API_BASE_URL}${relativeUrl}`;\n }\n return null``;\n};\n\nexport const putOnLocalStorage = (key, value) => {\n if(typeof window !== 'undefined') {\n window.localStorage.setItem(key, value);\n }\n};\n\nexport const getFromLocalStorage = (key, removeIt) => {\n if(typeof window !== 'undefined') {\n let val = window.localStorage.getItem(key);\n if(removeIt){\n console.log(`getFromLocalStorage removing key ${key}`);\n removeFromLocalStorage(key);\n }\n return val;\n }\n return null;\n};\n\nexport const removeFromLocalStorage = (key) => {\n if(typeof window !== 'undefined') {\n window.localStorage.removeItem(key);\n }\n}\n\nexport const isClearingSessionState = () => {\n if(typeof window !== 'undefined') {\n return window.clearing_session_state;\n }\n return false;\n};\n\nexport const setSessionClearingState = (val) => {\n if(typeof window !== 'undefined') {\n window.clearing_session_state = val;\n }\n};\n\nexport const getCurrentUserLanguage = () => {\n let language = 'en';\n if(typeof navigator !== 'undefined') {\n language = (navigator.languages && navigator.languages[0]) || navigator.language || navigator.userLanguage;\n }\n return language;\n};\n\nexport const scrollToError = (errors) => {\n if(Object.keys(errors).length > 0) {\n const firstError = Object.keys(errors)[0];\n const firstNode = document.getElementById(firstError);\n if (firstNode) window.scrollTo(0, findElementPos(firstNode));\n }\n};\n\nexport const hasErrors = (field, errors) => {\n if(field in errors) {\n return errors[field];\n }\n return '';\n};\n\nexport const shallowEqual = (object1, object2) => {\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (let key of keys1) {\n if (object1[key] !== object2[key]) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const arraysEqual = (a1, a2) =>\n a1.length === a2.length && a1.every((o, idx) => shallowEqual(o, a2[idx]));\n\nexport const isEmpty = (obj) => {\n return Object.keys(obj).length === 0;\n};\n\n\nexport const base64URLEncode = (str) => {\n return str\n .toString('base64')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '')\n}\n\nexport const retryPromise = async (\n cb,\n maxNumberOfRetries = 3\n) => {\n for (let i = 0; i < maxNumberOfRetries; i++) {\n if (await cb()) {\n return true;\n }\n }\n\n return false;\n}\n\nexport const getTimeServiceUrl = () => {\n if(typeof window !== 'undefined') {\n return window.TIMEINTERVALSINCE1970_API_URL || process.env.TIMEINTERVALSINCE1970_API_URL;\n }\n return null;\n};\n\nexport const getEventLocation = (event, summitVenueCount, summitShowLocDate = null, nowUtc = null) => {\n const shouldShowVenues = (summitShowLocDate && nowUtc) ? summitShowLocDate * 1000 < nowUtc : true;\n const locationName = [];\n const { location } = event;\n\n if (!shouldShowVenues) return 'TBA';\n\n if (!location) return 'TBA';\n\n if (summitVenueCount > 1 && location.venue?.name) locationName.push(location.venue.name);\n if (location.floor?.name) locationName.push(location.floor.name);\n if (location.name) locationName.push(location.name);\n\n return locationName.length > 0 ? locationName.join(' - ') : 'TBA';\n};\n\nexport const getEventHosts = (event) => {\n let hosts = [];\n if (event.speakers?.length > 0) {\n hosts = [...event.speakers];\n }\n if (event.moderator) hosts.push(event.moderator);\n\n return hosts;\n};\n\nconst loadImage = async url => {\n const img = document.createElement('img')\n img.src = url\n img.crossOrigin = 'anonymous'\n\n return new Promise((resolve, reject) => {\n img.onload = () => resolve(img)\n img.onerror = reject\n })\n}\n\nexport const convertSVGtoImg = async (svgUrl) => {\n const img = await loadImage(svgUrl)\n const newWidth = 100\n const newHeight = Math.floor(img.naturalHeight * 100 / img.naturalWidth)\n\n const canvas = document.createElement('canvas')\n canvas.width = newWidth\n canvas.height = newHeight\n canvas.getContext('2d').drawImage(img, 0, 0, newWidth, newHeight)\n\n const url = await canvas.toDataURL(`image/png`, 1.0)\n console.log(url, newWidth, newHeight);\n return {url, width: newWidth, height: newHeight}\n}\n\nexport const isRateEnabled = (value) =>\n value !== null && value !== undefined && value !== \"\";\n\n/**\n * Returns true if value is null, undefined, empty/whitespace string,\n * empty array, or empty object.\n */\nexport const empty = (value) => {\n if (value === null || value === undefined) return true;\n if (typeof value === \"string\") return value.trim().length === 0;\n if (Array.isArray(value)) return value.length === 0;\n if (typeof value === \"object\") return Object.keys(value).length === 0;\n return false;\n};\n\nexport const isSentryInitialized = () => typeof window !== \"undefined\" && !!window.SENTRY_DSN;\n","/**\n * Copyright 2025 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 {\n CENTS_FACTOR,\n THREE_DECIMAL_PLACES,\n TWO_DECIMAL_PLACES,\n ZERO_INT,\n ONE_CENT\n} from \"./constants\";\n\nconst CURRENCY_SYMBOL = {\n USD: \"$\",\n EUR: \"€\",\n GBP: \"£\",\n CAD: \"C$\",\n AUD: \"A$\",\n NZD: \"NZ$\",\n CHF: \"CHF\",\n ARS: \"AR$\",\n BRL: \"R$\",\n MXN: \"MX$\",\n};\n\n/**\n * Convert a decimal money amount to integer cents safely (no floating point math).\n *\n * Why this exists:\n * - `Math.round(parseFloat(x) * 100)` can be wrong due to IEEE-754 floating point errors\n * (e.g. 1.005 * 100 may become 100.499999..., rounding down unexpectedly).\n *\n * Input:\n * - number or string (recommended: string from API/UI)\n * - Examples: \"12.34\", \"1,234.56\", \"1234,56\", 12.34\n *\n * Output:\n * - Number cents (exact), e.g. \"12.34\" -> 1234\n *\n * Rounding:\n * - Half-up to 2 decimals (>= 0.005 USD rounds up by 1 cent).\n *\n * Notes:\n * - Amounts are assumed to be NON-negative (per your requirement).\n * - Throws on invalid formats (does not silently return 0).\n */\nexport function amountToCents(amount) {\n if (amount == null) throw new Error(\"amount is required\");\n\n let s = String(amount).trim();\n\n // Normalize common separators:\n // - \"1,234.56\" => \"1234.56\" (remove thousands separators)\n // - \"1234,56\" => \"1234.56\" (convert decimal comma to dot)\n if (s.includes(\",\") && s.includes(\".\")) {\n s = s.replace(/,/g, \"\");\n } else if (s.includes(\",\") && !s.includes(\".\")) {\n s = s.replace(\",\", \".\");\n }\n\n // Validate: digits optionally followed by '.' and more digits\n if (!/^\\d+(\\.\\d+)?$/.test(s)) {\n throw new Error(`Invalid money format: \"${amount}\"`);\n }\n\n const [intPart, fracRaw = \"\"] = s.split(\".\");\n\n // Pad at least 3 fractional digits so we can:\n // - take 2 digits for cents\n // - take the 3rd digit to decide rounding\n const fracPadded = (`${fracRaw }000`);\n\n const tenths = fracPadded[0] ?? \"0\"; // 1st decimal digit\n const hundredths = fracPadded[1] ?? \"0\"; // 2nd decimal digit (cents)\n const thousandths = fracPadded[2] ?? \"0\"; // 3rd decimal digit (rounding decision)\n\n // If there are more than 3 decimals, we track if any non-zero exists after the 3rd.\n // This can matter for policies like bankers rounding; here it's mainly informational.\n const trailing =\n fracRaw.length > THREE_DECIMAL_PLACES\n ? fracRaw.slice(THREE_DECIMAL_PLACES)\n : \"\";\n const hasTrailingNonZero = /[1-9]/.test(trailing);\n\n // Build cents as integer: (dollars * 100) + (first two decimal digits)\n let cents = BigInt(intPart) * CENTS_FACTOR + BigInt(tenths + hundredths);\n\n // Half-up rounding:\n // - If the 3rd digit is >= 5, round up by 1 cent.\n // - If there are more digits beyond the 3rd, \"5xxx\" should also round up.\n const roundUp = thousandths > \"5\" || thousandths === \"5\" || (thousandths === \"5\" && hasTrailingNonZero);\n\n if (roundUp) cents += ONE_CENT;\n\n return Number(cents);\n}\n\n/**\n * Convert an amount in cents to a decimal string (e.g. 1234 -> \"12.34\") safely.\n *\n * Why:\n * - Avoids floating point math (cents / 100) which can lose precision for large integers\n * or if cents is already imprecise as a JS Number.\n *\n * Input:\n * - Accepts: bigint | number | string (digits)\n * - Assumes NON-negative cents (per your requirement).\n *\n * Output:\n * - Always returns a string with exactly 2 decimal places.\n */\nexport function amountFromCents(cents) {\n let c;\n\n // Normalize input to BigInt safely\n if (typeof cents === \"bigint\") {\n c = cents;\n } else if (typeof cents === \"number\") {\n // Ensure it's a safe integer before converting to BigInt\n if (!Number.isSafeInteger(cents)) {\n throw new Error(\"cents must be a safe integer Number (or pass BigInt/string).\");\n }\n c = BigInt(cents);\n } else if (typeof cents === \"string\") {\n const s = cents.trim();\n if (!/^\\d+$/.test(s)) {\n throw new Error(\"cents string must contain digits only (e.g., '1234').\");\n }\n c = BigInt(s);\n } else {\n throw new Error(\"cents must be a bigint, number, or numeric string.\");\n }\n\n if (c < ZERO_INT) {\n throw new Error(\"cents must be non-negative.\");\n }\n\n const amount = c / CENTS_FACTOR;\n const remainder = c % CENTS_FACTOR;\n\n // Always pad remainder to 2 digits\n return `${amount.toString()}.${remainder.toString().padStart(TWO_DECIMAL_PLACES, \"0\")}`;\n}\n\n/**\n * @param cents\n * @param currency\n * @returns {string}\n */\nexport function currencyAmountFromCents(cents, currency = \"USD\"){\n if (typeof cents !== \"number\" || !Number.isInteger(cents)) {\n throw new Error(\"cents must be an integer number\");\n }\n\n const amount = amountFromCents(cents); // \"12.34\"\n const symbol = CURRENCY_SYMBOL[currency] ?? \"$\";\n return `${symbol}${amount}`;\n}\n\n/**\n * Converts a price string into cents.\n * @param {string} priceString - The price (e.g., $0.30).\n * @returns {number} - The amount converted to cents (e.g., 30).\n */\nexport const parsePrice = (priceString) => {\n if (priceString == null) throw new Error(\"priceString is required\");\n\n let s = String(priceString).trim();\n\n // Reject negatives explicitly (per your requirement).\n if (s.includes(\"-\")) throw new Error(\"Negative amounts are not allowed\");\n\n // Keep only digits and separators. Remove currency symbols/letters/spaces.\n s = s.replace(/[^\\d.,]/g, \"\");\n if (!s) throw new Error(`Invalid price: \"${priceString}\"`);\n\n // Delegate exact cents conversion (no floats)\n return amountToCents(s); // <- your safe BigInt cents converter\n};\n","module.exports = require(\"moment-timezone\");","module.exports = require(\"urijs\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@stripe/stripe-js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@stripe/react-stripe-js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/defineProperty\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"i18n-react\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@sentry/react\");","/**\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, useState} from \"react\";\nimport {Box, Button, Typography} from \"@mui/material\";\nimport T from \"i18n-react\";\nimport {PaymentElement, useElements, useStripe} from \"@stripe/react-stripe-js\";\nimport {currencyAmountFromCents} from \"../../../utils/money\";\nimport {handleSentryException} from \"./helpers\";\n\nconst buildAddress = (userAddress = {}) => {\n const address = {};\n // stripe payment payload requires data that's not an empty string\n if (userAddress.locality) address.city = userAddress.locality;\n if (userAddress.country) address.country = userAddress.country;\n if (userAddress.address1) address.line1 = userAddress.address1;\n if (userAddress.address2) address.line2 = userAddress.address2;\n if (userAddress.postal_code) address.postal_code = userAddress.postal_code;\n if (userAddress.region) address.state = userAddress.region;\n\n if (Object.keys(address).length > 0) return {address};\n return {};\n};\n\nconst StripeForm = ({\n title,\n amount = 0,\n client,\n redirectUrl,\n onSuccess,\n onError,\n onPaymentMethodChange\n}) => {\n const stripe = useStripe();\n const elements = useElements();\n const [loading, setLoading] = useState(false);\n\n useEffect(() => {\n if (elements) {\n const pe = elements.getElement(\"payment\");\n const handlePaymentMethodChange = (event) => {\n if (event.value.type) {\n onPaymentMethodChange(event.value.type);\n }\n };\n\n pe.on(\"change\", handlePaymentMethodChange);\n\n return () => {\n pe.off(\"change\", handlePaymentMethodChange);\n };\n }\n }, [elements]);\n\n const handleSubmit = async (e) => {\n e.preventDefault();\n\n if (!stripe || !elements || loading) return;\n\n setLoading(true);\n\n const {error, paymentIntent} = await stripe.confirmPayment({\n elements,\n confirmParams: {\n return_url: `${window.location.origin}${redirectUrl}`,\n payment_method_data: {\n billing_details: {\n name: `${client.first_name} ${client.last_name}`,\n email: client.email,\n ...buildAddress(client.address)\n }\n }\n },\n redirect: \"if_required\"\n });\n\n if (error) {\n onError?.(error.message);\n setLoading(false);\n } else if (paymentIntent?.status === \"succeeded\") {\n try {\n await onSuccess?.(paymentIntent);\n } catch (err) {\n handleSentryException(err);\n onError?.(T.translate(\"stripe_form.payment_confirmation_error\"));\n // Do not call setLoading(false) — payment already succeeded, keep form locked\n }\n // On success, keep loading=true so the button stays disabled until navigation\n } else if (paymentIntent?.status === \"processing\") {\n // Payment is async and still in flight — keep the form locked\n } else {\n // Genuinely retryable statuses (e.g. requires_action) — re-enable submission\n setLoading(false);\n }\n };\n\n return (\n <Box component=\"form\" onSubmit={handleSubmit} sx={{p: 3}}>\n {title &&\n <Typography sx={{mb: 2}}>\n {title || T.translate(\"stripe_form.title\")}\n </Typography>\n }\n\n <PaymentElement\n options={{\n layout: \"tabs\"\n }}\n />\n <Button\n fullWidth\n type=\"submit\"\n variant=\"contained\"\n disabled={!stripe || loading}\n sx={{mt: 2}}\n >\n {loading ? T.translate(\"stripe_form.processing\") : T.translate(\"stripe_form.button_cta\", {amount: currencyAmountFromCents(amount)})}\n </Button>\n </Box>\n );\n};\n\nexport default StripeForm;\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 * as Sentry from \"@sentry/react\";\nimport {isSentryInitialized} from \"../../../utils/methods\";\n\nexport const handleSentryException = (err) =>\n isSentryInitialized()\n ? Sentry.captureException(err)\n : console.log(\"Error on registration: \", err);","/**\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, { useMemo } from \"react\";\nimport { loadStripe } from \"@stripe/stripe-js\";\nimport { Elements } from \"@stripe/react-stripe-js\";\nimport StripeForm from \"./stripe-form\";\n\nconst StripePayment = ({\n paymentIntent,\n paymentProfile,\n client,\n redirectUrl,\n stripeFormTitle,\n onPaymentSuccess,\n onPaymentError,\n updatePaymentIntent\n}) => {\n const { test_mode_enabled, test_publishable_key, live_publishable_key } = paymentProfile || {};\n const providerKey = test_mode_enabled ? test_publishable_key : live_publishable_key;\n const stripePromise = useMemo(\n () => (providerKey ? loadStripe(providerKey) : null),\n [providerKey]\n );\n\n if (!paymentProfile || !paymentIntent?.client_secret || !providerKey) return null;\n\n const options = {\n clientSecret: paymentIntent.client_secret,\n appearance: { theme: \"stripe\" }\n };\n\n return (\n <Elements stripe={stripePromise} options={options}>\n <StripeForm\n title={stripeFormTitle}\n client={client}\n amount={paymentIntent.total_amount}\n redirectUrl={redirectUrl}\n onSuccess={onPaymentSuccess}\n onError={onPaymentError}\n onPaymentMethodChange={updatePaymentIntent}\n />\n </Elements>\n );\n};\n\nexport default StripePayment;\n"],"names":["root","factory","exports","module","define","amd","this","CENTS_FACTOR","TWO_DECIMAL_PLACES","ZERO_INT","isSentryInitialized","window","SENTRY_DSN","CURRENCY_SYMBOL","USD","EUR","GBP","CAD","AUD","NZD","CHF","ARS","BRL","MXN","currencyAmountFromCents","cents","currency","Number","isInteger","Error","amount","c","isSafeInteger","BigInt","s","trim","test","remainder","toString","padStart","amountFromCents","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","buildAddress","userAddress","address","locality","city","country","address1","line1","address2","line2","postal_code","region","state","keys","length","StripeForm","title","client","redirectUrl","onSuccess","onError","onPaymentMethodChange","stripe","useStripe","elements","useElements","loading","setLoading","useState","useEffect","pe","getElement","handlePaymentMethodChange","event","type","on","off","React","Box","component","onSubmit","async","e","preventDefault","error","paymentIntent","confirmPayment","confirmParams","return_url","location","origin","payment_method_data","billing_details","_objectSpread","name","first_name","last_name","email","redirect","message","status","err","Sentry","console","log","handleSentryException","T","sx","p","Typography","mb","PaymentElement","options","layout","Button","fullWidth","variant","disabled","mt","StripePayment","paymentProfile","stripeFormTitle","onPaymentSuccess","onPaymentError","updatePaymentIntent","test_mode_enabled","test_publishable_key","live_publishable_key","providerKey","stripePromise","useMemo","loadStripe","client_secret","clientSecret","appearance","theme","Elements","total_amount"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"components/mui/stripe-payment.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,6ECTF,MAAMC,EAAe,KACfC,EAAqB,EAGrBC,EAAW,C,oECYjB,MAwSMC,EAAsBA,IAAwB,oBAAXC,UAA4BA,OAAOC,U,sECnSnF,MAAMC,EAAkB,CACpBC,IAAK,IACLC,IAAK,IACLC,IAAK,IACLC,IAAK,KACLC,IAAK,KACLC,IAAK,MACLC,IAAK,MACLC,IAAK,MACLC,IAAK,KACLC,IAAK,OA+HF,SAASC,EAAwBC,EAAOC,EAAY,OACvD,GAAqB,iBAAVD,IAAuBE,OAAOC,UAAUH,GAC/C,MAA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C,KAAK,SACL2C,QAAQ,YACRC,UAAWxD,GAAUI,EACrB0C,GAAI,CAACW,GAAI,IAERrD,EAAUyC,IAAAA,UAAY,0BAA4BA,IAAAA,UAAY,yBAA0B,CAAC3G,QAAQN,EAAAA,EAAAA,yBAAwBM,MAExH,EEvEV,EAzCsBwH,EACpBnC,gBACAoC,iBACAjE,SACAC,cACAC,iBACAgE,kBACAC,mBACAC,iBACAC,0BAEA,MAAM,kBAAEC,EAAiB,qBAAEC,EAAoB,qBAAEC,GAAyBP,GAAkB,CAAC,EACvFQ,EAAcH,EAAoBC,EAAuBC,EACzDE,GAAgBC,EAAAA,EAAAA,UACpB,IAAOF,GAAcG,EAAAA,EAAAA,YAAWH,GAAe,MAC/C,CAACA,IAGH,IAAKR,GAAmBpC,UAAAA,EAAegD,gBAAkBJ,EAAa,OAAO,KAE7E,MAAMhB,EAAU,CACdqB,aAAcjD,EAAcgD,cAC5BE,WAAY,CAAEC,MAAO,WAGvB,OACE3D,IAAAA,cAAC4D,EAAAA,SAAQ,CAAC3E,OAAQoE,EAAejB,QAASA,GACxCpC,IAAAA,cAACvB,EAAU,CACTC,MAAOmE,EACPlE,OAAQA,EACRxD,OAAQqF,EAAcqD,aACtBjF,YAAaA,EACbC,eAAgBA,EAChBC,UAAWgE,EACX/D,QAASgE,EACT/D,sBAAuBgE,IAEhB,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/utils/constants.js","webpack://openstack-uicore-foundation/./src/utils/methods.js","webpack://openstack-uicore-foundation/./src/utils/money.js","webpack://openstack-uicore-foundation/external commonjs \"moment-timezone\"","webpack://openstack-uicore-foundation/external commonjs \"urijs\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"@stripe/stripe-js\"","webpack://openstack-uicore-foundation/external commonjs \"@stripe/react-stripe-js\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"@sentry/react\"","webpack://openstack-uicore-foundation/./src/components/mui/StripePayment/stripe-form.jsx","webpack://openstack-uicore-foundation/./src/components/mui/StripePayment/helpers.js","webpack://openstack-uicore-foundation/./src/components/mui/StripePayment/index.jsx"],"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 ","export const CENTS_FACTOR = 100n;\nexport const TWO_DECIMAL_PLACES = 2;\nexport const THREE_DECIMAL_PLACES = 3;\nexport const ONE_CENT = 1n;\nexport const ZERO_INT = 0;\n\nexport const CODE_200 = 200;\n\nexport const DEBOUNCE_WAIT_250 = 250;\nexport const DEBOUNCE_WAIT = 500;\n\nexport const NOTIFICATION_TIMEOUT = 2000;\nexport const DEFAULT_PER_PAGE = 10;\nexport const TWENTY_PER_PAGE = 20;\nexport const FIFTY_PER_PAGE = 50;\nexport const MAX_PER_PAGE = 100;\n\nexport const INT_BASE = 10;\n\nexport const ONE_HUNDRED = 100;\nexport const MILLISECONDS_IN_SECOND = 1000;\n\nexport const MILLISECONDS_TO_SECONDS = 1000;\n\nexport const BYTES_PER_MB = 1_048_576; // 1024 * 1024\n\nexport const MAX_INVENTORY_IMAGE_UPLOAD_SIZE = 512000;\nexport const MAX_INVENTORY_IMAGES_UPLOAD_QTY = 5;\nexport const ALLOWED_INVENTORY_IMAGE_FORMATS = [\"jpg\", \"jpeg\", \"png\"];\n\nexport const METAFIELD_TYPES_WITH_OPTIONS = [\n \"CheckBoxList\",\n \"ComboBox\",\n \"RadioButtonList\"\n];\n\nexport const METAFIELD_TYPES = [\n \"CheckBox\",\n ...METAFIELD_TYPES_WITH_OPTIONS,\n \"Text\",\n \"TextArea\",\n \"Quantity\",\n \"DateTime\",\n \"Time\"\n];\n\nexport const DISCOUNT_TYPES = {\n AMOUNT: \"Amount\",\n RATE: \"Rate\"\n};\n\nexport const RATE_FIELDS = {\n EARLY_BIRD: \"early_bird_rate\",\n STANDARD: \"standard_rate\",\n ONSITE: \"onsite_rate\"\n};\n\nexport const DECIMAL_DIGITS = 2;\n\nexport const FILE_UPLOAD_STATUS = {\n PENDING: \"PENDING\",\n DEADLINE_ALERT: \"DEADLINE ALERT\",\n DEADLINE_MISSED: \"DEADLINE MISSED\",\n COMPLETE: \"COMPLETE\"\n};\n\nexport const FILE_UPLOAD_STATUS_COLOR = {\n [FILE_UPLOAD_STATUS.COMPLETE]: \"success.light\",\n [FILE_UPLOAD_STATUS.DEADLINE_MISSED]: \"error\",\n [FILE_UPLOAD_STATUS.DEADLINE_ALERT]: \"warning.light\",\n [FILE_UPLOAD_STATUS.PENDING]: \"default\"\n};\n\nexport const FILE_UPLOAD_STATUS_BKGR_COLOR = {\n [FILE_UPLOAD_STATUS.COMPLETE]: \"white\",\n [FILE_UPLOAD_STATUS.DEADLINE_MISSED]: \"#D32F2F0A\",\n [FILE_UPLOAD_STATUS.DEADLINE_ALERT]: \"#EF6C000A\",\n [FILE_UPLOAD_STATUS.PENDING]: \"white\"\n};","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport moment from 'moment-timezone';\nimport URI from \"urijs\";\n\nexport const findElementPos = (obj) => {\n var curtop = -70;\n if (obj.offsetParent) {\n do {\n curtop += obj.offsetTop;\n } while (obj = obj.offsetParent);\n return [curtop];\n }\n};\n\nexport const epochToMoment = (atime) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime);\n};\n\nexport const epochToMomentTimeZone = (atime, time_zone) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime).tz(time_zone);\n};\n\nexport const formatEpoch = (atime, format = 'M/D/YYYY h:mm a') => {\n if(!atime) return atime;\n return epochToMoment(atime).format(format);\n};\n\nexport const parseLocationHour = (hour) => {\n let parsedHour = hour.toString();\n if(parsedHour.length < 4) parsedHour = `0${parsedHour}`;\n parsedHour = parsedHour.match(/.{2}/g);\n parsedHour = parsedHour.join(':');\n return parsedHour;\n}\n\nexport const objectToQueryString = (obj) => {\n var str = \"\";\n for (var key in obj) {\n if (str != \"\") {\n str += \"&\";\n }\n str += key + \"=\" + encodeURIComponent(obj[key]);\n }\n\n return str;\n};\n\nexport const getBackURL = () => {\n let url = URI(window.location.href);\n let query = url.search(true);\n let fragment = url.fragment();\n let backUrl = query.hasOwnProperty('BackUrl') ? query['BackUrl'] : null;\n if(backUrl != null && fragment != null && fragment != ''){\n backUrl += `#${fragment}`;\n }\n return backUrl;\n};\n\nexport const toSlug = (text) =>{\n text = text.toLowerCase();\n return text.replace(/[^a-zA-Z0-9]+/g,'_');\n}\n\nexport const getAuthCallback = () => {\n if(typeof window !== 'undefined') {\n return `${window.location.origin}/auth/callback`;\n }\n return null;\n};\n\nexport const getCurrentLocation = () => {\n let location = '';\n if(typeof window !== 'undefined') {\n location = window.location;\n // check if we are on iframe\n if (window.top)\n location = window.top.location;\n }\n return location;\n};\n\nexport const getOrigin = () => {\n if(typeof window !== 'undefined') {\n return window.location.origin;\n }\n return null;\n};\n\nexport const getCurrentPathName = () => {\n if(typeof window !== 'undefined') {\n return window.location.pathname;\n }\n return null;\n};\n\nexport const getCurrentHref = () => {\n if(typeof window !== 'undefined') {\n return window.location.href;\n }\n return null;\n};\n\nexport const getAllowedUserGroups = () => {\n if(typeof window !== 'undefined') {\n return window.ALLOWED_USER_GROUPS || '';\n }\n return null;\n};\n\nexport const buildAPIBaseUrl = (relativeUrl) => {\n if(typeof window !== 'undefined'){\n return `${window.API_BASE_URL}${relativeUrl}`;\n }\n return null``;\n};\n\nexport const putOnLocalStorage = (key, value) => {\n if(typeof window !== 'undefined') {\n window.localStorage.setItem(key, value);\n }\n};\n\nexport const getFromLocalStorage = (key, removeIt) => {\n if(typeof window !== 'undefined') {\n let val = window.localStorage.getItem(key);\n if(removeIt){\n console.log(`getFromLocalStorage removing key ${key}`);\n removeFromLocalStorage(key);\n }\n return val;\n }\n return null;\n};\n\nexport const removeFromLocalStorage = (key) => {\n if(typeof window !== 'undefined') {\n window.localStorage.removeItem(key);\n }\n}\n\nexport const isClearingSessionState = () => {\n if(typeof window !== 'undefined') {\n return window.clearing_session_state;\n }\n return false;\n};\n\nexport const setSessionClearingState = (val) => {\n if(typeof window !== 'undefined') {\n window.clearing_session_state = val;\n }\n};\n\nexport const getCurrentUserLanguage = () => {\n let language = 'en';\n if(typeof navigator !== 'undefined') {\n language = (navigator.languages && navigator.languages[0]) || navigator.language || navigator.userLanguage;\n }\n return language;\n};\n\nexport const scrollToError = (errors) => {\n if(Object.keys(errors).length > 0) {\n const firstError = Object.keys(errors)[0];\n const firstNode = document.getElementById(firstError);\n if (firstNode) window.scrollTo(0, findElementPos(firstNode));\n }\n};\n\nexport const hasErrors = (field, errors) => {\n if(field in errors) {\n return errors[field];\n }\n return '';\n};\n\nexport const shallowEqual = (object1, object2) => {\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (let key of keys1) {\n if (object1[key] !== object2[key]) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const arraysEqual = (a1, a2) =>\n a1.length === a2.length && a1.every((o, idx) => shallowEqual(o, a2[idx]));\n\nexport const isEmpty = (obj) => {\n return Object.keys(obj).length === 0;\n};\n\n\nexport const base64URLEncode = (str) => {\n return str\n .toString('base64')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '')\n}\n\nexport const retryPromise = async (\n cb,\n maxNumberOfRetries = 3\n) => {\n for (let i = 0; i < maxNumberOfRetries; i++) {\n if (await cb()) {\n return true;\n }\n }\n\n return false;\n}\n\nexport const getTimeServiceUrl = () => {\n if(typeof window !== 'undefined') {\n return window.TIMEINTERVALSINCE1970_API_URL || process.env.TIMEINTERVALSINCE1970_API_URL;\n }\n return null;\n};\n\nexport const getEventLocation = (event, summitVenueCount, summitShowLocDate = null, nowUtc = null) => {\n const shouldShowVenues = (summitShowLocDate && nowUtc) ? summitShowLocDate * 1000 < nowUtc : true;\n const locationName = [];\n const { location } = event;\n\n if (!shouldShowVenues) return 'TBA';\n\n if (!location) return 'TBA';\n\n if (summitVenueCount > 1 && location.venue?.name) locationName.push(location.venue.name);\n if (location.floor?.name) locationName.push(location.floor.name);\n if (location.name) locationName.push(location.name);\n\n return locationName.length > 0 ? locationName.join(' - ') : 'TBA';\n};\n\nexport const getEventHosts = (event) => {\n let hosts = [];\n if (event.speakers?.length > 0) {\n hosts = [...event.speakers];\n }\n if (event.moderator) hosts.push(event.moderator);\n\n return hosts;\n};\n\nconst loadImage = async url => {\n const img = document.createElement('img')\n img.src = url\n img.crossOrigin = 'anonymous'\n\n return new Promise((resolve, reject) => {\n img.onload = () => resolve(img)\n img.onerror = reject\n })\n}\n\nexport const convertSVGtoImg = async (svgUrl) => {\n const img = await loadImage(svgUrl)\n const newWidth = 100\n const newHeight = Math.floor(img.naturalHeight * 100 / img.naturalWidth)\n\n const canvas = document.createElement('canvas')\n canvas.width = newWidth\n canvas.height = newHeight\n canvas.getContext('2d').drawImage(img, 0, 0, newWidth, newHeight)\n\n const url = await canvas.toDataURL(`image/png`, 1.0)\n console.log(url, newWidth, newHeight);\n return {url, width: newWidth, height: newHeight}\n}\n\nexport const isRateEnabled = (value) =>\n value !== null && value !== undefined && value !== \"\";\n\n/**\n * Returns true if value is null, undefined, empty/whitespace string,\n * empty array, or empty object.\n */\nexport const empty = (value) => {\n if (value === null || value === undefined) return true;\n if (typeof value === \"string\") return value.trim().length === 0;\n if (Array.isArray(value)) return value.length === 0;\n if (typeof value === \"object\") return Object.keys(value).length === 0;\n return false;\n};\n\nexport const isSentryInitialized = () => typeof window !== \"undefined\" && !!window.SENTRY_DSN;\n","/**\n * Copyright 2025 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 {\n CENTS_FACTOR,\n THREE_DECIMAL_PLACES,\n TWO_DECIMAL_PLACES,\n ZERO_INT,\n ONE_CENT\n} from \"./constants\";\n\nconst CURRENCY_SYMBOL = {\n USD: \"$\",\n EUR: \"€\",\n GBP: \"£\",\n CAD: \"C$\",\n AUD: \"A$\",\n NZD: \"NZ$\",\n CHF: \"CHF\",\n ARS: \"AR$\",\n BRL: \"R$\",\n MXN: \"MX$\",\n};\n\n/**\n * Convert a decimal money amount to integer cents safely (no floating point math).\n *\n * Why this exists:\n * - `Math.round(parseFloat(x) * 100)` can be wrong due to IEEE-754 floating point errors\n * (e.g. 1.005 * 100 may become 100.499999..., rounding down unexpectedly).\n *\n * Input:\n * - number or string (recommended: string from API/UI)\n * - Examples: \"12.34\", \"1,234.56\", \"1234,56\", 12.34\n *\n * Output:\n * - Number cents (exact), e.g. \"12.34\" -> 1234\n *\n * Rounding:\n * - Half-up to 2 decimals (>= 0.005 USD rounds up by 1 cent).\n *\n * Notes:\n * - Amounts are assumed to be NON-negative (per your requirement).\n * - Throws on invalid formats (does not silently return 0).\n */\nexport function amountToCents(amount) {\n if (amount == null) throw new Error(\"amount is required\");\n\n let s = String(amount).trim();\n\n // Normalize common separators:\n // - \"1,234.56\" => \"1234.56\" (remove thousands separators)\n // - \"1234,56\" => \"1234.56\" (convert decimal comma to dot)\n if (s.includes(\",\") && s.includes(\".\")) {\n s = s.replace(/,/g, \"\");\n } else if (s.includes(\",\") && !s.includes(\".\")) {\n s = s.replace(\",\", \".\");\n }\n\n // Validate: digits optionally followed by '.' and more digits\n if (!/^\\d+(\\.\\d+)?$/.test(s)) {\n throw new Error(`Invalid money format: \"${amount}\"`);\n }\n\n const [intPart, fracRaw = \"\"] = s.split(\".\");\n\n // Pad at least 3 fractional digits so we can:\n // - take 2 digits for cents\n // - take the 3rd digit to decide rounding\n const fracPadded = (`${fracRaw }000`);\n\n const tenths = fracPadded[0] ?? \"0\"; // 1st decimal digit\n const hundredths = fracPadded[1] ?? \"0\"; // 2nd decimal digit (cents)\n const thousandths = fracPadded[2] ?? \"0\"; // 3rd decimal digit (rounding decision)\n\n // If there are more than 3 decimals, we track if any non-zero exists after the 3rd.\n // This can matter for policies like bankers rounding; here it's mainly informational.\n const trailing =\n fracRaw.length > THREE_DECIMAL_PLACES\n ? fracRaw.slice(THREE_DECIMAL_PLACES)\n : \"\";\n const hasTrailingNonZero = /[1-9]/.test(trailing);\n\n // Build cents as integer: (dollars * 100) + (first two decimal digits)\n let cents = BigInt(intPart) * CENTS_FACTOR + BigInt(tenths + hundredths);\n\n // Half-up rounding:\n // - If the 3rd digit is >= 5, round up by 1 cent.\n // - If there are more digits beyond the 3rd, \"5xxx\" should also round up.\n const roundUp = thousandths > \"5\" || thousandths === \"5\" || (thousandths === \"5\" && hasTrailingNonZero);\n\n if (roundUp) cents += ONE_CENT;\n\n return Number(cents);\n}\n\n/**\n * Convert an amount in cents to a decimal string (e.g. 1234 -> \"12.34\") safely.\n *\n * Why:\n * - Avoids floating point math (cents / 100) which can lose precision for large integers\n * or if cents is already imprecise as a JS Number.\n *\n * Input:\n * - Accepts: bigint | number | string (digits)\n * - Assumes NON-negative cents (per your requirement).\n *\n * Output:\n * - Always returns a string with exactly 2 decimal places.\n */\nexport function amountFromCents(cents) {\n let c;\n\n // Normalize input to BigInt safely\n if (typeof cents === \"bigint\") {\n c = cents;\n } else if (typeof cents === \"number\") {\n // Ensure it's a safe integer before converting to BigInt\n if (!Number.isSafeInteger(cents)) {\n throw new Error(\"cents must be a safe integer Number (or pass BigInt/string).\");\n }\n c = BigInt(cents);\n } else if (typeof cents === \"string\") {\n const s = cents.trim();\n if (!/^\\d+$/.test(s)) {\n throw new Error(\"cents string must contain digits only (e.g., '1234').\");\n }\n c = BigInt(s);\n } else {\n throw new Error(\"cents must be a bigint, number, or numeric string.\");\n }\n\n if (c < ZERO_INT) {\n throw new Error(\"cents must be non-negative.\");\n }\n\n const amount = c / CENTS_FACTOR;\n const remainder = c % CENTS_FACTOR;\n\n // Always pad remainder to 2 digits\n return `${amount.toString()}.${remainder.toString().padStart(TWO_DECIMAL_PLACES, \"0\")}`;\n}\n\n/**\n * @param cents\n * @param currency\n * @returns {string}\n */\nexport function currencyAmountFromCents(cents, currency = \"USD\"){\n if (typeof cents !== \"number\" || !Number.isInteger(cents)) {\n throw new Error(\"cents must be an integer number\");\n }\n\n const amount = amountFromCents(cents); // \"12.34\"\n const symbol = CURRENCY_SYMBOL[currency] ?? \"$\";\n return `${symbol}${amount}`;\n}\n\n/**\n * Converts a price string into cents.\n * @param {string} priceString - The price (e.g., $0.30).\n * @returns {number} - The amount converted to cents (e.g., 30).\n */\nexport const parsePrice = (priceString) => {\n if (priceString == null) throw new Error(\"priceString is required\");\n\n let s = String(priceString).trim();\n\n // Reject negatives explicitly (per your requirement).\n if (s.includes(\"-\")) throw new Error(\"Negative amounts are not allowed\");\n\n // Keep only digits and separators. Remove currency symbols/letters/spaces.\n s = s.replace(/[^\\d.,]/g, \"\");\n if (!s) throw new Error(`Invalid price: \"${priceString}\"`);\n\n // Delegate exact cents conversion (no floats)\n return amountToCents(s); // <- your safe BigInt cents converter\n};\n","module.exports = require(\"moment-timezone\");","module.exports = require(\"urijs\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@stripe/stripe-js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@stripe/react-stripe-js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/defineProperty\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"i18n-react\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@sentry/react\");","/**\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, useState} from \"react\";\nimport {Box, Button, Typography} from \"@mui/material\";\nimport T from \"i18n-react\";\nimport {PaymentElement, useElements, useStripe} from \"@stripe/react-stripe-js\";\nimport {currencyAmountFromCents} from \"../../../utils/money\";\nimport {handleSentryException} from \"./helpers\";\n\nconst buildAddress = (userAddress = {}) => {\n const address = {};\n // stripe payment payload requires data that's not an empty string\n if (userAddress.locality) address.city = userAddress.locality;\n if (userAddress.country) address.country = userAddress.country;\n if (userAddress.address1) address.line1 = userAddress.address1;\n if (userAddress.address2) address.line2 = userAddress.address2;\n if (userAddress.postal_code) address.postal_code = userAddress.postal_code;\n if (userAddress.region) address.state = userAddress.region;\n\n if (Object.keys(address).length > 0) return {address};\n return {};\n};\n\nconst StripeForm = ({\n title,\n amount = 0,\n client,\n redirectUrl,\n paymentOptions = {},\n onSuccess,\n onError,\n onPaymentMethodChange\n}) => {\n const stripe = useStripe();\n const elements = useElements();\n const [loading, setLoading] = useState(false);\n\n useEffect(() => {\n if (elements) {\n const pe = elements.getElement(\"payment\");\n const handlePaymentMethodChange = (event) => {\n if (event.value.type) {\n onPaymentMethodChange(event.value.type);\n }\n };\n\n pe.on(\"change\", handlePaymentMethodChange);\n\n return () => {\n pe.off(\"change\", handlePaymentMethodChange);\n };\n }\n }, [elements]);\n\n const handleSubmit = async (e) => {\n e.preventDefault();\n\n if (!stripe || !elements || loading) return;\n\n setLoading(true);\n\n const {error, paymentIntent} = await stripe.confirmPayment({\n elements,\n confirmParams: {\n return_url: `${window.location.origin}${redirectUrl}`,\n payment_method_data: {\n billing_details: {\n name: client.full_name || `${client.first_name} ${client.last_name}`,\n email: client.email,\n ...buildAddress(client.address)\n }\n }\n },\n redirect: \"if_required\"\n });\n\n if (error) {\n onError?.(error.message);\n setLoading(false);\n } else if (paymentIntent?.status === \"succeeded\") {\n try {\n await onSuccess?.(paymentIntent);\n } catch (err) {\n handleSentryException(err);\n onError?.(T.translate(\"stripe_form.payment_confirmation_error\"));\n // Do not call setLoading(false) — payment already succeeded, keep form locked\n }\n // On success, keep loading=true so the button stays disabled until navigation\n } else if (paymentIntent?.status === \"processing\") {\n // Payment is async and still in flight — keep the form locked\n } else {\n // Genuinely retryable statuses (e.g. requires_action) — re-enable submission\n setLoading(false);\n }\n };\n\n return (\n <Box component=\"form\" onSubmit={handleSubmit} sx={{p: 3}}>\n {title &&\n <Typography sx={{mb: 2}}>\n {title || T.translate(\"stripe_form.title\")}\n </Typography>\n }\n\n <PaymentElement\n options={{\n layout: \"tabs\",\n ...paymentOptions\n }}\n />\n <Button\n fullWidth\n type=\"submit\"\n variant=\"contained\"\n disabled={!stripe || loading}\n sx={{mt: 2}}\n >\n {loading ? T.translate(\"stripe_form.processing\") : T.translate(\"stripe_form.button_cta\", {amount: currencyAmountFromCents(amount)})}\n </Button>\n </Box>\n );\n};\n\nexport default StripeForm;\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 * as Sentry from \"@sentry/react\";\nimport {isSentryInitialized} from \"../../../utils/methods\";\n\nexport const handleSentryException = (err) =>\n isSentryInitialized()\n ? Sentry.captureException(err)\n : console.log(\"Error on registration: \", err);","/**\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, { useMemo } from \"react\";\nimport { loadStripe } from \"@stripe/stripe-js\";\nimport { Elements } from \"@stripe/react-stripe-js\";\nimport StripeForm from \"./stripe-form\";\n\nconst StripePayment = ({\n paymentIntent,\n paymentProfile,\n client,\n redirectUrl,\n paymentOptions,\n stripeFormTitle,\n onPaymentSuccess,\n onPaymentError,\n updatePaymentIntent\n}) => {\n const { test_mode_enabled, test_publishable_key, live_publishable_key } = paymentProfile || {};\n const providerKey = test_mode_enabled ? test_publishable_key : live_publishable_key;\n const stripePromise = useMemo(\n () => (providerKey ? loadStripe(providerKey) : null),\n [providerKey]\n );\n\n if (!paymentProfile || !paymentIntent?.client_secret || !providerKey) return null;\n\n const options = {\n clientSecret: paymentIntent.client_secret,\n appearance: { theme: \"stripe\" }\n };\n\n return (\n <Elements stripe={stripePromise} options={options}>\n <StripeForm\n title={stripeFormTitle}\n client={client}\n amount={paymentIntent.total_amount}\n redirectUrl={redirectUrl}\n paymentOptions={paymentOptions}\n onSuccess={onPaymentSuccess}\n onError={onPaymentError}\n onPaymentMethodChange={updatePaymentIntent}\n />\n </Elements>\n );\n};\n\nexport default StripePayment;\n"],"names":["root","factory","exports","module","define","amd","this","CENTS_FACTOR","TWO_DECIMAL_PLACES","ZERO_INT","isSentryInitialized","window","SENTRY_DSN","CURRENCY_SYMBOL","USD","EUR","GBP","CAD","AUD","NZD","CHF","ARS","BRL","MXN","currencyAmountFromCents","cents","currency","Number","isInteger","Error","amount","c","isSafeInteger","BigInt","s","trim","test","remainder","toString","padStart","amountFromCents","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","buildAddress","userAddress","address","locality","city","country","address1","line1","address2","line2","postal_code","region","state","keys","length","StripeForm","title","client","redirectUrl","paymentOptions","onSuccess","onError","onPaymentMethodChange","stripe","useStripe","elements","useElements","loading","setLoading","useState","useEffect","pe","getElement","handlePaymentMethodChange","event","type","on","off","React","Box","component","onSubmit","async","e","preventDefault","error","paymentIntent","confirmPayment","confirmParams","return_url","location","origin","payment_method_data","billing_details","_objectSpread","name","full_name","first_name","last_name","email","redirect","message","status","err","Sentry","console","log","handleSentryException","T","sx","p","Typography","mb","PaymentElement","options","layout","Button","fullWidth","variant","disabled","mt","StripePayment","paymentProfile","stripeFormTitle","onPaymentSuccess","onPaymentError","updatePaymentIntent","test_mode_enabled","test_publishable_key","live_publishable_key","providerKey","stripePromise","useMemo","loadStripe","client_secret","clientSecret","appearance","theme","Elements","total_amount"],"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={4574:(e,t,n)=>{var r=n(2015),o=n.n(r),a=n(9825),l=n.n(a),i=n(8619),c=n(5814);const s={warning:o().createElement(c.Warning,{color:"warning"}),success:o().createElement(c.CheckCircle,{color:"success"}),error:o().createElement(c.Error,{color:"error"}),info:o().createElement(c.Info,{color:"info"})},u=({open:e,title:t,text:n,iconType:r="",onConfirm:a,onCancel:l,confirmButtonText:c="Confirm",confirmButtonColor:u="primary",cancelButtonText:m="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"}},s[r]&&o().createElement("div",{style:{marginRight:10}},s[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}},m),o().createElement(i.Button,{fullWidth:!0,onClick:a,color:u,variant:"contained",sx:{whiteSpace:"nowrap",minWidth:100}},c)));u.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},u.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(4574);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})}},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")},5814:e=>{e.exports=require("@mui/icons-material")},4325:e=>{e.exports=require("@mui/icons-material/Close")},6084:e=>{e.exports=require("@mui/icons-material/Delete")},9247:e=>{e.exports=require("@mui/icons-material/Edit")},8619:e=>{e.exports=require("@mui/material")},6831:e=>{e.exports=require("@mui/utils")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},7825:e=>{e.exports=require("lodash")},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:()=>j});var o=n(1116),a=n.n(o),l=n(2015),i=n(6842),c=n.n(i),s=n(7825),u=n(8619),m=n(9247),d=n.n(m),p=n(6084),g=n.n(p);const f=require("@mui/icons-material/Check");var b=n.n(f),y=n(4325),x=n.n(y),h=n(6831),C=n(3209),E=n(6130);const w="mx3fuojj3xuUbN9ch3eB",T=require("@mui/icons-material/ArrowForward");var P=n.n(T),B=n(9825),v=n.n(B);function D(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 _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const O={backgroundColor:"background.light",color:"text.disabled"},k=({columns:e=[],data:t=[],children:n,totalRows:r,perPage:o,currentPage:a,onPageChange:i,onPerPageChange:m,onSort:p,options:f={sortCol:"",sortDir:1,disableProp:null},getName:y=e=>e.name,onEdit:T,onArchive:B,onDelete:v,onSelect:D,canDelete:k=()=>!0,deleteDialogTitle:j=null,deleteDialogBody:S=null,deleteDialogConfirmText:q=null,confirmButtonColor:R=null})=>{const W=e.length+(T?1:0)+(v?1:0)+(B?1:0)+(D?1:0),z=[C.WU,C.k6,C.Lr],K=l.useRef(o);let N=z.includes(K.current)?z:[...z,K.current].sort(((e,t)=>e-t));m||(N=[K.current]);const{sortCol:A,sortDir:I}=f,M=(e,t={})=>_(_({},t),(e=>f.disableProp&&e[f.disableProp]?O:null)(e)||{});return l.createElement(u.Box,{sx:{width:"100%"}},l.createElement(u.Paper,{elevation:0,sx:{width:"100%",mb:2}},l.createElement(u.TableContainer,{component:u.Paper,sx:{borderRadius:0,boxShadow:"none"}},l.createElement(u.Table,null,l.createElement(u.TableHead,{sx:{backgroundColor:"#EAEAEA"}},l.createElement(u.TableRow,null,e.map((e=>l.createElement(u.TableCell,{key:e.columnKey,sx:{width:e.width,minWidth:e.width,maxWidth:e.width},align:e.align??"left"},e.sortable?l.createElement(u.TableSortLabel,{active:A===e.columnKey,direction:A===e.columnKey&&-1===I?"desc":"asc",onClick:()=>p(e.columnKey,-1*I)},e.header,A===e.columnKey?l.createElement(u.Box,{component:"span",sx:h.visuallyHidden},-1===I?c().translate("mui_table.sorted_desc"):c().translate("mui_table.sorted_asc")):null):e.header))),T&&l.createElement(u.TableCell,{sx:{width:40}}),B&&l.createElement(u.TableCell,{sx:{width:80}}),v&&l.createElement(u.TableCell,{sx:{width:40}}),D&&l.createElement(u.TableCell,{sx:{width:40}}))),l.createElement(u.TableBody,null,t.map((t=>l.createElement(u.TableRow,{key:t.id},e.map((e=>l.createElement(u.TableCell,{key:e.columnKey,align:e.align??"left",className:`${e.dottedBorder&&w} ${e.className}`,sx:M(t)},((e,t)=>t.render?t.render(e):(0,s.isBoolean)(e[t.columnKey])?e[t.columnKey]?l.createElement(b(),{fontSize:"large"}):l.createElement(x(),{fontSize:"large"}):e[t.columnKey])(t,e)))),T&&l.createElement(u.TableCell,{align:"center",className:w,sx:M(t,{width:40})},l.createElement(u.IconButton,{size:"large",onClick:()=>T(t),"data-testid":"action-edit"},l.createElement(d(),{fontSize:"large"}))),B&&l.createElement(u.TableCell,{align:"center",sx:{width:80},className:w},l.createElement(u.Button,{variant:"text",color:"inherit",size:"small",onClick:()=>B(t),"data-testid":"action-archive",sx:{fontSize:"1.3rem",fontWeight:
|
|
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={4574:(e,t,n)=>{var r=n(2015),o=n.n(r),a=n(9825),l=n.n(a),i=n(8619),c=n(5814);const s={warning:o().createElement(c.Warning,{color:"warning"}),success:o().createElement(c.CheckCircle,{color:"success"}),error:o().createElement(c.Error,{color:"error"}),info:o().createElement(c.Info,{color:"info"})},u=({open:e,title:t,text:n,iconType:r="",onConfirm:a,onCancel:l,confirmButtonText:c="Confirm",confirmButtonColor:u="primary",cancelButtonText:m="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"}},s[r]&&o().createElement("div",{style:{marginRight:10}},s[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}},m),o().createElement(i.Button,{fullWidth:!0,onClick:a,color:u,variant:"contained",sx:{whiteSpace:"nowrap",minWidth:100}},c)));u.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},u.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(4574);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})}},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")},5814:e=>{e.exports=require("@mui/icons-material")},4325:e=>{e.exports=require("@mui/icons-material/Close")},6084:e=>{e.exports=require("@mui/icons-material/Delete")},9247:e=>{e.exports=require("@mui/icons-material/Edit")},8619:e=>{e.exports=require("@mui/material")},6831:e=>{e.exports=require("@mui/utils")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},7825:e=>{e.exports=require("lodash")},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:()=>j});var o=n(1116),a=n.n(o),l=n(2015),i=n(6842),c=n.n(i),s=n(7825),u=n(8619),m=n(9247),d=n.n(m),p=n(6084),g=n.n(p);const f=require("@mui/icons-material/Check");var b=n.n(f),y=n(4325),x=n.n(y),h=n(6831),C=n(3209),E=n(6130);const w="mx3fuojj3xuUbN9ch3eB",T=require("@mui/icons-material/ArrowForward");var P=n.n(T),B=n(9825),v=n.n(B);function D(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 _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const O={backgroundColor:"background.light",color:"text.disabled"},k=({columns:e=[],data:t=[],children:n,totalRows:r,perPage:o,currentPage:a,onPageChange:i,onPerPageChange:m,onSort:p,options:f={sortCol:"",sortDir:1,disableProp:null},getName:y=e=>e.name,onEdit:T,onArchive:B,onDelete:v,onSelect:D,canDelete:k=()=>!0,deleteDialogTitle:j=null,deleteDialogBody:S=null,deleteDialogConfirmText:q=null,confirmButtonColor:R=null})=>{const W=e.length+(T?1:0)+(v?1:0)+(B?1:0)+(D?1:0),z=[C.WU,C.k6,C.Lr],K=l.useRef(o);let N=z.includes(K.current)?z:[...z,K.current].sort(((e,t)=>e-t));m||(N=[K.current]);const{sortCol:A,sortDir:I}=f,M=(e,t={})=>_(_({},t),(e=>f.disableProp&&e[f.disableProp]?O:null)(e)||{});return l.createElement(u.Box,{sx:{width:"100%"}},l.createElement(u.Paper,{elevation:0,sx:{width:"100%",mb:2}},l.createElement(u.TableContainer,{component:u.Paper,sx:{borderRadius:0,boxShadow:"none"}},l.createElement(u.Table,null,l.createElement(u.TableHead,{sx:{backgroundColor:"#EAEAEA"}},l.createElement(u.TableRow,null,e.map((e=>l.createElement(u.TableCell,{key:e.columnKey,sx:{width:e.width,minWidth:e.width,maxWidth:e.width},align:e.align??"left"},e.sortable?l.createElement(u.TableSortLabel,{active:A===e.columnKey,direction:A===e.columnKey&&-1===I?"desc":"asc",onClick:()=>p(e.columnKey,-1*I)},e.header,A===e.columnKey?l.createElement(u.Box,{component:"span",sx:h.visuallyHidden},-1===I?c().translate("mui_table.sorted_desc"):c().translate("mui_table.sorted_asc")):null):e.header))),T&&l.createElement(u.TableCell,{sx:{width:40}}),B&&l.createElement(u.TableCell,{sx:{width:80}}),v&&l.createElement(u.TableCell,{sx:{width:40}}),D&&l.createElement(u.TableCell,{sx:{width:40}}))),l.createElement(u.TableBody,null,t.map((t=>l.createElement(u.TableRow,{key:t.id},e.map((e=>l.createElement(u.TableCell,{key:e.columnKey,align:e.align??"left",className:`${e.dottedBorder&&w} ${e.className}`,sx:_(_({},M(t)),{},{fontWeight:"normal"})},((e,t)=>t.render?t.render(e):(0,s.isBoolean)(e[t.columnKey])?e[t.columnKey]?l.createElement(b(),{fontSize:"large"}):l.createElement(x(),{fontSize:"large"}):l.createElement("span",{style:{fontWeight:"normal"}},e[t.columnKey]))(t,e)))),T&&l.createElement(u.TableCell,{align:"center",className:w,sx:M(t,{width:40})},l.createElement(u.IconButton,{size:"large",onClick:()=>T(t),sx:{padding:0},"data-testid":"action-edit"},l.createElement(d(),{fontSize:"large"}))),B&&l.createElement(u.TableCell,{align:"center",sx:_({},M(t,{width:80})),className:w},l.createElement(u.Button,{variant:"text",color:"inherit",size:"small",onClick:()=>B(t),"data-testid":"action-archive",sx:{fontSize:"1.3rem",fontWeight:"normal",lineHeight:"2.2rem",padding:0,color:"rgba(0,0,0,0.56)"}},t.is_archived?c().translate("general.unarchive"):c().translate("general.archive"))),v&&l.createElement(u.TableCell,{align:"center",className:w,sx:M(t,{width:40})},k(t)&&l.createElement(u.IconButton,{size:"large",onClick:()=>(async e=>{await(0,E.default)({title:j||c().translate("general.are_you_sure"),text:"function"==typeof S?S(y(e)):S||`${c().translate("general.row_remove_warning")} ${y(e)}`,type:"warning",showCancelButton:!0,confirmButtonColor:R||"#DD6B55",confirmButtonText:q||c().translate("general.yes_delete")})&&v(e.id)})(t),"data-testid":"action-delete",sx:{padding:0}},l.createElement(g(),{fontSize:"large"}))),D&&l.createElement(u.TableCell,{align:"center",sx:{width:40},className:w},l.createElement(u.IconButton,{size:"large",onClick:()=>D(t),"data-testid":"action-select"},l.createElement(P(),null)))))),n,0===t.length&&l.createElement(u.TableRow,null,l.createElement(u.TableCell,{colSpan:W,align:"center"},c().translate("mui_table.no_items")))))),o&&a&&l.createElement(u.TablePagination,{component:"div",count:r,rowsPerPageOptions:N,rowsPerPage:o,page:a-1,onPageChange:(e,t)=>{i(t+1)},onRowsPerPageChange:e=>{m(e.target.value)},labelRowsPerPage:c().translate("mui_table.rows_per_page"),sx:{".MuiTablePagination-toolbar":{alignItems:"baseline",marginTop:"1.6rem"},".MuiTablePagination-spacer":{display:"none"},".MuiTablePagination-displayedRows":{marginLeft:"auto"}}})))};k.propTypes={columns:v().array,data:v().array,children:v().node,totalRows:v().number,perPage:v().number,currentPage:v().number,onPageChange:v().func,onPerPageChange:v().func,onSort:v().func,options:v().object,getName:v().func,onEdit:v().func,onArchive:v().func,onDelete:v().func,onSelect:v().func,canDelete:v().func,deleteDialogTitle:v().string,deleteDialogBody:v().oneOfType([v().func,v().string]),deleteDialogConfirmText:v().string,confirmButtonColor:v().string};const j=k;return r})()));
|
|
2
2
|
//# sourceMappingURL=table.js.map
|