openstack-uicore-foundation 5.0.4 → 5.0.5

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.
@@ -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)=>{n.d(t,{default:()=>m});var r=n(2015),o=n.n(r),a=n(9825),i=n.n(a),l=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:i,confirmButtonText:c="Confirm",confirmButtonColor:u="primary",cancelButtonText:m="Cancel",cancelButtonColor:d="primary"})=>o().createElement(l.Dialog,{open:e,onClose:i},o().createElement(l.DialogTitle,{sx:{p:2},component:"div"},o().createElement(l.Typography,{variant:"h5"},t)),o().createElement(l.Divider,null),o().createElement(l.DialogContent,{sx:{p:2}},o().createElement("div",{style:{display:"flex",alignItems:"center"}},s[r]&&o().createElement("div",{style:{marginRight:10}},s[r]),o().createElement(l.Typography,{variant:"body1"},n))),o().createElement(l.Divider,{sx:{margin:"10px 0px 10px 0px"}}),o().createElement(l.DialogActions,null,o().createElement(l.Button,{fullWidth:!0,onClick:i,color:d,variant:"outlined",sx:{whiteSpace:"nowrap",minWidth:100}},m),o().createElement(l.Button,{fullWidth:!0,onClick:a,color:u,variant:"contained",sx:{whiteSpace:"nowrap",minWidth:100}},c)));u.propTypes={open:i().bool,title:i().string.isRequired,text:i().string.isRequired,iconType:i().string,onConfirm:i().func.isRequired,onCancel:i().func.isRequired,confirmButtonText:i().string,confirmButtonColor:i().string,cancelButtonText:i().string,cancelButtonColor:i().string},u.defaultProps={open:!1,iconType:"warning",confirmButtonText:"Confirm",confirmButtonColor:"primary",cancelButtonText:"Cancel",cancelButtonColor:"default"};const m=u},2024:(e,t,n)=>{n.d(t,{default:()=>c});const r=require("react-dom");var o=n.n(r),a=n(2015),i=n.n(a),l=n(4574);const c=({title:e,text:t,iconType:n="",confirmButtonText:r="Confirm",cancelButtonText:a="Cancel",confirmButtonColor:c="primary",cancelButtonColor:s="primary"})=>new Promise((u=>{const m=document.createElement("div");document.body.appendChild(m);const d=e=>{o().unmountComponentAtNode(m),m.remove(),u(e)};o().render(i().createElement(l.default,{open:!0,title:e,text:t,iconType:n,confirmButtonText:r,cancelButtonText:a,confirmButtonColor:c,cancelButtonColor:s,onConfirm:()=>d(!0),onCancel:()=>d(!1)}),m)}))},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")},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")},6989:e=>{e.exports=require("@mui/material/Box")},6368:e=>{e.exports=require("@mui/material/Button")},270:e=>{e.exports=require("@mui/material/Paper")},9292:e=>{e.exports=require("@mui/material/Table")},9008:e=>{e.exports=require("@mui/material/TableBody")},5684:e=>{e.exports=require("@mui/material/TableCell")},5783:e=>{e.exports=require("@mui/material/TableContainer")},8202:e=>{e.exports=require("@mui/material/TableHead")},4308:e=>{e.exports=require("@mui/material/TablePagination")},464:e=>{e.exports=require("@mui/material/TableRow")},38:e=>{e.exports=require("@mui/material/TableSortLabel")},6831:e=>{e.exports=require("@mui/utils")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};n.r(r),n.d(r,{default:()=>$});var o=n(1116),a=n.n(o),i=n(2015),l=n(6842),c=n.n(l),s=n(6989),u=n.n(s),m=n(6368),d=n.n(m),p=n(9292),g=n.n(p),f=n(9008),x=n.n(f),y=n(5684),b=n.n(y),h=n(5783),E=n.n(h),v=n(8202),C=n.n(v),w=n(4308),P=n.n(w),T=n(38),B=n.n(T),q=n(464),O=n.n(q),k=n(270),S=n.n(k),D=n(8619),j=n(9247),_=n.n(j),K=n(6084),R=n.n(K),W=n(6831),I=n(3209),M=n(2024);function z(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 A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const L={backgroundColor:"background.light",color:"text.disabled"},V=({value:e,isEditing:t,onBlur:n,validation:r})=>{const[o,a]=i.useState(e),[l,c]=i.useState(!1),[s,m]=i.useState(null);i.useEffect((()=>{a(e),m(null)}),[e]);const d=e=>{const{isValid:t,message:o}=((e,t)=>{if(!t)return{isValid:!0};if(t.schema&&"function"==typeof t.schema.validateSync)try{return t.schema.validateSync(e),{isValid:!0,message:null}}catch(e){return{isValid:!1,message:e.message}}return{isValid:!0}})(e,r);t?(m(null),n(e,!0)):m(o)},p=e=>{"Enter"===e.key&&(e.preventDefault(),d(o))};return t?i.createElement(D.TextField,{autoFocus:!0,value:o,onChange:e=>{a(e.target.value),s&&m(null)},onBlur:()=>{d(o)},onKeyDown:p,size:"small",fullWidth:!0,variant:"standard",error:!!s,helperText:s}):i.createElement(u(),{sx:{display:"flex",alignItems:"center",position:"relative",width:"100%",height:"100%"},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1)},i.createElement("span",{style:{flex:1}},e),l&&i.createElement(_(),{fontSize:"small",sx:{opacity:.5,position:"absolute",right:0,"&:hover":{opacity:1}}}))},$=({columns:e=[],data:t=[],totalRows:n,perPage:r,currentPage:o,onPageChange:a,onPerPageChange:l,onSort:s,options:m={sortCol:"",sortDir:1,disableProp:null},getName:p=e=>e.name,onEdit:f,onArchive:y,onDelete:h,onCellChange:v,deleteDialogBody:w})=>{const[T,q]=i.useState(null),k=[I.WU,I.k6,I.Lr],j=k.includes(r)?k:[...k,r].sort(((e,t)=>e-t)),{sortCol:K,sortDir:z}=m,$=(e,t={})=>A(A({},t),(e=>m.disableProp&&e[m.disableProp]?L:null)(e)||{}),H=(e,t)=>"function"==typeof e.editable?e.editable(t):!!e.editable;return i.createElement(u(),{sx:{width:"100%"}},i.createElement(S(),{elevation:0,sx:{width:"100%",mb:2}},i.createElement(E(),{component:S(),sx:{borderRadius:0,boxShadow:"none"}},i.createElement(g(),null,i.createElement(C(),{sx:{backgroundColor:"#EAEAEA"}},i.createElement(O(),null,e.map((e=>i.createElement(b(),{key:e.columnKey,sx:{width:e.width,minWidth:e.width,maxWidth:e.width},align:e.align??"left"},e.sortable?i.createElement(B(),{active:K===e.columnKey,direction:K===e.columnKey&&-1===z?"desc":"asc",onClick:()=>s(e.columnKey,-1*z)},e.header,K===e.columnKey?i.createElement(u(),{component:"span",sx:W.visuallyHidden},-1===z?c().translate("mui_table.sorted_desc"):c().translate("mui_table.sorted_asc")):null):e.header))),f&&i.createElement(b(),{sx:{width:40}}),y&&i.createElement(b(),{sx:{width:80}}),h&&i.createElement(b(),{sx:{width:40}}))),i.createElement(x(),null,t.map((t=>i.createElement(O(),{key:t.id},e.map((n=>i.createElement(b(),{key:`${t.id}-${n.columnKey}`,onClick:()=>((t,n)=>{const r=e.find((e=>e.columnKey===n));r&&H(r,t)&&q({rowId:t.id,columnKey:n})})(t,n.columnKey),sx:$(t,{cursor:H(n,t)?"pointer":"default",padding:H(n,t)?"8px 16px":void 0})},H(n,t)?i.createElement(V,{value:t[n.columnKey],isEditing:T&&T.rowId===t.id&&T.columnKey===n.columnKey,onBlur:(e,r)=>((e,t,n,r)=>{v&&r&&v(e,t,n),q(null)})(t.id,n.columnKey,e,r),validation:n.validation}):n.render?n.render(t):t[n.columnKey]))),f&&i.createElement(b(),{sx:$(t)},i.createElement(D.IconButton,{onClick:()=>f(t),size:"small","aria-label":c().translate("general.edit")},i.createElement(_(),null))),y&&i.createElement(b(),{align:"center",sx:{width:80}},i.createElement(d(),{variant:"text",color:"inherit",size:"small",onClick:()=>y(t),sx:{fontSize:"1.3rem",fontWeight:500,lineHeight:"2.2rem",padding:"4px 5px"}},t.is_archived?c().translate("general.unarchive"):c().translate("general.archive"))),h&&i.createElement(b(),{sx:$(t)},i.createElement(D.IconButton,{onClick:()=>(async e=>{await(0,M.default)({title:c().translate("general.are_you_sure"),text:w?w(p(e)):`${c().translate("general.row_remove_warning")} ${p(e)}`,type:"warning",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:c().translate("general.yes_delete")})&&h(e.id)})(t),size:"small","aria-label":c().translate("general.delete")},i.createElement(R(),null))))))))),i.createElement(P(),{rowsPerPageOptions:j,component:"div",count:n??t.length,rowsPerPage:r,page:o-1,onPageChange:(e,t)=>{a(t+1)},onRowsPerPageChange:e=>{l(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"}}})))};return r})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={4574:(e,t,n)=>{n.d(t,{default:()=>m});var r=n(2015),o=n.n(r),a=n(9825),i=n.n(a),l=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:i,confirmButtonText:c="Confirm",confirmButtonColor:u="primary",cancelButtonText:m="Cancel",cancelButtonColor:d="primary"})=>o().createElement(l.Dialog,{open:e,onClose:i},o().createElement(l.DialogTitle,{sx:{p:2},component:"div"},o().createElement(l.Typography,{variant:"h5"},t)),o().createElement(l.Divider,null),o().createElement(l.DialogContent,{sx:{p:2}},o().createElement("div",{style:{display:"flex",alignItems:"center"}},s[r]&&o().createElement("div",{style:{marginRight:10}},s[r]),o().createElement(l.Typography,{variant:"body1"},n))),o().createElement(l.Divider,{sx:{margin:"10px 0px 10px 0px"}}),o().createElement(l.DialogActions,null,o().createElement(l.Button,{fullWidth:!0,onClick:i,color:d,variant:"outlined",sx:{whiteSpace:"nowrap",minWidth:100}},m),o().createElement(l.Button,{fullWidth:!0,onClick:a,color:u,variant:"contained",sx:{whiteSpace:"nowrap",minWidth:100}},c)));u.propTypes={open:i().bool,title:i().string.isRequired,text:i().string.isRequired,iconType:i().string,onConfirm:i().func.isRequired,onCancel:i().func.isRequired,confirmButtonText:i().string,confirmButtonColor:i().string,cancelButtonText:i().string,cancelButtonColor:i().string},u.defaultProps={open:!1,iconType:"warning",confirmButtonText:"Confirm",confirmButtonColor:"primary",cancelButtonText:"Cancel",cancelButtonColor:"default"};const m=u},2024:(e,t,n)=>{n.d(t,{default:()=>s});const r=require("react-dom");var o=n.n(r),a=n(2015),i=n.n(a),l=n(4574);let c;try{({createRoot:c}=n(1976))}catch(e){}const s=({title:e,text:t,iconType:n="",confirmButtonText:r="Confirm",cancelButtonText:a="Cancel",confirmButtonColor:s="primary",cancelButtonColor:u="primary"})=>new Promise((m=>{const d=document.createElement("div");document.body.appendChild(d);let p=null;const g=e=>{p?p.unmount():o().unmountComponentAtNode(d),d.remove(),m(e)},f=i().createElement(l.default,{open:!0,title:e,text:t,iconType:n,confirmButtonText:r,cancelButtonText:a,confirmButtonColor:s,cancelButtonColor:u,onConfirm:()=>g(!0),onCancel:()=>g(!1)});c?(p=c(d),p.render(f)):o().render(f,d)}))},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")},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")},6989:e=>{e.exports=require("@mui/material/Box")},6368:e=>{e.exports=require("@mui/material/Button")},270:e=>{e.exports=require("@mui/material/Paper")},9292:e=>{e.exports=require("@mui/material/Table")},9008:e=>{e.exports=require("@mui/material/TableBody")},5684:e=>{e.exports=require("@mui/material/TableCell")},5783:e=>{e.exports=require("@mui/material/TableContainer")},8202:e=>{e.exports=require("@mui/material/TableHead")},4308:e=>{e.exports=require("@mui/material/TablePagination")},464:e=>{e.exports=require("@mui/material/TableRow")},38:e=>{e.exports=require("@mui/material/TableSortLabel")},6831:e=>{e.exports=require("@mui/utils")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")},1976:e=>{e.exports=require("react-dom/client")}},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:()=>$});var o=n(1116),a=n.n(o),i=n(2015),l=n(6842),c=n.n(l),s=n(6989),u=n.n(s),m=n(6368),d=n.n(m),p=n(9292),g=n.n(p),f=n(9008),x=n.n(f),y=n(5684),b=n.n(y),h=n(5783),E=n.n(h),v=n(8202),C=n.n(v),w=n(4308),P=n.n(w),T=n(38),B=n.n(T),q=n(464),O=n.n(q),k=n(270),S=n.n(k),D=n(8619),j=n(9247),_=n.n(j),K=n(6084),R=n.n(K),W=n(6831),I=n(3209),M=n(2024);function z(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 A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const L={backgroundColor:"background.light",color:"text.disabled"},V=({value:e,isEditing:t,onBlur:n,validation:r})=>{const[o,a]=i.useState(e),[l,c]=i.useState(!1),[s,m]=i.useState(null);i.useEffect((()=>{a(e),m(null)}),[e]);const d=e=>{const{isValid:t,message:o}=((e,t)=>{if(!t)return{isValid:!0};if(t.schema&&"function"==typeof t.schema.validateSync)try{return t.schema.validateSync(e),{isValid:!0,message:null}}catch(e){return{isValid:!1,message:e.message}}return{isValid:!0}})(e,r);t?(m(null),n(e,!0)):m(o)},p=e=>{"Enter"===e.key&&(e.preventDefault(),d(o))};return t?i.createElement(D.TextField,{autoFocus:!0,value:o,onChange:e=>{a(e.target.value),s&&m(null)},onBlur:()=>{d(o)},onKeyDown:p,size:"small",fullWidth:!0,variant:"standard",error:!!s,helperText:s}):i.createElement(u(),{sx:{display:"flex",alignItems:"center",position:"relative",width:"100%",height:"100%"},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1)},i.createElement("span",{style:{flex:1}},e),l&&i.createElement(_(),{fontSize:"small",sx:{opacity:.5,position:"absolute",right:0,"&:hover":{opacity:1}}}))},$=({columns:e=[],data:t=[],totalRows:n,perPage:r,currentPage:o,onPageChange:a,onPerPageChange:l,onSort:s,options:m={sortCol:"",sortDir:1,disableProp:null},getName:p=e=>e.name,onEdit:f,onArchive:y,onDelete:h,onCellChange:v,deleteDialogBody:w})=>{const[T,q]=i.useState(null),k=[I.WU,I.k6,I.Lr],j=k.includes(r)?k:[...k,r].sort(((e,t)=>e-t)),{sortCol:K,sortDir:z}=m,$=(e,t={})=>A(A({},t),(e=>m.disableProp&&e[m.disableProp]?L:null)(e)||{}),H=(e,t)=>"function"==typeof e.editable?e.editable(t):!!e.editable;return i.createElement(u(),{sx:{width:"100%"}},i.createElement(S(),{elevation:0,sx:{width:"100%",mb:2}},i.createElement(E(),{component:S(),sx:{borderRadius:0,boxShadow:"none"}},i.createElement(g(),null,i.createElement(C(),{sx:{backgroundColor:"#EAEAEA"}},i.createElement(O(),null,e.map((e=>i.createElement(b(),{key:e.columnKey,sx:{width:e.width,minWidth:e.width,maxWidth:e.width},align:e.align??"left"},e.sortable?i.createElement(B(),{active:K===e.columnKey,direction:K===e.columnKey&&-1===z?"desc":"asc",onClick:()=>s(e.columnKey,-1*z)},e.header,K===e.columnKey?i.createElement(u(),{component:"span",sx:W.visuallyHidden},-1===z?c().translate("mui_table.sorted_desc"):c().translate("mui_table.sorted_asc")):null):e.header))),f&&i.createElement(b(),{sx:{width:40}}),y&&i.createElement(b(),{sx:{width:80}}),h&&i.createElement(b(),{sx:{width:40}}))),i.createElement(x(),null,t.map((t=>i.createElement(O(),{key:t.id},e.map((n=>i.createElement(b(),{key:`${t.id}-${n.columnKey}`,onClick:()=>((t,n)=>{const r=e.find((e=>e.columnKey===n));r&&H(r,t)&&q({rowId:t.id,columnKey:n})})(t,n.columnKey),sx:$(t,{cursor:H(n,t)?"pointer":"default",padding:H(n,t)?"8px 16px":void 0})},H(n,t)?i.createElement(V,{value:t[n.columnKey],isEditing:T&&T.rowId===t.id&&T.columnKey===n.columnKey,onBlur:(e,r)=>((e,t,n,r)=>{v&&r&&v(e,t,n),q(null)})(t.id,n.columnKey,e,r),validation:n.validation}):n.render?n.render(t):t[n.columnKey]))),f&&i.createElement(b(),{sx:$(t)},i.createElement(D.IconButton,{onClick:()=>f(t),size:"small","aria-label":c().translate("general.edit")},i.createElement(_(),null))),y&&i.createElement(b(),{align:"center",sx:{width:80}},i.createElement(d(),{variant:"text",color:"inherit",size:"small",onClick:()=>y(t),sx:{fontSize:"1.3rem",fontWeight:500,lineHeight:"2.2rem",padding:"4px 5px"}},t.is_archived?c().translate("general.unarchive"):c().translate("general.archive"))),h&&i.createElement(b(),{sx:$(t)},i.createElement(D.IconButton,{onClick:()=>(async e=>{await(0,M.default)({title:c().translate("general.are_you_sure"),text:w?w(p(e)):`${c().translate("general.row_remove_warning")} ${p(e)}`,type:"warning",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:c().translate("general.yes_delete")})&&h(e.id)})(t),size:"small","aria-label":c().translate("general.delete")},i.createElement(R(),null))))))))),i.createElement(P(),{rowsPerPageOptions:j,component:"div",count:n??t.length,rowsPerPage:r,page:o-1,onPageChange:(e,t)=>{a(t+1)},onRowsPerPageChange:e=>{l(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"}}})))};return r})()));
2
2
  //# sourceMappingURL=editable-table.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components/mui/editable-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,8HCiBT,MAAMC,EAAU,CACdC,QAAS,kBAAC,EAAAC,QAAD,CAASC,MAAM,YACxBC,QAAS,kBAAC,EAAAC,YAAD,CAAaF,MAAM,YAC5BG,MAAO,kBAAC,EAAAC,MAAD,CAAOJ,MAAM,UACpBK,KAAM,kBAAC,EAAAC,KAAD,CAAMN,MAAM,UAGdO,EAAgB,EACpBC,OACAC,QACAC,OACAC,WAAW,GACXC,YACAC,WACAC,oBAAoB,UACpBC,qBAAqB,UACrBC,mBAAmB,SACnBC,oBAAoB,aAEpB,kBAAC,EAAAC,OAAD,CAAQV,KAAMA,EAAMW,QAASN,GAC3B,kBAAC,EAAAO,YAAD,CAAaC,GAAI,CAAEC,EAAG,GAAKC,UAAU,OACnC,kBAAC,EAAAC,WAAD,CAAYC,QAAQ,MAAMhB,IAE5B,kBAAC,EAAAiB,QAAD,MACA,kBAAC,EAAAC,cAAD,CAAeN,GAAI,CAAEC,EAAG,IACtB,yBAAKM,MAAO,CAAEC,QAAS,OAAQC,WAAY,WACxCjC,EAAQc,IACP,yBAAKiB,MAAO,CAAEG,YAAa,KAAOlC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L,QAAS,YAGV3B,EAAIiC,YACDb,IAAAA,UAAY,qBACZA,IAAAA,UAAY,qBAIrB/B,GACC,gBAAC,IAAD,CAAWxH,GAAIkI,EAAUC,IACvB,gBAAC,EAAA8B,WAAD,CACElJ,QAAS,IA/JVsJ,iBACOC,EAAAA,EAAAA,SAAkB,CAC1ClL,MAAOmK,IAAAA,UAAY,wBACnBlK,KAAMqI,EACFA,EAAiBP,EAAQC,IACxB,GAAEmC,IAAAA,UAAY,iCAAiCpC,EAAQC,KAC5DmD,KAAM,UACNC,kBAAkB,EAClB9K,mBAAoB,UACpBD,kBAAmB8J,IAAAA,UAAY,yBAI/B/B,EAASJ,EAAKoC,GACf,EAiJkCiB,CAAatC,GAC5BvC,KAAK,QACL,aAAY2D,IAAAA,UAAY,mBAExB,gBAAC,IAAD,cAShB,gBAAC,IAAD,CACEmB,mBAAoB5C,EACpB5H,UAAU,MACVyK,MAAOlE,GAAaD,EAAKoE,OACzBC,YAAanE,EACboE,KAAMnE,EAAc,EACpBC,aA9MiB,CAACmE,EAAGC,KAC3BpE,EAAaoE,EAAU,EAAvB,EA8MMC,oBA3MyBC,IAC/BrE,EAAgBqE,EAAGxF,OAAO3B,MAA1B,EA2MMoH,iBAAkB5B,IAAAA,UAAY,2BAC9BvJ,GAAI,CACF,8BAA+B,CAC7BS,WAAY,WACZ2K,UAAW,UAEb,6BAA8B,CAC5B5K,QAAS,QAEX,oCAAqC,CACnC6K,WAAY,YAzJxB,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/mui/confirm-dialog.js","webpack://openstack-uicore-foundation/external commonjs \"react-dom\"","webpack://openstack-uicore-foundation/./src/components/mui/showConfirmDialog.js","webpack://openstack-uicore-foundation/./src/utils/constants.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Delete\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Edit\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Box\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Button\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Paper\"","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/TableRow\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TableSortLabel\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/utils\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react/dist/i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"prop-types\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/mui/editable-table/mui-table-editable.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","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react-dom\");","/**\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 ReactDOM from \"react-dom\";\nimport React from \"react\";\nimport ConfirmDialog from \"./confirm-dialog\";\n\nconst showConfirmDialog = ({\n title,\n text,\n iconType = \"\",\n confirmButtonText = \"Confirm\",\n cancelButtonText = \"Cancel\",\n confirmButtonColor = \"primary\",\n cancelButtonColor = \"primary\"\n}) =>\n new Promise((resolve) => {\n const container = document.createElement(\"div\");\n document.body.appendChild(container);\n\n const close = (answer) => {\n ReactDOM.unmountComponentAtNode(container);\n container.remove();\n resolve(answer);\n };\n\n const handleConfirm = () => close(true);\n const handleCancel = () => close(false);\n\n ReactDOM.render(\n <ConfirmDialog\n open\n title={title}\n text={text}\n iconType={iconType}\n confirmButtonText={confirmButtonText}\n cancelButtonText={cancelButtonText}\n confirmButtonColor={confirmButtonColor}\n cancelButtonColor={cancelButtonColor}\n onConfirm={handleConfirm}\n onCancel={handleCancel}\n />,\n container\n );\n });\n\nexport default showConfirmDialog;\n","export const CENTS_FACTOR = 100n;\nexport const TWO_DECIMAL_PLACES = 2;\nexport const THREE_DECIMAL_PLACES = 3;\nexport const ONE_CENT = 1n;\nexport const ZERO_INT = 0;\n\nexport const CODE_200 = 200;\n\nexport const DEBOUNCE_WAIT_250 = 250;\nexport const DEBOUNCE_WAIT = 500;\n\nexport const NOTIFICATION_TIMEOUT = 2000;\nexport const DEFAULT_PER_PAGE = 10;\nexport const TWENTY_PER_PAGE = 20;\nexport const FIFTY_PER_PAGE = 50;\nexport const MAX_PER_PAGE = 100;\n\nexport const INT_BASE = 10;\n\nexport const ONE_HUNDRED = 100;\nexport const MILLISECONDS_IN_SECOND = 1000;\n\nexport const MILLISECONDS_TO_SECONDS = 1000;\n\nexport const BYTES_PER_MB = 1_048_576; // 1024 * 1024\n\nexport const MAX_INVENTORY_IMAGE_UPLOAD_SIZE = 512000;\nexport const MAX_INVENTORY_IMAGES_UPLOAD_QTY = 5;\nexport const ALLOWED_INVENTORY_IMAGE_FORMATS = [\"jpg\", \"jpeg\", \"png\"];\n\nexport const METAFIELD_TYPES_WITH_OPTIONS = [\n \"CheckBoxList\",\n \"ComboBox\",\n \"RadioButtonList\"\n];\n\nexport const METAFIELD_TYPES = [\n \"CheckBox\",\n ...METAFIELD_TYPES_WITH_OPTIONS,\n \"Text\",\n \"TextArea\",\n \"Quantity\",\n \"DateTime\",\n \"Time\"\n];\n\nexport const DISCOUNT_TYPES = {\n AMOUNT: \"Amount\",\n RATE: \"Rate\"\n};\n\nexport const RATE_FIELDS = {\n EARLY_BIRD: \"early_bird_rate\",\n STANDARD: \"standard_rate\",\n ONSITE: \"onsite_rate\"\n};\n\nexport const DECIMAL_DIGITS = 2;\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@mui/icons-material\");","module.exports = require(\"@mui/icons-material/Delete\");","module.exports = require(\"@mui/icons-material/Edit\");","module.exports = require(\"@mui/material\");","module.exports = require(\"@mui/material/Box\");","module.exports = require(\"@mui/material/Button\");","module.exports = require(\"@mui/material/Paper\");","module.exports = require(\"@mui/material/Table\");","module.exports = require(\"@mui/material/TableBody\");","module.exports = require(\"@mui/material/TableCell\");","module.exports = require(\"@mui/material/TableContainer\");","module.exports = require(\"@mui/material/TableHead\");","module.exports = require(\"@mui/material/TablePagination\");","module.exports = require(\"@mui/material/TableRow\");","module.exports = require(\"@mui/material/TableSortLabel\");","module.exports = require(\"@mui/utils\");","module.exports = require(\"i18n-react/dist/i18n-react\");","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Copyright 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 Button from \"@mui/material/Button\";\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 { IconButton, TextField } from \"@mui/material\";\nimport EditIcon from \"@mui/icons-material/Edit\";\nimport DeleteIcon from \"@mui/icons-material/Delete\";\nimport { visuallyHidden } from \"@mui/utils\";\n\nimport {\n DEFAULT_PER_PAGE,\n FIFTY_PER_PAGE,\n TWENTY_PER_PAGE\n} from \"../../../utils/constants\";\nimport showConfirmDialog from \"../showConfirmDialog\";\n\nconst ARCHIVED_CELL_SX = {\n backgroundColor: \"background.light\",\n color: \"text.disabled\"\n};\n\nconst validateValue = (value, validation) => {\n if (!validation) return { isValid: true };\n\n // validate with yup schema\n if (\n validation.schema &&\n typeof validation.schema.validateSync === \"function\"\n ) {\n try {\n validation.schema.validateSync(value);\n return { isValid: true, message: null };\n } catch (err) {\n return { isValid: false, message: err.message };\n }\n }\n\n return { isValid: true };\n};\n\n// Updated component to handle editable cells with hover edit icon\nconst EditableCell = ({ value, isEditing, onBlur, validation }) => {\n const [inputValue, setInputValue] = React.useState(value);\n const [isHovering, setIsHovering] = React.useState(false);\n const [error, setError] = React.useState(null);\n\n React.useEffect(() => {\n setInputValue(value);\n setError(null);\n }, [value]);\n\n const handleValidationAndSave = (newValue) => {\n const { isValid, message } = validateValue(newValue, validation);\n\n if (isValid) {\n setError(null);\n onBlur(newValue, true);\n } else {\n setError(message);\n }\n };\n\n const handleKeyDown = (e) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n handleValidationAndSave(inputValue);\n }\n };\n\n if (isEditing) {\n return (\n <TextField\n autoFocus\n value={inputValue}\n onChange={(e) => {\n setInputValue(e.target.value);\n if (error) setError(null);\n }}\n onBlur={() => {\n handleValidationAndSave(inputValue);\n }}\n onKeyDown={handleKeyDown}\n size=\"small\"\n fullWidth\n variant=\"standard\"\n error={!!error}\n helperText={error}\n />\n );\n }\n\n return (\n <Box\n sx={{\n display: \"flex\",\n alignItems: \"center\",\n position: \"relative\",\n width: \"100%\",\n height: \"100%\"\n }}\n onMouseEnter={() => setIsHovering(true)}\n onMouseLeave={() => setIsHovering(false)}\n >\n <span style={{ flex: 1 }}>{value}</span>\n {isHovering && (\n <EditIcon\n fontSize=\"small\"\n sx={{\n opacity: 0.5,\n position: \"absolute\",\n right: 0,\n \"&:hover\": {\n opacity: 1\n }\n }}\n />\n )}\n </Box>\n );\n};\n\nconst MuiTableEditable = ({\n columns = [],\n data = [],\n totalRows,\n perPage,\n currentPage,\n onPageChange,\n onPerPageChange,\n onSort,\n options = { sortCol: \"\", sortDir: 1, disableProp: null },\n getName = (item) => item.name,\n onEdit,\n onArchive,\n onDelete,\n onCellChange, // New prop for handling cell value changes\n deleteDialogBody\n}) => {\n // State to track which cell is currently being edited\n const [editingCell, setEditingCell] = React.useState(null);\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 getArchivedCellSx = (row) =>\n options.disableProp && row[options.disableProp] ? ARCHIVED_CELL_SX : null;\n\n const getCellSx = (row, baseSx = {}) => ({\n ...baseSx,\n ...(getArchivedCellSx(row) || {})\n });\n\n const handleDelete = async (item) => {\n const isConfirmed = await showConfirmDialog({\n title: T.translate(\"general.are_you_sure\"),\n text: deleteDialogBody\n ? deleteDialogBody(getName(item))\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 const isEditable = (col, row) =>\n typeof col.editable === \"function\" ? col.editable(row) : !!col.editable;\n\n // Handler for starting edit mode on a cell\n const handleCellClick = (row, columnKey) => {\n // Check if the column is editable\n const column = columns.find((col) => col.columnKey === columnKey);\n if (column && isEditable(column, row)) {\n setEditingCell({ rowId: row.id, columnKey });\n }\n };\n\n // Handler for saving changes when editing is complete\n const handleCellBlur = (rowId, columnKey, newValue, isValid) => {\n if (onCellChange && isValid) {\n onCellChange(rowId, columnKey, newValue);\n }\n setEditingCell(null);\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 {onArchive && <TableCell sx={{ width: 80 }} />}\n {onDelete && <TableCell sx={{ width: 40 }} />}\n </TableRow>\n </TableHead>\n {/* TABLE BODY */}\n <TableBody>\n {data.map((row) => (\n <TableRow key={row.id}>\n {columns.map((col) => (\n <TableCell\n key={`${row.id}-${col.columnKey}`}\n onClick={() => handleCellClick(row, col.columnKey)}\n sx={getCellSx(row, {\n cursor: isEditable(col, row) ? \"pointer\" : \"default\",\n padding: isEditable(col, row) ? \"8px 16px\" : undefined // Ensure enough space for the edit icon\n })}\n >\n {isEditable(col, row) ? (\n <EditableCell\n value={row[col.columnKey]}\n isEditing={\n editingCell &&\n editingCell.rowId === row.id &&\n editingCell.columnKey === col.columnKey\n }\n onBlur={(newValue, isValid) =>\n handleCellBlur(\n row.id,\n col.columnKey,\n newValue,\n isValid\n )\n }\n validation={col.validation}\n />\n ) : col.render ? (\n col.render(row)\n ) : (\n row[col.columnKey]\n )}\n </TableCell>\n ))}\n {onEdit && (\n <TableCell sx={getCellSx(row)}>\n <IconButton\n onClick={() => onEdit(row)}\n size=\"small\"\n aria-label={T.translate(\"general.edit\")}\n >\n <EditIcon />\n </IconButton>\n </TableCell>\n )}\n {onArchive && (\n <TableCell align=\"center\" sx={{ width: 80 }}>\n <Button\n variant=\"text\"\n color=\"inherit\"\n size=\"small\"\n onClick={() => onArchive(row)}\n sx={{\n fontSize: \"1.3rem\",\n fontWeight: 500,\n lineHeight: \"2.2rem\",\n padding: \"4px 5px\"\n }}\n >\n {row.is_archived\n ? T.translate(\"general.unarchive\")\n : T.translate(\"general.archive\")}\n </Button>\n </TableCell>\n )}\n {onDelete && (\n <TableCell sx={getCellSx(row)}>\n <IconButton\n onClick={() => handleDelete(row)}\n size=\"small\"\n aria-label={T.translate(\"general.delete\")}\n >\n <DeleteIcon />\n </IconButton>\n </TableCell>\n )}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </TableContainer>\n <TablePagination\n rowsPerPageOptions={customPerPageOptions}\n component=\"div\"\n count={totalRows ?? data.length}\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 </Paper>\n </Box>\n );\n};\n\nexport default MuiTableEditable;\n"],"names":["root","factory","exports","module","define","amd","this","iconMap","warning","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","require","Promise","resolve","container","document","createElement","body","appendChild","close","answer","ReactDOM","remove","DEFAULT_PER_PAGE","TWENTY_PER_PAGE","FIFTY_PER_PAGE","__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","ARCHIVED_CELL_SX","backgroundColor","EditableCell","isEditing","onBlur","validation","inputValue","setInputValue","React","isHovering","setIsHovering","setError","handleValidationAndSave","newValue","isValid","message","schema","validateSync","err","validateValue","handleKeyDown","e","preventDefault","TextField","autoFocus","onChange","target","onKeyDown","size","helperText","position","width","height","onMouseEnter","onMouseLeave","flex","fontSize","opacity","right","columns","data","totalRows","perPage","currentPage","onPageChange","onPerPageChange","onSort","options","sortCol","sortDir","disableProp","getName","item","name","onEdit","onArchive","onDelete","onCellChange","deleteDialogBody","editingCell","setEditingCell","basePerPageOptions","customPerPageOptions","includes","sort","b","getCellSx","row","baseSx","getArchivedCellSx","isEditable","col","editable","elevation","mb","Paper","borderRadius","boxShadow","map","columnKey","maxWidth","align","sortable","active","direction","header","visuallyHidden","T","id","column","find","rowId","handleCellClick","cursor","padding","handleCellBlur","render","IconButton","fontWeight","lineHeight","is_archived","async","showConfirmDialog","type","showCancelButton","handleDelete","rowsPerPageOptions","count","length","rowsPerPage","page","_","newPage","onRowsPerPageChange","ev","labelRowsPerPage","marginTop","marginLeft"],"sourceRoot":""}
1
+ {"version":3,"file":"components/mui/editable-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,8HCiBT,MAAMC,EAAU,CACdC,QAAS,kBAAC,EAAAC,QAAD,CAASC,MAAM,YACxBC,QAAS,kBAAC,EAAAC,YAAD,CAAaF,MAAM,YAC5BG,MAAO,kBAAC,EAAAC,MAAD,CAAOJ,MAAM,UACpBK,KAAM,kBAAC,EAAAC,KAAD,CAAMN,MAAM,UAGdO,EAAgB,EACpBC,OACAC,QACAC,OACAC,WAAW,GACXC,YACAC,WACAC,oBAAoB,UACpBC,qBAAqB,UACrBC,m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MiB,CAACzF,EAAG2J,KAC3BlE,EAAakE,EAAU,EAAvB,EA8MMC,oBA3MyBC,IAC/BnE,EAAgBmE,EAAGtF,OAAO3B,MAA1B,EA2MMkH,iBAAkB1B,IAAAA,UAAY,2BAC9B5J,GAAI,CACF,8BAA+B,CAC7BS,WAAY,WACZ8K,UAAW,UAEb,6BAA8B,CAC5B/K,QAAS,QAEX,oCAAqC,CACnCgL,WAAY,YAzJxB,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/mui/confirm-dialog.js","webpack://openstack-uicore-foundation/external commonjs \"react-dom\"","webpack://openstack-uicore-foundation/./src/components/mui/showConfirmDialog.js","webpack://openstack-uicore-foundation/./src/utils/constants.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Delete\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Edit\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Box\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Button\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Paper\"","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/TableRow\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TableSortLabel\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/utils\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react/dist/i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"prop-types\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"react-dom/client\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/mui/editable-table/mui-table-editable.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","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react-dom\");","/**\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 ReactDOM from \"react-dom\";\nimport React from \"react\";\nimport ConfirmDialog from \"./confirm-dialog\";\n\n// React 18+ uses createRoot from react-dom/client; React 17 does not have this module\nlet createRoot;\ntry {\n ({ createRoot } = require(\"react-dom/client\"));\n} catch (_) {\n // React 17 — createRoot not available, will fall back to ReactDOM.render\n}\n\nconst showConfirmDialog = ({\n title,\n text,\n iconType = \"\",\n confirmButtonText = \"Confirm\",\n cancelButtonText = \"Cancel\",\n confirmButtonColor = \"primary\",\n cancelButtonColor = \"primary\"\n}) =>\n new Promise((resolve) => {\n const container = document.createElement(\"div\");\n document.body.appendChild(container);\n\n let root = null;\n\n const close = (answer) => {\n if (root) {\n root.unmount();\n } else {\n ReactDOM.unmountComponentAtNode(container);\n }\n container.remove();\n resolve(answer);\n };\n\n const handleConfirm = () => close(true);\n const handleCancel = () => close(false);\n\n const element = (\n <ConfirmDialog\n open\n title={title}\n text={text}\n iconType={iconType}\n confirmButtonText={confirmButtonText}\n cancelButtonText={cancelButtonText}\n confirmButtonColor={confirmButtonColor}\n cancelButtonColor={cancelButtonColor}\n onConfirm={handleConfirm}\n onCancel={handleCancel}\n />\n );\n\n if (createRoot) {\n root = createRoot(container);\n root.render(element);\n } else {\n ReactDOM.render(element, container);\n }\n });\n\nexport default showConfirmDialog;\n","export const CENTS_FACTOR = 100n;\nexport const TWO_DECIMAL_PLACES = 2;\nexport const THREE_DECIMAL_PLACES = 3;\nexport const ONE_CENT = 1n;\nexport const ZERO_INT = 0;\n\nexport const CODE_200 = 200;\n\nexport const DEBOUNCE_WAIT_250 = 250;\nexport const DEBOUNCE_WAIT = 500;\n\nexport const NOTIFICATION_TIMEOUT = 2000;\nexport const DEFAULT_PER_PAGE = 10;\nexport const TWENTY_PER_PAGE = 20;\nexport const FIFTY_PER_PAGE = 50;\nexport const MAX_PER_PAGE = 100;\n\nexport const INT_BASE = 10;\n\nexport const ONE_HUNDRED = 100;\nexport const MILLISECONDS_IN_SECOND = 1000;\n\nexport const MILLISECONDS_TO_SECONDS = 1000;\n\nexport const BYTES_PER_MB = 1_048_576; // 1024 * 1024\n\nexport const MAX_INVENTORY_IMAGE_UPLOAD_SIZE = 512000;\nexport const MAX_INVENTORY_IMAGES_UPLOAD_QTY = 5;\nexport const ALLOWED_INVENTORY_IMAGE_FORMATS = [\"jpg\", \"jpeg\", \"png\"];\n\nexport const METAFIELD_TYPES_WITH_OPTIONS = [\n \"CheckBoxList\",\n \"ComboBox\",\n \"RadioButtonList\"\n];\n\nexport const METAFIELD_TYPES = [\n \"CheckBox\",\n ...METAFIELD_TYPES_WITH_OPTIONS,\n \"Text\",\n \"TextArea\",\n \"Quantity\",\n \"DateTime\",\n \"Time\"\n];\n\nexport const DISCOUNT_TYPES = {\n AMOUNT: \"Amount\",\n RATE: \"Rate\"\n};\n\nexport const RATE_FIELDS = {\n EARLY_BIRD: \"early_bird_rate\",\n STANDARD: \"standard_rate\",\n ONSITE: \"onsite_rate\"\n};\n\nexport const DECIMAL_DIGITS = 2;\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@mui/icons-material\");","module.exports = require(\"@mui/icons-material/Delete\");","module.exports = require(\"@mui/icons-material/Edit\");","module.exports = require(\"@mui/material\");","module.exports = require(\"@mui/material/Box\");","module.exports = require(\"@mui/material/Button\");","module.exports = require(\"@mui/material/Paper\");","module.exports = require(\"@mui/material/Table\");","module.exports = require(\"@mui/material/TableBody\");","module.exports = require(\"@mui/material/TableCell\");","module.exports = require(\"@mui/material/TableContainer\");","module.exports = require(\"@mui/material/TableHead\");","module.exports = require(\"@mui/material/TablePagination\");","module.exports = require(\"@mui/material/TableRow\");","module.exports = require(\"@mui/material/TableSortLabel\");","module.exports = require(\"@mui/utils\");","module.exports = require(\"i18n-react/dist/i18n-react\");","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","module.exports = require(\"react-dom/client\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport * as React from \"react\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\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 { IconButton, TextField } from \"@mui/material\";\nimport EditIcon from \"@mui/icons-material/Edit\";\nimport DeleteIcon from \"@mui/icons-material/Delete\";\nimport { visuallyHidden } from \"@mui/utils\";\n\nimport {\n DEFAULT_PER_PAGE,\n FIFTY_PER_PAGE,\n TWENTY_PER_PAGE\n} from \"../../../utils/constants\";\nimport showConfirmDialog from \"../showConfirmDialog\";\n\nconst ARCHIVED_CELL_SX = {\n backgroundColor: \"background.light\",\n color: \"text.disabled\"\n};\n\nconst validateValue = (value, validation) => {\n if (!validation) return { isValid: true };\n\n // validate with yup schema\n if (\n validation.schema &&\n typeof validation.schema.validateSync === \"function\"\n ) {\n try {\n validation.schema.validateSync(value);\n return { isValid: true, message: null };\n } catch (err) {\n return { isValid: false, message: err.message };\n }\n }\n\n return { isValid: true };\n};\n\n// Updated component to handle editable cells with hover edit icon\nconst EditableCell = ({ value, isEditing, onBlur, validation }) => {\n const [inputValue, setInputValue] = React.useState(value);\n const [isHovering, setIsHovering] = React.useState(false);\n const [error, setError] = React.useState(null);\n\n React.useEffect(() => {\n setInputValue(value);\n setError(null);\n }, [value]);\n\n const handleValidationAndSave = (newValue) => {\n const { isValid, message } = validateValue(newValue, validation);\n\n if (isValid) {\n setError(null);\n onBlur(newValue, true);\n } else {\n setError(message);\n }\n };\n\n const handleKeyDown = (e) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n handleValidationAndSave(inputValue);\n }\n };\n\n if (isEditing) {\n return (\n <TextField\n autoFocus\n value={inputValue}\n onChange={(e) => {\n setInputValue(e.target.value);\n if (error) setError(null);\n }}\n onBlur={() => {\n handleValidationAndSave(inputValue);\n }}\n onKeyDown={handleKeyDown}\n size=\"small\"\n fullWidth\n variant=\"standard\"\n error={!!error}\n helperText={error}\n />\n );\n }\n\n return (\n <Box\n sx={{\n display: \"flex\",\n alignItems: \"center\",\n position: \"relative\",\n width: \"100%\",\n height: \"100%\"\n }}\n onMouseEnter={() => setIsHovering(true)}\n onMouseLeave={() => setIsHovering(false)}\n >\n <span style={{ flex: 1 }}>{value}</span>\n {isHovering && (\n <EditIcon\n fontSize=\"small\"\n sx={{\n opacity: 0.5,\n position: \"absolute\",\n right: 0,\n \"&:hover\": {\n opacity: 1\n }\n }}\n />\n )}\n </Box>\n );\n};\n\nconst MuiTableEditable = ({\n columns = [],\n data = [],\n totalRows,\n perPage,\n currentPage,\n onPageChange,\n onPerPageChange,\n onSort,\n options = { sortCol: \"\", sortDir: 1, disableProp: null },\n getName = (item) => item.name,\n onEdit,\n onArchive,\n onDelete,\n onCellChange, // New prop for handling cell value changes\n deleteDialogBody\n}) => {\n // State to track which cell is currently being edited\n const [editingCell, setEditingCell] = React.useState(null);\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 getArchivedCellSx = (row) =>\n options.disableProp && row[options.disableProp] ? ARCHIVED_CELL_SX : null;\n\n const getCellSx = (row, baseSx = {}) => ({\n ...baseSx,\n ...(getArchivedCellSx(row) || {})\n });\n\n const handleDelete = async (item) => {\n const isConfirmed = await showConfirmDialog({\n title: T.translate(\"general.are_you_sure\"),\n text: deleteDialogBody\n ? deleteDialogBody(getName(item))\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 const isEditable = (col, row) =>\n typeof col.editable === \"function\" ? col.editable(row) : !!col.editable;\n\n // Handler for starting edit mode on a cell\n const handleCellClick = (row, columnKey) => {\n // Check if the column is editable\n const column = columns.find((col) => col.columnKey === columnKey);\n if (column && isEditable(column, row)) {\n setEditingCell({ rowId: row.id, columnKey });\n }\n };\n\n // Handler for saving changes when editing is complete\n const handleCellBlur = (rowId, columnKey, newValue, isValid) => {\n if (onCellChange && isValid) {\n onCellChange(rowId, columnKey, newValue);\n }\n setEditingCell(null);\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 {onArchive && <TableCell sx={{ width: 80 }} />}\n {onDelete && <TableCell sx={{ width: 40 }} />}\n </TableRow>\n </TableHead>\n {/* TABLE BODY */}\n <TableBody>\n {data.map((row) => (\n <TableRow key={row.id}>\n {columns.map((col) => (\n <TableCell\n key={`${row.id}-${col.columnKey}`}\n onClick={() => handleCellClick(row, col.columnKey)}\n sx={getCellSx(row, {\n cursor: isEditable(col, row) ? \"pointer\" : \"default\",\n padding: isEditable(col, row) ? \"8px 16px\" : undefined // Ensure enough space for the edit icon\n })}\n >\n {isEditable(col, row) ? (\n <EditableCell\n value={row[col.columnKey]}\n isEditing={\n editingCell &&\n editingCell.rowId === row.id &&\n editingCell.columnKey === col.columnKey\n }\n onBlur={(newValue, isValid) =>\n handleCellBlur(\n row.id,\n col.columnKey,\n newValue,\n isValid\n )\n }\n validation={col.validation}\n />\n ) : col.render ? (\n col.render(row)\n ) : (\n row[col.columnKey]\n )}\n </TableCell>\n ))}\n {onEdit && (\n <TableCell sx={getCellSx(row)}>\n <IconButton\n onClick={() => onEdit(row)}\n size=\"small\"\n aria-label={T.translate(\"general.edit\")}\n >\n <EditIcon />\n </IconButton>\n </TableCell>\n )}\n {onArchive && (\n <TableCell align=\"center\" sx={{ width: 80 }}>\n <Button\n variant=\"text\"\n color=\"inherit\"\n size=\"small\"\n onClick={() => onArchive(row)}\n sx={{\n fontSize: \"1.3rem\",\n fontWeight: 500,\n lineHeight: \"2.2rem\",\n padding: \"4px 5px\"\n }}\n >\n {row.is_archived\n ? T.translate(\"general.unarchive\")\n : T.translate(\"general.archive\")}\n </Button>\n </TableCell>\n )}\n {onDelete && (\n <TableCell sx={getCellSx(row)}>\n <IconButton\n onClick={() => handleDelete(row)}\n size=\"small\"\n aria-label={T.translate(\"general.delete\")}\n >\n <DeleteIcon />\n </IconButton>\n </TableCell>\n )}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </TableContainer>\n <TablePagination\n rowsPerPageOptions={customPerPageOptions}\n component=\"div\"\n count={totalRows ?? data.length}\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 </Paper>\n </Box>\n );\n};\n\nexport default MuiTableEditable;\n"],"names":["root","factory","exports","module","define","amd","this","iconMap","warning","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","require","createRoot","_","Promise","resolve","container","document","createElement","body","appendChild","close","answer","unmount","ReactDOM","remove","element","render","DEFAULT_PER_PAGE","TWENTY_PER_PAGE","FIFTY_PER_PAGE","__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","ARCHIVED_CELL_SX","backgroundColor","EditableCell","isEditing","onBlur","validation","inputValue","setInputValue","React","isHovering","setIsHovering","setError","handleValidationAndSave","newValue","isValid","message","schema","validateSync","err","validateValue","handleKeyDown","e","preventDefault","TextField","autoFocus","onChange","target","onKeyDown","size","helperText","position","width","height","onMouseEnter","onMouseLeave","flex","fontSize","opacity","right","columns","data","totalRows","perPage","currentPage","onPageChange","onPerPageChange","onSort","options","sortCol","sortDir","disableProp","getName","item","name","onEdit","onArchive","onDelete","onCellChange","deleteDialogBody","editingCell","setEditingCell","basePerPageOptions","customPerPageOptions","includes","sort","b","getCellSx","row","baseSx","getArchivedCellSx","isEditable","col","editable","elevation","mb","Paper","borderRadius","boxShadow","map","columnKey","maxWidth","align","sortable","active","direction","header","visuallyHidden","T","id","column","find","rowId","handleCellClick","cursor","padding","handleCellBlur","IconButton","fontWeight","lineHeight","is_archived","async","showConfirmDialog","type","showCancelButton","handleDelete","rowsPerPageOptions","count","length","rowsPerPage","page","newPage","onRowsPerPageChange","ev","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={4574:(e,t,r)=>{r.d(t,{default:()=>u});var n=r(2015),a=r.n(n),l=r(9825),o=r.n(l),i=r(8619),s=r(5814);const d={warning:a().createElement(s.Warning,{color:"warning"}),success:a().createElement(s.CheckCircle,{color:"success"}),error:a().createElement(s.Error,{color:"error"}),info:a().createElement(s.Info,{color:"info"})},c=({open:e,title:t,text:r,iconType:n="",onConfirm:l,onCancel:o,confirmButtonText:s="Confirm",confirmButtonColor:c="primary",cancelButtonText:u="Cancel",cancelButtonColor:m="primary"})=>a().createElement(i.Dialog,{open:e,onClose:o},a().createElement(i.DialogTitle,{sx:{p:2},component:"div"},a().createElement(i.Typography,{variant:"h5"},t)),a().createElement(i.Divider,null),a().createElement(i.DialogContent,{sx:{p:2}},a().createElement("div",{style:{display:"flex",alignItems:"center"}},d[n]&&a().createElement("div",{style:{marginRight:10}},d[n]),a().createElement(i.Typography,{variant:"body1"},r))),a().createElement(i.Divider,{sx:{margin:"10px 0px 10px 0px"}}),a().createElement(i.DialogActions,null,a().createElement(i.Button,{fullWidth:!0,onClick:o,color:m,variant:"outlined",sx:{whiteSpace:"nowrap",minWidth:100}},u),a().createElement(i.Button,{fullWidth:!0,onClick:l,color:c,variant:"contained",sx:{whiteSpace:"nowrap",minWidth:100}},s)));c.propTypes={open:o().bool,title:o().string.isRequired,text:o().string.isRequired,iconType:o().string,onConfirm:o().func.isRequired,onCancel:o().func.isRequired,confirmButtonText:o().string,confirmButtonColor:o().string,cancelButtonText:o().string,cancelButtonColor:o().string},c.defaultProps={open:!1,iconType:"warning",confirmButtonText:"Confirm",confirmButtonColor:"primary",cancelButtonText:"Cancel",cancelButtonColor:"default"};const u=c},1960:(e,t,r)=>{r.d(t,{default:()=>y});var n=r(6031),a=r.n(n),l=r(1116),o=r.n(l),i=r(2015),s=r.n(i),d=r(9825),c=r.n(d),u=r(7050),m=r(8619);function p(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 f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const g=({items:e,onReorder:t,renderItem:r,idKey:n,updateOrderKey:l,droppableId:o})=>s().createElement(u.DragDropContext,{onDragEnd:r=>{if(!r.destination)return;const n=((e,t,r,n)=>{const a=Array.from(e),[l]=a.splice(t,1);return a.splice(r,0,l),a.map(((e,t)=>f(f({},e),{},{[n]:t+1})))})(e,r.source.index,r.destination.index,l);t(n,r)}},s().createElement(u.Droppable,{droppableId:o},(t=>s().createElement(m.Box,a()({ref:t.innerRef},t.droppableProps,{sx:{width:"100%"}}),e.map(((e,t)=>s().createElement(u.Draggable,{key:String(e[n]||`new-${t}`),draggableId:String(e[n]||`new-${t}`),index:t},((n,l)=>s().createElement(m.Box,a()({ref:n.innerRef},n.draggableProps,n.dragHandleProps,{sx:{background:l.isDragging?"#f0f0f0":"inherit",transition:"background 0.2s ease"}}),r(e,t,n,l)))))),t.placeholder))));g.propTypes={items:c().array.isRequired,onReorder:c().func.isRequired,renderItem:c().func.isRequired,idKey:c().string,updateOrderKey:c().string,droppableId:c().string},g.defaultProps={idKey:"id",updateOrderKey:"order",droppableId:"droppable"};const y=g},402:(e,t,r)=>{r.d(t,{default:()=>C});var n=r(2015),a=r.n(n),l=r(8619),o=r(3294),i=r(6842),s=r.n(i),d=r(6084),c=r.n(d);const u=require("@mui/icons-material/Add");var m=r.n(u),p=r(4325),f=r.n(p),g=r(1960),y=r(2024),b=r(9314),x=r(7994);const h=({field:e,fieldIndex:t,baseName:r="meta_fields",onMetaFieldTypeValueDeleted:n,entityId:i})=>{const{values:d,setFieldValue:c}=(0,o.useFormikContext)(),u=d[r]||[],p=[...e.values].sort(((e,t)=>e.order-t.order)),h=(e,n)=>`${r}[${t}].values[${e}].${n}`;return a().createElement(l.Box,null,a().createElement(g.default,{items:p,onReorder:e=>{const n=[...u];n[t].values=e,c(r,n)},renderItem:(o,d,m,p)=>{const g=e.values.findIndex((e=>e.id&&e.id===o.id||e===o)),v=-1!==g?g:d;return a().createElement(l.Box,{key:o.id||`value-${v}`},a().createElement(l.Grid2,{container:!0,spacing:2,sx:{alignItems:"start",background:null!=p&&p.isDragging?"#ebebeb":"inherit",boxShadow:null!=p&&p.isDragging?"0px 5px 15px rgba(0,0,0,0.3)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease",transform:null!=p&&p.isDragging?"scale(1.02)":"none",py:2}},a().createElement(l.Grid2,{size:4},a().createElement(b.default,{name:h(v,"name"),placeholder:s().translate("meta_fields.placeholders.name"),margin:"none",fullWidth:!0})),a().createElement(l.Grid2,{size:4},a().createElement(b.default,{name:h(v,"value"),placeholder:s().translate("meta_fields.placeholders.value"),margin:"none",fullWidth:!0,InputProps:{endAdornment:a().createElement(l.IconButton,{onClick:()=>(async(a,l)=>{if(!await(0,y.default)({title:s().translate("general.are_you_sure"),text:s().translate("meta_fields.delete_value_warning"),type:"warning",confirmButtonColor:"#DD6B55",confirmButtonText:s().translate("general.yes_delete")}))return;const o=()=>{const e=[...u];e[t].values=e[t].values.filter(((e,t)=>t!==l)),c(r,e)};e.id&&a.id&&n?n(i,e.id,a.id).then((()=>o())):o()})(o,v),"aria-label":"remove value"},a().createElement(f(),null))}})),a().createElement(l.Grid2,{size:4},a().createElement(x.default,{name:h(v,"is_default"),label:s().translate("meta_fields.is_default"),onChange:e=>((e,n)=>{const a=[...u];n&&a[t].values.forEach((e=>{e.is_default=!1})),a[t].values[e].is_default=n,c(r,a)})(v,e.target.checked)}))),a().createElement(l.Divider,null))},idKey:"id",updateOrderKey:"order",droppableId:`droppable-values-${t}`}),a().createElement(l.Grid2,{container:!0,spacing:2,sx:{mt:2},offset:4},a().createElement(l.Button,{startIcon:a().createElement(m(),null),disabled:(()=>e.values.length>0&&e.values.some((e=>{var t,r;return!(null!==(t=e.name)&&void 0!==t&&t.trim()&&null!==(r=e.value)&&void 0!==r&&r.trim())})))(),onClick:()=>{const e=[...u];e[t].values.push({value:"",name:"",is_default:!1}),c(r,e)},variant:"text"},s().translate("meta_fields.add_value"))))};var v=r(2359),E=r(3209);const C=({item:e,itemIdx:t,baseName:r,onAdd:n,onDelete:i,onDeleteValue:d,entityId:u,isAddDisabled:p})=>{const{errors:f,touched:g,values:y}=(0,o.useFormikContext)(),C=e=>`${r}[${t}].${e}`,B=(0,o.getIn)(y,C("type")),_=(0,o.getIn)(f,`${r}[${t}]`),D=(0,o.getIn)(g,`${r}[${t}]`),O=(null==D?void 0:D.values)&&(null==_?void 0:_.values)&&"string"==typeof _.values;return a().createElement(l.Grid2,{container:!0,spacing:2,sx:{alignItems:"center"}},a().createElement(l.Grid2,{size:11},a().createElement(l.Box,{sx:{border:"1px solid #0000001F",borderRadius:"4px",p:2,my:2}},a().createElement(l.Grid2,{container:!0,spacing:2,sx:{alignItems:"start"}},a().createElement(l.Grid2,{size:4},a().createElement(l.InputLabel,{htmlFor:C("name")},s().translate("additional_inputs.title")),a().createElement(b.default,{name:C("name"),margin:"none",placeholder:s().translate("additional_inputs.placeholders.title"),fullWidth:!0})),a().createElement(l.Grid2,{size:4},a().createElement(l.InputLabel,{htmlFor:C("type")},s().translate("additional_inputs.type")),a().createElement(v.default,{name:C("type"),placeholder:s().translate("additional_inputs.placeholders.type")},E.GV.map((e=>a().createElement(l.MenuItem,{key:e,value:e},e))))),a().createElement(l.Grid2,{size:4,sx:{alignSelf:"end"}},a().createElement(x.default,{name:C("is_required"),label:s().translate("additional_inputs.required")}))),E.in.includes(B)&&a().createElement(a().Fragment,null,a().createElement(l.Divider,{sx:{mt:2}}),a().createElement(h,{field:e,fieldIndex:t,baseName:r,onMetaFieldTypeValueDeleted:d,entityId:u}),O&&a().createElement(l.FormHelperText,{error:!0,sx:{mt:1}},_.values)),"Quantity"===B&&a().createElement(l.Grid2,{container:!0,spacing:2,sx:{alignItems:"start",mt:2}},a().createElement(l.Grid2,{size:4},a().createElement(b.default,{name:C("minimum_quantity"),placeholder:s().translate("additional_inputs.placeholders.minimum_quantity"),type:"number",margin:"none",fullWidth:!0})),a().createElement(l.Grid2,{size:4},a().createElement(b.default,{name:C("maximum_quantity"),placeholder:s().translate("additional_inputs.placeholders.maximum_quantity"),type:"number",margin:"none",fullWidth:!0}))))),a().createElement(l.Grid2,{size:1},a().createElement(l.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1}},a().createElement(l.Button,{variant:"outlined","aria-label":"delete",sx:{width:40,height:40,minWidth:"auto",borderRadius:"50%",padding:0},onClick:()=>i(e,t)},a().createElement(c(),null)),a().createElement(l.Button,{variant:"contained","aria-label":"add",disabled:p,sx:{width:40,height:40,minWidth:"auto",borderRadius:"50%",padding:0},onClick:n},a().createElement(m(),null)))))}},7994:(e,t,r)=>{r.d(t,{default:()=>g});var n=r(6031),a=r.n(n),l=r(2462),o=r.n(l),i=r(2015),s=r.n(i),d=r(9825),c=r.n(d),u=r(8619),m=r(3294);const p=["name","label"],f=e=>{let{name:t,label:r}=e,n=o()(e,p);const[l,i]=(0,m.useField)({name:t,type:"checkbox"});return s().createElement(u.FormControl,{fullWidth:!0,margin:"normal",error:i.touched&&Boolean(i.error)},s().createElement(u.FormControlLabel,{control:s().createElement(u.Checkbox,a()({name:t},l,{checked:l.value},n)),label:r}),i.touched&&i.error&&s().createElement(u.FormHelperText,null,i.error))};f.propTypes={name:c().string.isRequired,label:c().string.isRequired};const g=f},2359:(e,t,r)=>{r.d(t,{default:()=>b});var n=r(6031),a=r.n(n),l=r(2462),o=r.n(l),i=r(2015),s=r.n(i),d=r(9825),c=r.n(d),u=r(8619),m=r(692),p=r.n(m),f=r(3294);const g=["name","label","placeholder","children","isClearable"],y=e=>{let{name:t,label:r,placeholder:n,children:l,isClearable:i}=e,d=o()(e,g);const[c,m,y]=(0,f.useField)(t),b=(null==c?void 0:c.value)&&""!==c.value||Boolean(n);return s().createElement(u.FormControl,{fullWidth:!0,error:m.touched&&Boolean(m.error)},r&&s().createElement(u.InputLabel,{htmlFor:t,id:`${t}-label`,shrink:b},r),s().createElement(u.Select,a()({name:t,id:t},c,{labelId:`${t}-label`,label:r,notched:b,displayEmpty:!0,renderValue:e=>e&&""!==e?e:s().createElement("span",{style:{color:"#aaa"}},n),endAdornment:i&&c.value?s().createElement(u.InputAdornment,{position:"end",sx:{mr:2}},s().createElement(u.IconButton,{size:"small",onClick:e=>{e.stopPropagation(),y.setValue("")}},s().createElement(p(),{fontSize:"small"}))):null},d),l),m.touched&&m.error&&s().createElement(u.FormHelperText,null,m.error))};y.propTypes={name:c().string.isRequired,children:c().node.isRequired,placeholder:c().string,isClearable:c().bool};const b=y},9314:(e,t,r)=>{r.d(t,{default:()=>g});var n=r(6031),a=r.n(n),l=r(2462),o=r.n(l),i=r(2015),s=r.n(i),d=r(9825),c=r.n(d),u=r(8619),m=r(3294);const p=["name","label","maxLength","required"],f=e=>{var t;let{name:r,label:n,maxLength:l,required:i=!1}=e,d=o()(e,p);const[c,f]=(0,m.useField)(r),g=(null===(t=c.value)||void 0===t?void 0:t.length)||0;let y="";return n&&(y=i?`${n} *`:n),s().createElement(u.Box,null,s().createElement(u.TextField,a()({name:r,label:y},c,{onBlur:c.onBlur,margin:"normal",error:f.touched&&Boolean(f.error),helperText:f.touched&&f.error,slotProps:{htmlInput:{maxLength:l}}},d)),l&&s().createElement(u.Typography,{sx:{fontSize:"1.2rem",color:"#00000099",pl:2}},l-g+" characters left"))};f.propTypes={name:c().string.isRequired,label:c().string,maxLength:c().number,required:c().bool};const g=f},2024:(e,t,r)=>{r.d(t,{default:()=>s});const n=require("react-dom");var a=r.n(n),l=r(2015),o=r.n(l),i=r(4574);const s=({title:e,text:t,iconType:r="",confirmButtonText:n="Confirm",cancelButtonText:l="Cancel",confirmButtonColor:s="primary",cancelButtonColor:d="primary"})=>new Promise((c=>{const u=document.createElement("div");document.body.appendChild(u);const m=e=>{a().unmountComponentAtNode(u),u.remove(),c(e)};a().render(o().createElement(i.default,{open:!0,title:e,text:t,iconType:r,confirmButtonText:n,cancelButtonText:l,confirmButtonColor:s,cancelButtonColor:d,onConfirm:()=>m(!0),onCancel:()=>m(!1)}),u)}))},3209:(e,t,r)=>{r.d(t,{GV:()=>a,in:()=>n});const n=["CheckBoxList","ComboBox","RadioButtonList"],a=["CheckBox",...n,"Text","TextArea","Quantity","DateTime","Time"]},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},5814:e=>{e.exports=require("@mui/icons-material")},692:e=>{e.exports=require("@mui/icons-material/Clear")},4325:e=>{e.exports=require("@mui/icons-material/Close")},6084:e=>{e.exports=require("@mui/icons-material/Delete")},8619:e=>{e.exports=require("@mui/material")},3294:e=>{e.exports=require("formik")},9870:e=>{e.exports=require("i18n-react")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")},7050:e=>{e.exports=require("react-beautiful-dnd")}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var l=t[n]={exports:{}};return e[n](l,l.exports,r),l.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var n={};r.r(n),r.d(n,{default:()=>b});var a=r(1116),l=r.n(a),o=r(2015),i=r.n(o),s=r(3294),d=r(9870),c=r.n(d),u=r(402),m=r(2024),p=r(3209);function f(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?f(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const y={name:"",type:"",is_required:!1,minimum_quantity:0,maximum_quantity:0,values:[]},b=({name:e,onDelete:t,onDeleteValue:r,entityId:n})=>{const{values:a,setFieldValue:l,errors:d,setFieldTouched:f}=(0,s.useFormikContext)(),b=a[e]||[];(0,o.useEffect)((()=>{0===b.length&&l(e,[g(g({},y),{},{_key:`draft_${Date.now()}`})])}),[b.length]);const x=()=>{l(e,[...b,g(g({},y),{},{_key:`draft_${Date.now()}`})])},h=async(r,a)=>{if(!await(0,m.default)({title:c().translate("general.are_you_sure"),text:`${c().translate("additional_inputs.delete_warning")} ${r.name}`,type:"warning",confirmButtonColor:"#DD6B55",confirmButtonText:c().translate("general.yes_delete")}))return;const o=()=>{const t=b.filter(((e,t)=>t!==a));0===t.length&&t.push(g(g({},y),{},{_key:`draft_${Date.now()}`})),l(e,t),f(e,[],!1)};r.id&&t?t(n,r.id).then((()=>o())).catch((e=>console.error("Error deleting field from API",e))):o()},v=()=>{const t=(0,s.getIn)(d,e);if(t&&Array.isArray(t)){if(t.some((e=>e&&Object.keys(e).length>0)))return!0}return b.some((e=>{var t;if(null===(t=e.name)||void 0===t||!t.trim()||!e.type)return!0;if(p.in.includes(e.type)){if(!e.values||0===e.values.length)return!0;if(e.values.some((e=>{var t,r;return!(null!==(t=e.name)&&void 0!==t&&t.trim()&&null!==(r=e.value)&&void 0!==r&&r.trim())})))return!0}return!1}))};return i().createElement(i().Fragment,null,b.map(((t,a)=>i().createElement(u.default,{key:t.id||t._key,item:t,itemIdx:a,baseName:e,onAdd:x,onDelete:h,onDeleteValue:r,entityId:n,isAddDisabled:v()}))))};return n})()));
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,r)=>{r.d(t,{default:()=>u});var n=r(2015),a=r.n(n),l=r(9825),o=r.n(l),i=r(8619),s=r(5814);const c={warning:a().createElement(s.Warning,{color:"warning"}),success:a().createElement(s.CheckCircle,{color:"success"}),error:a().createElement(s.Error,{color:"error"}),info:a().createElement(s.Info,{color:"info"})},d=({open:e,title:t,text:r,iconType:n="",onConfirm:l,onCancel:o,confirmButtonText:s="Confirm",confirmButtonColor:d="primary",cancelButtonText:u="Cancel",cancelButtonColor:m="primary"})=>a().createElement(i.Dialog,{open:e,onClose:o},a().createElement(i.DialogTitle,{sx:{p:2},component:"div"},a().createElement(i.Typography,{variant:"h5"},t)),a().createElement(i.Divider,null),a().createElement(i.DialogContent,{sx:{p:2}},a().createElement("div",{style:{display:"flex",alignItems:"center"}},c[n]&&a().createElement("div",{style:{marginRight:10}},c[n]),a().createElement(i.Typography,{variant:"body1"},r))),a().createElement(i.Divider,{sx:{margin:"10px 0px 10px 0px"}}),a().createElement(i.DialogActions,null,a().createElement(i.Button,{fullWidth:!0,onClick:o,color:m,variant:"outlined",sx:{whiteSpace:"nowrap",minWidth:100}},u),a().createElement(i.Button,{fullWidth:!0,onClick:l,color:d,variant:"contained",sx:{whiteSpace:"nowrap",minWidth:100}},s)));d.propTypes={open:o().bool,title:o().string.isRequired,text:o().string.isRequired,iconType:o().string,onConfirm:o().func.isRequired,onCancel:o().func.isRequired,confirmButtonText:o().string,confirmButtonColor:o().string,cancelButtonText:o().string,cancelButtonColor:o().string},d.defaultProps={open:!1,iconType:"warning",confirmButtonText:"Confirm",confirmButtonColor:"primary",cancelButtonText:"Cancel",cancelButtonColor:"default"};const u=d},1960:(e,t,r)=>{r.d(t,{default:()=>y});var n=r(6031),a=r.n(n),l=r(1116),o=r.n(l),i=r(2015),s=r.n(i),c=r(9825),d=r.n(c),u=r(7050),m=r(8619);function p(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 f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const g=({items:e,onReorder:t,renderItem:r,idKey:n,updateOrderKey:l,droppableId:o})=>s().createElement(u.DragDropContext,{onDragEnd:r=>{if(!r.destination)return;const n=((e,t,r,n)=>{const a=Array.from(e),[l]=a.splice(t,1);return a.splice(r,0,l),a.map(((e,t)=>f(f({},e),{},{[n]:t+1})))})(e,r.source.index,r.destination.index,l);t(n,r)}},s().createElement(u.Droppable,{droppableId:o},(t=>s().createElement(m.Box,a()({ref:t.innerRef},t.droppableProps,{sx:{width:"100%"}}),e.map(((e,t)=>s().createElement(u.Draggable,{key:String(e[n]||`new-${t}`),draggableId:String(e[n]||`new-${t}`),index:t},((n,l)=>s().createElement(m.Box,a()({ref:n.innerRef},n.draggableProps,n.dragHandleProps,{sx:{background:l.isDragging?"#f0f0f0":"inherit",transition:"background 0.2s ease"}}),r(e,t,n,l)))))),t.placeholder))));g.propTypes={items:d().array.isRequired,onReorder:d().func.isRequired,renderItem:d().func.isRequired,idKey:d().string,updateOrderKey:d().string,droppableId:d().string},g.defaultProps={idKey:"id",updateOrderKey:"order",droppableId:"droppable"};const y=g},402:(e,t,r)=>{r.d(t,{default:()=>C});var n=r(2015),a=r.n(n),l=r(8619),o=r(3294),i=r(6842),s=r.n(i),c=r(6084),d=r.n(c);const u=require("@mui/icons-material/Add");var m=r.n(u),p=r(4325),f=r.n(p),g=r(1960),y=r(2024),b=r(9314),x=r(7994);const h=({field:e,fieldIndex:t,baseName:r="meta_fields",onMetaFieldTypeValueDeleted:n,entityId:i})=>{const{values:c,setFieldValue:d}=(0,o.useFormikContext)(),u=c[r]||[],p=[...e.values].sort(((e,t)=>e.order-t.order)),h=(e,n)=>`${r}[${t}].values[${e}].${n}`;return a().createElement(l.Box,null,a().createElement(g.default,{items:p,onReorder:e=>{const n=[...u];n[t].values=e,d(r,n)},renderItem:(o,c,m,p)=>{const g=e.values.findIndex((e=>e.id&&e.id===o.id||e===o)),v=-1!==g?g:c;return a().createElement(l.Box,{key:o.id||`value-${v}`},a().createElement(l.Grid2,{container:!0,spacing:2,sx:{alignItems:"start",background:null!=p&&p.isDragging?"#ebebeb":"inherit",boxShadow:null!=p&&p.isDragging?"0px 5px 15px rgba(0,0,0,0.3)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease",transform:null!=p&&p.isDragging?"scale(1.02)":"none",py:2}},a().createElement(l.Grid2,{size:4},a().createElement(b.default,{name:h(v,"name"),placeholder:s().translate("meta_fields.placeholders.name"),margin:"none",fullWidth:!0})),a().createElement(l.Grid2,{size:4},a().createElement(b.default,{name:h(v,"value"),placeholder:s().translate("meta_fields.placeholders.value"),margin:"none",fullWidth:!0,InputProps:{endAdornment:a().createElement(l.IconButton,{onClick:()=>(async(a,l)=>{if(!await(0,y.default)({title:s().translate("general.are_you_sure"),text:s().translate("meta_fields.delete_value_warning"),type:"warning",confirmButtonColor:"#DD6B55",confirmButtonText:s().translate("general.yes_delete")}))return;const o=()=>{const e=[...u];e[t].values=e[t].values.filter(((e,t)=>t!==l)),d(r,e)};e.id&&a.id&&n?n(i,e.id,a.id).then((()=>o())):o()})(o,v),"aria-label":"remove value"},a().createElement(f(),null))}})),a().createElement(l.Grid2,{size:4},a().createElement(x.default,{name:h(v,"is_default"),label:s().translate("meta_fields.is_default"),onChange:e=>((e,n)=>{const a=[...u];n&&a[t].values.forEach((e=>{e.is_default=!1})),a[t].values[e].is_default=n,d(r,a)})(v,e.target.checked)}))),a().createElement(l.Divider,null))},idKey:"id",updateOrderKey:"order",droppableId:`droppable-values-${t}`}),a().createElement(l.Grid2,{container:!0,spacing:2,sx:{mt:2},offset:4},a().createElement(l.Button,{startIcon:a().createElement(m(),null),disabled:(()=>e.values.length>0&&e.values.some((e=>{var t,r;return!(null!==(t=e.name)&&void 0!==t&&t.trim()&&null!==(r=e.value)&&void 0!==r&&r.trim())})))(),onClick:()=>{const e=[...u];e[t].values.push({value:"",name:"",is_default:!1}),d(r,e)},variant:"text"},s().translate("meta_fields.add_value"))))};var v=r(2359),E=r(3209);const C=({item:e,itemIdx:t,baseName:r,onAdd:n,onDelete:i,onDeleteValue:c,entityId:u,isAddDisabled:p})=>{const{errors:f,touched:g,values:y}=(0,o.useFormikContext)(),C=e=>`${r}[${t}].${e}`,B=(0,o.getIn)(y,C("type")),_=(0,o.getIn)(f,`${r}[${t}]`),D=(0,o.getIn)(g,`${r}[${t}]`),O=(null==D?void 0:D.values)&&(null==_?void 0:_.values)&&"string"==typeof _.values;return a().createElement(l.Grid2,{container:!0,spacing:2,sx:{alignItems:"center"}},a().createElement(l.Grid2,{size:11},a().createElement(l.Box,{sx:{border:"1px solid #0000001F",borderRadius:"4px",p:2,my:2}},a().createElement(l.Grid2,{container:!0,spacing:2,sx:{alignItems:"start"}},a().createElement(l.Grid2,{size:4},a().createElement(l.InputLabel,{htmlFor:C("name")},s().translate("additional_inputs.title")),a().createElement(b.default,{name:C("name"),margin:"none",placeholder:s().translate("additional_inputs.placeholders.title"),fullWidth:!0})),a().createElement(l.Grid2,{size:4},a().createElement(l.InputLabel,{htmlFor:C("type")},s().translate("additional_inputs.type")),a().createElement(v.default,{name:C("type"),placeholder:s().translate("additional_inputs.placeholders.type")},E.GV.map((e=>a().createElement(l.MenuItem,{key:e,value:e},e))))),a().createElement(l.Grid2,{size:4,sx:{alignSelf:"end"}},a().createElement(x.default,{name:C("is_required"),label:s().translate("additional_inputs.required")}))),E.in.includes(B)&&a().createElement(a().Fragment,null,a().createElement(l.Divider,{sx:{mt:2}}),a().createElement(h,{field:e,fieldIndex:t,baseName:r,onMetaFieldTypeValueDeleted:c,entityId:u}),O&&a().createElement(l.FormHelperText,{error:!0,sx:{mt:1}},_.values)),"Quantity"===B&&a().createElement(l.Grid2,{container:!0,spacing:2,sx:{alignItems:"start",mt:2}},a().createElement(l.Grid2,{size:4},a().createElement(b.default,{name:C("minimum_quantity"),placeholder:s().translate("additional_inputs.placeholders.minimum_quantity"),type:"number",margin:"none",fullWidth:!0})),a().createElement(l.Grid2,{size:4},a().createElement(b.default,{name:C("maximum_quantity"),placeholder:s().translate("additional_inputs.placeholders.maximum_quantity"),type:"number",margin:"none",fullWidth:!0}))))),a().createElement(l.Grid2,{size:1},a().createElement(l.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1}},a().createElement(l.Button,{variant:"outlined","aria-label":"delete",sx:{width:40,height:40,minWidth:"auto",borderRadius:"50%",padding:0},onClick:()=>i(e,t)},a().createElement(d(),null)),a().createElement(l.Button,{variant:"contained","aria-label":"add",disabled:p,sx:{width:40,height:40,minWidth:"auto",borderRadius:"50%",padding:0},onClick:n},a().createElement(m(),null)))))}},7994:(e,t,r)=>{r.d(t,{default:()=>g});var n=r(6031),a=r.n(n),l=r(2462),o=r.n(l),i=r(2015),s=r.n(i),c=r(9825),d=r.n(c),u=r(8619),m=r(3294);const p=["name","label"],f=e=>{let{name:t,label:r}=e,n=o()(e,p);const[l,i]=(0,m.useField)({name:t,type:"checkbox"});return s().createElement(u.FormControl,{fullWidth:!0,margin:"normal",error:i.touched&&Boolean(i.error)},s().createElement(u.FormControlLabel,{control:s().createElement(u.Checkbox,a()({name:t},l,{checked:l.value},n)),label:r}),i.touched&&i.error&&s().createElement(u.FormHelperText,null,i.error))};f.propTypes={name:d().string.isRequired,label:d().string.isRequired};const g=f},2359:(e,t,r)=>{r.d(t,{default:()=>b});var n=r(6031),a=r.n(n),l=r(2462),o=r.n(l),i=r(2015),s=r.n(i),c=r(9825),d=r.n(c),u=r(8619),m=r(692),p=r.n(m),f=r(3294);const g=["name","label","placeholder","children","isClearable"],y=e=>{let{name:t,label:r,placeholder:n,children:l,isClearable:i}=e,c=o()(e,g);const[d,m,y]=(0,f.useField)(t),b=(null==d?void 0:d.value)&&""!==d.value||Boolean(n);return s().createElement(u.FormControl,{fullWidth:!0,error:m.touched&&Boolean(m.error)},r&&s().createElement(u.InputLabel,{htmlFor:t,id:`${t}-label`,shrink:b},r),s().createElement(u.Select,a()({name:t,id:t},d,{labelId:`${t}-label`,label:r,notched:b,displayEmpty:!0,renderValue:e=>e&&""!==e?e:s().createElement("span",{style:{color:"#aaa"}},n),endAdornment:i&&d.value?s().createElement(u.InputAdornment,{position:"end",sx:{mr:2}},s().createElement(u.IconButton,{size:"small",onClick:e=>{e.stopPropagation(),y.setValue("")}},s().createElement(p(),{fontSize:"small"}))):null},c),l),m.touched&&m.error&&s().createElement(u.FormHelperText,null,m.error))};y.propTypes={name:d().string.isRequired,children:d().node.isRequired,placeholder:d().string,isClearable:d().bool};const b=y},9314:(e,t,r)=>{r.d(t,{default:()=>g});var n=r(6031),a=r.n(n),l=r(2462),o=r.n(l),i=r(2015),s=r.n(i),c=r(9825),d=r.n(c),u=r(8619),m=r(3294);const p=["name","label","maxLength","required"],f=e=>{var t;let{name:r,label:n,maxLength:l,required:i=!1}=e,c=o()(e,p);const[d,f]=(0,m.useField)(r),g=(null===(t=d.value)||void 0===t?void 0:t.length)||0;let y="";return n&&(y=i?`${n} *`:n),s().createElement(u.Box,null,s().createElement(u.TextField,a()({name:r,label:y},d,{onBlur:d.onBlur,margin:"normal",error:f.touched&&Boolean(f.error),helperText:f.touched&&f.error,slotProps:{htmlInput:{maxLength:l}}},c)),l&&s().createElement(u.Typography,{sx:{fontSize:"1.2rem",color:"#00000099",pl:2}},l-g+" characters left"))};f.propTypes={name:d().string.isRequired,label:d().string,maxLength:d().number,required:d().bool};const g=f},2024:(e,t,r)=>{r.d(t,{default:()=>c});const n=require("react-dom");var a=r.n(n),l=r(2015),o=r.n(l),i=r(4574);let s;try{({createRoot:s}=r(1976))}catch(e){}const c=({title:e,text:t,iconType:r="",confirmButtonText:n="Confirm",cancelButtonText:l="Cancel",confirmButtonColor:c="primary",cancelButtonColor:d="primary"})=>new Promise((u=>{const m=document.createElement("div");document.body.appendChild(m);let p=null;const f=e=>{p?p.unmount():a().unmountComponentAtNode(m),m.remove(),u(e)},g=o().createElement(i.default,{open:!0,title:e,text:t,iconType:r,confirmButtonText:n,cancelButtonText:l,confirmButtonColor:c,cancelButtonColor:d,onConfirm:()=>f(!0),onCancel:()=>f(!1)});s?(p=s(m),p.render(g)):a().render(g,m)}))},3209:(e,t,r)=>{r.d(t,{GV:()=>a,in:()=>n});const n=["CheckBoxList","ComboBox","RadioButtonList"],a=["CheckBox",...n,"Text","TextArea","Quantity","DateTime","Time"]},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},5814:e=>{e.exports=require("@mui/icons-material")},692:e=>{e.exports=require("@mui/icons-material/Clear")},4325:e=>{e.exports=require("@mui/icons-material/Close")},6084:e=>{e.exports=require("@mui/icons-material/Delete")},8619:e=>{e.exports=require("@mui/material")},3294:e=>{e.exports=require("formik")},9870:e=>{e.exports=require("i18n-react")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")},7050:e=>{e.exports=require("react-beautiful-dnd")},1976:e=>{e.exports=require("react-dom/client")}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var l=t[n]={exports:{}};return e[n](l,l.exports,r),l.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var n={};r.r(n),r.d(n,{default:()=>b});var a=r(1116),l=r.n(a),o=r(2015),i=r.n(o),s=r(3294),c=r(9870),d=r.n(c),u=r(402),m=r(2024),p=r(3209);function f(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?f(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const y={name:"",type:"",is_required:!1,minimum_quantity:0,maximum_quantity:0,values:[]},b=({name:e,onDelete:t,onDeleteValue:r,entityId:n})=>{const{values:a,setFieldValue:l,errors:c,setFieldTouched:f}=(0,s.useFormikContext)(),b=a[e]||[];(0,o.useEffect)((()=>{0===b.length&&l(e,[g(g({},y),{},{_key:`draft_${Date.now()}`})])}),[b.length]);const x=()=>{l(e,[...b,g(g({},y),{},{_key:`draft_${Date.now()}`})])},h=async(r,a)=>{if(!await(0,m.default)({title:d().translate("general.are_you_sure"),text:`${d().translate("additional_inputs.delete_warning")} ${r.name}`,type:"warning",confirmButtonColor:"#DD6B55",confirmButtonText:d().translate("general.yes_delete")}))return;const o=()=>{const t=b.filter(((e,t)=>t!==a));0===t.length&&t.push(g(g({},y),{},{_key:`draft_${Date.now()}`})),l(e,t),f(e,[],!1)};r.id&&t?t(n,r.id).then((()=>o())).catch((e=>console.error("Error deleting field from API",e))):o()},v=()=>{const t=(0,s.getIn)(c,e);if(t&&Array.isArray(t)){if(t.some((e=>e&&Object.keys(e).length>0)))return!0}return b.some((e=>{var t;if(null===(t=e.name)||void 0===t||!t.trim()||!e.type)return!0;if(p.in.includes(e.type)){if(!e.values||0===e.values.length)return!0;if(e.values.some((e=>{var t,r;return!(null!==(t=e.name)&&void 0!==t&&t.trim()&&null!==(r=e.value)&&void 0!==r&&r.trim())})))return!0}return!1}))};return i().createElement(i().Fragment,null,b.map(((t,a)=>i().createElement(u.default,{key:t.id||t._key,item:t,itemIdx:a,baseName:e,onAdd:x,onDelete:h,onDeleteValue:r,entityId:n,isAddDisabled:v()}))))};return n})()));
2
2
  //# sourceMappingURL=additional-input-list.js.map