openstack-uicore-foundation 5.0.36-beta.2 → 5.0.37-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/lib/components/index.js +1 -1
  2. package/lib/components/index.js.map +1 -1
  3. package/lib/components/inputs/upload-input-v2.js +1 -1
  4. package/lib/components/inputs/upload-input-v2.js.map +1 -1
  5. package/lib/components/inputs/upload-input-v3.js +1 -1
  6. package/lib/components/inputs/upload-input-v3.js.map +1 -1
  7. package/lib/components/mui/bulk-edit-table.js +1 -1
  8. package/lib/components/mui/bulk-edit-table.js.map +1 -1
  9. package/lib/components/mui/dropdown.js +1 -1
  10. package/lib/components/mui/dropdown.js.map +1 -1
  11. package/lib/components/mui/editable-table.js +1 -1
  12. package/lib/components/mui/editable-table.js.map +1 -1
  13. package/lib/components/mui/form-item-table.js +1 -1
  14. package/lib/components/mui/form-item-table.js.map +1 -1
  15. package/lib/components/mui/formik-inputs/async-select.js +1 -1
  16. package/lib/components/mui/formik-inputs/async-select.js.map +1 -1
  17. package/lib/components/mui/formik-inputs/dropdown-checkbox.js +1 -1
  18. package/lib/components/mui/formik-inputs/dropdown-checkbox.js.map +1 -1
  19. package/lib/components/mui/formik-inputs/dropdown-radio.js +1 -1
  20. package/lib/components/mui/formik-inputs/dropdown-radio.js.map +1 -1
  21. package/lib/components/mui/formik-inputs/select-v2.js +1 -1
  22. package/lib/components/mui/formik-inputs/select-v2.js.map +1 -1
  23. package/lib/components/mui/formik-inputs/upload.js +1 -1
  24. package/lib/components/mui/formik-inputs/upload.js.map +1 -1
  25. package/lib/components/mui/grid-filter.js +1 -1
  26. package/lib/components/mui/grid-filter.js.map +1 -1
  27. package/lib/components/mui/item-settings-modal.js +1 -1
  28. package/lib/components/mui/item-settings-modal.js.map +1 -1
  29. package/lib/components/mui/search-input.js +1 -1
  30. package/lib/components/mui/search-input.js.map +1 -1
  31. package/lib/components/mui/sortable-table.js +1 -1
  32. package/lib/components/mui/sortable-table.js.map +1 -1
  33. package/lib/components/mui/table/custom-table-pagination.js +1 -1
  34. package/lib/components/mui/table/custom-table-pagination.js.map +1 -1
  35. package/lib/components/mui/table.js +1 -1
  36. package/lib/components/mui/table.js.map +1 -1
  37. package/lib/components/mui/upload-dialog.js +1 -1
  38. package/lib/components/mui/upload-dialog.js.map +1 -1
  39. package/lib/components/progressive-img.js +1 -1
  40. package/lib/components/progressive-img.js.map +1 -1
  41. package/lib/css/components/index.css.map +1 -1
  42. package/lib/css/components/mui/bulk-edit-table.css.map +1 -1
  43. package/lib/i18n.js +1 -1
  44. package/lib/i18n.js.map +1 -1
  45. package/lib/utils/theme.js +2 -0
  46. package/lib/utils/theme.js.map +1 -0
  47. package/package.json +1 -1
@@ -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={5420:(e,t,n)=>{n.d(t,{default:()=>g});var r=n(2015),o=n(6842),a=n.n(o);const i=require("@mui/material/TablePagination");var l=n.n(i),c=n(9825),s=n.n(c),u=n(3209);const d={".MuiTablePagination-toolbar":{alignItems:"baseline",marginTop:"1.6rem"},".MuiTablePagination-selectLabel":{color:"rgba(0, 0, 0, 0.6)",fontSize:"12px",fontWeight:"normal"},".MuiTablePagination-select":{color:"rgba(0, 0, 0, 0.6)",fontSize:"12px",fontWeight:"normal"},".MuiTablePagination-spacer":{display:"none"},".MuiTablePagination-displayedRows":{marginLeft:"auto"}},m=[u.WU,u.k6,u.Lr],p=({totalRows:e,perPage:t,currentPage:n,onPageChange:o,onPerPageChange:i})=>{const c=r.useRef(t);let s=m.includes(c.current)?m:[...m,c.current].sort(((e,t)=>e-t));i||(s=[c.current]);return r.createElement(l(),{component:"div",count:e??0,rowsPerPageOptions:s,rowsPerPage:t,page:n-1,onPageChange:(e,t)=>{o(t+1)},onRowsPerPageChange:i?e=>{i(e.target.value)}:void 0,labelRowsPerPage:a().translate("mui_table.rows_per_page"),sx:d})};p.propTypes={totalRows:s().number,perPage:s().number.isRequired,currentPage:s().number.isRequired,onPageChange:s().func.isRequired,onPerPageChange:s().func};const g=p},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")},6084:e=>{e.exports=require("@mui/icons-material/Delete")},9247:e=>{e.exports=require("@mui/icons-material/Edit")},6989:e=>{e.exports=require("@mui/material/Box")},6368:e=>{e.exports=require("@mui/material/Button")},909:e=>{e.exports=require("@mui/material/IconButton")},270:e=>{e.exports=require("@mui/material/Paper")},9292:e=>{e.exports=require("@mui/material/Table")},9008:e=>{e.exports=require("@mui/material/TableBody")},5684:e=>{e.exports=require("@mui/material/TableCell")},5783:e=>{e.exports=require("@mui/material/TableContainer")},8202:e=>{e.exports=require("@mui/material/TableHead")},464:e=>{e.exports=require("@mui/material/TableRow")},38:e=>{e.exports=require("@mui/material/TableSortLabel")},7633:e=>{e.exports=require("@mui/material/TextField")},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:()=>de});var o=n(2015),a=n.n(o),i=n(9825),l=n.n(i),c=n(6989),s=n.n(c),u=n(270),d=n.n(u),m=n(9292),p=n.n(m),g=n(9008),b=n.n(g),f=n(5684),y=n.n(f),h=n(5783),E=n.n(h),P=n(8202),w=n.n(P),x=n(464),v=n.n(x);const C=require("@mui/material/Checkbox");var O=n.n(C),R=n(6842),j=n.n(R),S=n(6368),q=n.n(S);const T=({editEnabled:e,hasSelection:t,onEdit:n,onApply:r,onCancel:o})=>a().createElement(s(),{sx:{display:"flex",gap:1,mb:2}},e?a().createElement(a().Fragment,null,a().createElement(q(),{variant:"contained",onClick:r},j().translate("bulk_actions_page.btn_apply_changes")),a().createElement(q(),{variant:"outlined",onClick:o},j().translate("general.cancel"))):a().createElement(q(),{variant:"contained",onClick:n,disabled:!t},j().translate("event_list.edit_selected")));T.propTypes={editEnabled:l().bool,hasSelection:l().bool,onEdit:l().func,onApply:l().func,onCancel:l().func};const k=T;var _=n(38),D=n.n(_),K=n(6831);const F=e=>{const{editEnabled:t,sortable:n,sortDir:r,onSort:o,columnIndex:i,columnKey:l,width:c,children:u}=e,d=c?{width:c,minWidth:c,maxWidth:c}:{};return!n||t?a().createElement(y(),{sx:d},u):a().createElement(y(),{sx:d},a().createElement(D(),{active:!!r,direction:-1===r?"desc":"asc",onClick:()=>{o&&n&&!t&&o(i,l,r?-1*r:1)}},u,r?a().createElement(s(),{component:"span",sx:K.visuallyHidden},-1===r?j().translate("mui_table.sorted_desc"):j().translate("mui_table.sorted_asc")):null))};F.propTypes={editEnabled:l().bool,onSort:l().func,sortDir:l().number,columnIndex:l().number,columnKey:l().oneOfType([l().string,l().number]),sortable:l().bool,width:l().oneOfType([l().string,l().number]),children:l().node};const W=F;var M=n(1116),A=n.n(M),z=n(909),$=n.n(z),H=n(9247),L=n.n(H),U=n(6084),B=n.n(U),N=n(7633),I=n.n(N);const J=({col:e,row:t,editRow:n,isEditingRow:r,onChange:o})=>{return r&&!0===e.editableField?a().createElement(I(),{id:e.columnKey,placeholder:e.placeholder||"Enter text...",multiline:!0,minRows:2,fullWidth:!0,size:"small",onChange:o,value:n[e.columnKey]||""}):r&&e.editableField?e.editableField({value:(null===(i=n[e.columnKey])||void 0===i?void 0:i.id)??(null===(l=n[e.columnKey])||void 0===l?void 0:l.value)??n[e.columnKey],onChange:o,row:n,rowData:n[e.columnKey]})??null:e.render?e.render(t[e.columnKey],t)??null:a().createElement("span",{style:{fontWeight:"normal"}},t[e.columnKey]??null);var i,l};J.propTypes={col:l().object.isRequired,row:l().object.isRequired,editRow:l().object.isRequired,isEditingRow:l().bool,onChange:l().func};const G=J,X="Xhu4_LGKTq3e40qfe5Wt",Y="_0CBHbvjBDEYwSThSUofl",Z="UloruHeHpGPH5R7sq1kU",V="MSifStCaXi3PkMXSJE_n",Q="LmYr4a7JbDJJhz4VmZZk",ee="OpMx28gG4w8RWw4ugfTz";function te(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 ne(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach((function(t){A()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const re=e=>ne(ne({},e.width?{width:e.width,minWidth:e.width,maxWidth:e.width}:{}),e.customStyle),oe=e=>{const{row:t,columns:n,editEnabled:r,isSelected:o,editRow:i,onToggle:l,onFieldChange:c,actions:u}=e,d=o&&r,m=e=>{const{value:t,id:n}=e.target;c(n,t)};return a().createElement(v(),{role:"row",hover:!0},a().createElement(y(),{align:"center",className:Z,sx:{backgroundColor:"#fff"}},a().createElement(O(),{checked:o,onChange:l,slotProps:{input:{"aria-label":`Select row ${t.id}`}}})),a().createElement(y(),{sx:{fontWeight:"normal"}},t.id),n.filter((e=>"id"!==e.columnKey)).map((e=>a().createElement(y(),{key:`${t.id}_${e.columnKey}`,className:d&&e.editableField?Q:Y,sx:{fontWeight:"normal"},style:re(e)},a().createElement(G,{col:e,row:t,editRow:i,isEditingRow:d,onChange:m})))),((null==u?void 0:u.edit)||(null==u?void 0:u.delete))&&a().createElement(y(),{align:"center",className:`${V} ${ee}`,sx:{backgroundColor:"#fff"}},a().createElement(s(),{sx:{display:"flex",justifyContent:"center",gap:1}},u.edit&&a().createElement($(),{size:"medium",onClick:()=>u.edit.onClick(t),sx:{padding:0},"aria-label":`Edit event ${t.id}`},a().createElement(L(),{fontSize:"large"})),u.delete&&a().createElement($(),{size:"medium",onClick:()=>u.delete.onClick(t),sx:{padding:0},"aria-label":`Delete event ${t.id}`},a().createElement(B(),{fontSize:"large"})))))};oe.propTypes={row:l().object.isRequired,columns:l().array.isRequired,editEnabled:l().bool,isSelected:l().bool,editRow:l().object.isRequired,onToggle:l().func,onFieldChange:l().func,actions:l().object};const ae=oe;function ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function le(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(n),!0).forEach((function(t){A()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const ce=()=>{const[e,t]=(0,o.useState)([]),[n,r]=(0,o.useState)(!1),a=t=>e.some((e=>e.id===t)),i=e=>e.length>0&&e.every((e=>a(e.id))),l=()=>{t([]),r(!1)};return{selectedRows:e,isSelected:a,toggleRow:e=>{t((t=>a(e.id)?t.filter((t=>t.id!==e.id)):[...t,e]))},isAllSelected:i,toggleAll:e=>{t(i(e)?[]:e)},editField:(e,n,r)=>{t((t=>t.map((t=>t.id===e?le(le({},t),{},{[n]:r}):t))))},editEnabled:n,enterEditMode:()=>r(!0),cancel:l,reset:l}};var se=n(5420);const ue=({options:e,columns:t,data:n,onSort:r,onUpdate:i,totalRows:l,perPage:c,currentPage:u,onPageChange:m,onPerPageChange:g})=>{const{selectedRows:f,isSelected:h,toggleRow:P,isAllSelected:x,toggleAll:C,editField:R,editEnabled:j,enterEditMode:S,cancel:q,reset:T}=ce(),_=n.map((e=>e.id)).join(",");(0,o.useEffect)((()=>{T()}),[_]);const D=t=>t===e.sortCol?e.sortDir:null;return a().createElement(s(),{sx:{width:"100%"}},a().createElement(k,{editEnabled:j,hasSelection:f.length>0,onEdit:S,onApply:e=>{e.stopPropagation(),e.preventDefault(),i(f).then((()=>T())).catch((e=>{console.error("Error updating events:",e)}))},onCancel:q}),a().createElement(d(),{elevation:0,sx:{width:"100%",mb:2}},a().createElement(E(),{component:d(),className:X,sx:{borderRadius:0,boxShadow:"none"}},a().createElement(p(),null,a().createElement(w(),{sx:{backgroundColor:"#EAEDF4"}},a().createElement(v(),null,a().createElement(y(),{align:"center",className:Z,sx:{backgroundColor:"#EAEDF4"}},a().createElement(O(),{checked:x(n),onChange:()=>C(n),slotProps:{input:{"aria-label":"select all"}}})),t.map(((e,t)=>{const n=!!e.sortable,o=e.width??"";return a().createElement(W,{editEnabled:j,onSort:r,sortDir:D(e.columnKey),sortable:n,columnIndex:t,columnKey:e.columnKey,width:o,key:`heading_${e.columnKey}`},e.label)})),e.actions&&a().createElement(y(),{align:"center",className:V,sx:{backgroundColor:"#EAEDF4"}},e.actionsHeader||" "))),a().createElement(b(),null,t.length>0&&n.map((n=>a().createElement(ae,{key:`row_${n.id}`,row:n,editEnabled:j,isSelected:h(n.id),editRow:f.find((e=>e.id===n.id))||n,onToggle:()=>P(n),onFieldChange:(e,t)=>R(n.id,e,t),columns:t,actions:e.actions})))))),c&&u&&m&&a().createElement(se.default,{totalRows:l,perPage:c,currentPage:u,onPageChange:m,onPerPageChange:g})))};ue.propTypes={options:l().object.isRequired,columns:l().array.isRequired,data:l().array.isRequired,onSort:l().func.isRequired,onUpdate:l().func.isRequired,totalRows:l().number,perPage:l().number,currentPage:l().number,onPageChange:l().func,onPerPageChange:l().func};const de=ue;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={5420:(e,t,n)=>{n.d(t,{default:()=>g});var r=n(2015),o=n(6842),a=n.n(o);const l=require("@mui/material/TablePagination");var i=n.n(l),c=n(9825),s=n.n(c),u=n(3209);const d={".MuiTablePagination-toolbar":{alignItems:"baseline",marginTop:"1.6rem"},".MuiTablePagination-selectLabel":{color:"rgba(0, 0, 0, 0.6)",fontSize:"12px",fontWeight:"normal"},".MuiTablePagination-select":{color:"rgba(0, 0, 0, 0.6)",fontSize:"12px",fontWeight:"normal"},".MuiTablePagination-spacer":{display:"none"},".MuiTablePagination-displayedRows":{marginLeft:"auto"}},m=[u.WU,u.k6,u.Lr],p=({totalRows:e,perPage:t,currentPage:n,onPageChange:o,onPerPageChange:l})=>{const c=r.useMemo((()=>l?m.includes(t)?m:[...m,t].sort(((e,t)=>e-t)):[t]),[t,l]);return r.createElement(i(),{component:"div",count:e??0,rowsPerPageOptions:c,rowsPerPage:t,page:n-1,onPageChange:(e,t)=>{o(t+1)},onRowsPerPageChange:l?e=>{l(parseInt(e.target.value,10))}:void 0,labelRowsPerPage:a().translate("mui_table.rows_per_page"),sx:d})};p.propTypes={totalRows:s().number,perPage:s().number.isRequired,currentPage:s().number.isRequired,onPageChange:s().func.isRequired,onPerPageChange:s().func};const g=p},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")},6084:e=>{e.exports=require("@mui/icons-material/Delete")},9247:e=>{e.exports=require("@mui/icons-material/Edit")},6989:e=>{e.exports=require("@mui/material/Box")},6368:e=>{e.exports=require("@mui/material/Button")},909:e=>{e.exports=require("@mui/material/IconButton")},270:e=>{e.exports=require("@mui/material/Paper")},9292:e=>{e.exports=require("@mui/material/Table")},9008:e=>{e.exports=require("@mui/material/TableBody")},5684:e=>{e.exports=require("@mui/material/TableCell")},5783:e=>{e.exports=require("@mui/material/TableContainer")},8202:e=>{e.exports=require("@mui/material/TableHead")},464:e=>{e.exports=require("@mui/material/TableRow")},38:e=>{e.exports=require("@mui/material/TableSortLabel")},7633:e=>{e.exports=require("@mui/material/TextField")},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:()=>de});var o=n(2015),a=n.n(o),l=n(9825),i=n.n(l),c=n(6989),s=n.n(c),u=n(270),d=n.n(u),m=n(9292),p=n.n(m),g=n(9008),b=n.n(g),f=n(5684),y=n.n(f),h=n(5783),E=n.n(h),P=n(8202),w=n.n(P),v=n(464),x=n.n(v);const C=require("@mui/material/Checkbox");var O=n.n(C),R=n(6842),j=n.n(R),S=n(6368),q=n.n(S);const k=({editEnabled:e,hasSelection:t,onEdit:n,onApply:r,onCancel:o})=>a().createElement(s(),{sx:{display:"flex",gap:1,mb:2}},e?a().createElement(a().Fragment,null,a().createElement(q(),{variant:"contained",onClick:r},j().translate("bulk_edit_table.apply_changes")),a().createElement(q(),{variant:"outlined",onClick:o},j().translate("general.cancel"))):a().createElement(q(),{variant:"contained",onClick:n,disabled:!t},j().translate("bulk_edit_table.edit_selected")));k.propTypes={editEnabled:i().bool,hasSelection:i().bool,onEdit:i().func,onApply:i().func,onCancel:i().func};const T=k;var K=n(38),_=n.n(K),D=n(6831);const F=e=>{const{editEnabled:t,sortable:n,sortDir:r,onSort:o,columnIndex:l,columnKey:i,width:c,children:u}=e,d=c?{width:c,minWidth:c,maxWidth:c}:{};return!n||t?a().createElement(y(),{sx:d},u):a().createElement(y(),{sx:d},a().createElement(_(),{active:!!r,direction:-1===r?"desc":"asc",onClick:()=>{o&&n&&!t&&o(l,i,r?-1*r:1)}},u,r?a().createElement(s(),{component:"span",sx:D.visuallyHidden},-1===r?j().translate("bulk_edit_table.sorted_desc"):j().translate("bulk_edit_table.sorted_asc")):null))};F.propTypes={editEnabled:i().bool,onSort:i().func,sortDir:i().number,columnIndex:i().number,columnKey:i().oneOfType([i().string,i().number]),sortable:i().bool,width:i().oneOfType([i().string,i().number]),children:i().node};const M=F;var W=n(1116),A=n.n(W),z=n(909),$=n.n(z),H=n(9247),L=n.n(H),U=n(6084),B=n.n(U),I=n(7633),N=n.n(I);const J=({col:e,row:t,editRow:n,isEditingRow:r,onChange:o})=>{return r&&!0===e.editableField?a().createElement(N(),{id:e.columnKey,placeholder:e.placeholder||"Enter text...",multiline:!0,minRows:2,fullWidth:!0,size:"small",onChange:o,value:n[e.columnKey]??""}):r&&e.editableField?e.editableField({value:(null===(l=n[e.columnKey])||void 0===l?void 0:l.id)??(null===(i=n[e.columnKey])||void 0===i?void 0:i.value)??n[e.columnKey],onChange:t=>o({target:{value:t.target.value,id:e.columnKey}}),row:n,rowData:n[e.columnKey]})??null:e.render?e.render(t[e.columnKey],t)??null:a().createElement("span",{style:{fontWeight:"normal"}},t[e.columnKey]??null);var l,i};J.propTypes={col:i().object.isRequired,row:i().object.isRequired,editRow:i().object.isRequired,isEditingRow:i().bool,onChange:i().func};const G=J,X="Xhu4_LGKTq3e40qfe5Wt",Y="_0CBHbvjBDEYwSThSUofl",Z="UloruHeHpGPH5R7sq1kU",V="MSifStCaXi3PkMXSJE_n",Q="LmYr4a7JbDJJhz4VmZZk",ee="OpMx28gG4w8RWw4ugfTz";function te(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 ne(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach((function(t){A()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const re=e=>ne(ne({},e.width?{width:e.width,minWidth:e.width,maxWidth:e.width}:{}),e.customStyle),oe=e=>{const{row:t,columns:n,editEnabled:r,isSelected:o,editRow:l,onToggle:i,onFieldChange:c,actions:u,idKey:d}=e,m=o&&r,p=e=>{const{value:t,id:n}=e.target;c(n,t)};return a().createElement(x(),{role:"row",hover:!0},a().createElement(y(),{align:"center",className:Z,sx:{backgroundColor:"#fff"}},a().createElement(O(),{checked:o,onChange:i,slotProps:{input:{"aria-label":`Select row ${t[d]}`}}})),a().createElement(y(),{sx:{fontWeight:"normal"}},t[d]),n.filter((e=>e.columnKey!==d)).map((e=>a().createElement(y(),{key:`${t[d]}_${e.columnKey}`,className:m&&e.editableField?Q:Y,sx:{fontWeight:"normal"},style:re(e)},a().createElement(G,{col:e,row:t,editRow:l,isEditingRow:m,onChange:p})))),((null==u?void 0:u.edit)||(null==u?void 0:u.delete))&&a().createElement(y(),{align:"center",className:`${V} ${ee}`,sx:{backgroundColor:"#fff"}},a().createElement(s(),{sx:{display:"flex",justifyContent:"center",gap:1}},u.edit&&a().createElement($(),{size:"medium",onClick:()=>u.edit.onClick(t),sx:{padding:0},"aria-label":`Edit event ${t[d]}`},a().createElement(L(),{fontSize:"large"})),u.delete&&a().createElement($(),{size:"medium",onClick:()=>u.delete.onClick(t),sx:{padding:0},"aria-label":`Delete event ${t[d]}`},a().createElement(B(),{fontSize:"large"})))))};oe.propTypes={row:i().object.isRequired,columns:i().array.isRequired,editEnabled:i().bool,isSelected:i().bool,editRow:i().object.isRequired,onToggle:i().func,onFieldChange:i().func,actions:i().object,idKey:i().string},oe.defaultProps={idKey:"id"};const ae=oe;function le(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 ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?le(Object(n),!0).forEach((function(t){A()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):le(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const ce=(e="id")=>{const[t,n]=(0,o.useState)([]),[r,a]=(0,o.useState)(!1),l=n=>t.some((t=>t[e]===n)),i=()=>{n([]),a(!1)};return{selectedRows:t,isSelected:l,toggleRow:t=>{n((n=>n.some((n=>n[e]===t[e]))?n.filter((n=>n[e]!==t[e])):[...n,t]))},isAllSelected:t=>t.length>0&&t.every((t=>l(t[e]))),toggleAll:t=>{n((n=>t.length>0&&t.every((t=>n.some((n=>n[e]===t[e]))))?[]:t))},editField:(t,r,o)=>{n((n=>n.map((n=>n[e]===t?ie(ie({},n),{},{[r]:o}):n))))},editEnabled:r,enterEditMode:()=>a(!0),cancel:i,reset:i}};var se=n(5420);const ue=({options:e,columns:t,data:n,onSort:r,onUpdate:l,totalRows:i,perPage:c,currentPage:u,onPageChange:m,onPerPageChange:g,idKey:f})=>{var h,P;const{selectedRows:v,isSelected:C,toggleRow:R,isAllSelected:j,toggleAll:S,editField:q,editEnabled:k,enterEditMode:K,cancel:_,reset:D}=ce(f),F=n.map((e=>e[f])).join(",");(0,o.useEffect)((()=>{D()}),[F]);const W=t=>t===e.sortCol?e.sortDir:null;return a().createElement(s(),{sx:{width:"100%"}},a().createElement(T,{editEnabled:k,hasSelection:v.length>0,onEdit:K,onApply:e=>{e.stopPropagation(),e.preventDefault(),Promise.resolve(l(v)).then((()=>D())).catch((e=>{console.error("Error updating events:",e)}))},onCancel:_}),a().createElement(d(),{elevation:0,sx:{width:"100%",mb:2}},a().createElement(E(),{component:d(),className:X,sx:{borderRadius:0,boxShadow:"none"}},a().createElement(p(),null,a().createElement(w(),{sx:{backgroundColor:"#EAEDF4"}},a().createElement(x(),null,a().createElement(y(),{align:"center",className:Z,sx:{backgroundColor:"#EAEDF4"}},a().createElement(O(),{checked:j(n),onChange:()=>S(n),slotProps:{input:{"aria-label":"select all"}}})),t.map(((e,t)=>{const n=!!e.sortable,o=e.width??"";return a().createElement(M,{editEnabled:k,onSort:r,sortDir:W(e.columnKey),sortable:n,columnIndex:t,columnKey:e.columnKey,width:o,key:`heading_${e.columnKey}`},e.header??e.label??e.value)})),((null===(h=e.actions)||void 0===h?void 0:h.edit)||(null===(P=e.actions)||void 0===P?void 0:P.delete))&&a().createElement(y(),{align:"center",className:V,sx:{backgroundColor:"#EAEDF4"}},e.actionsHeader||" "))),a().createElement(b(),null,t.length>0&&n.map((n=>a().createElement(ae,{key:`row_${n[f]}`,row:n,idKey:f,editEnabled:k,isSelected:C(n[f]),editRow:v.find((e=>e[f]===n[f]))||n,onToggle:()=>R(n),onFieldChange:(e,t)=>q(n[f],e,t),columns:t,actions:e.actions})))))),c&&u&&m&&a().createElement(se.default,{totalRows:i,perPage:c,currentPage:u,onPageChange:m,onPerPageChange:g})))};ue.propTypes={options:i().object.isRequired,columns:i().array.isRequired,data:i().array.isRequired,onSort:i().func.isRequired,onUpdate:i().func.isRequired,idKey:i().string,totalRows:i().number,perPage:i().number,currentPage:i().number,onPageChange:i().func,onPerPageChange:i().func},ue.defaultProps={idKey:"id"};const de=ue;return r})()));
2
2
  //# sourceMappingURL=bulk-edit-table.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components/mui/bulk-edit-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,iGCTT,MAAM,EAA+BC,QAAQ,iC,0CCmB7C,MAAMC,EAAgB,CACpB,8BAA+B,CAC7BC,WAAY,WACZC,UAAW,UAEb,kCAAmC,CACjCC,MAAO,qBACPC,SAAU,OACVC,WAAY,UAEd,6BAA8B,CAC5BF,MAAO,qBACPC,SAAU,OACVC,WAAY,UAEd,6BAA8B,CAC5BC,QAAS,QAEX,oCAAqC,CACnCC,WAAY,SAIVC,EAAwB,CAACC,EAAAA,GAAkBC,EAAAA,GAAiBC,EAAAA,IAE5DC,EAAwBA,EAAGC,YAAWC,UAASC,cAAaC,eAAcC,sBAC9E,MAAMC,EAAiBC,EAAAA,OAAaL,GAEpC,IAAIM,EAAiBZ,EAAsBa,SAASH,EAAeI,SAC/Dd,EACA,IAAIA,EAAuBU,EAAeI,SAASC,MAAK,CAACC,EAAGC,IAAMD,EAAIC,IAErER,IACHG,EAAiB,CAACF,EAAeI,UAWnC,OACEH,EAAAA,cAACO,IAAe,CACdC,UAAU,MACVC,MAAOf,GA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AA,OACb5B,aAAc4B,IAAAA,KACd3B,gBAAiB2B,IAAAA,MAGnB,MC7JA,GD6JA,G","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TablePagination\"","webpack://openstack-uicore-foundation/./src/components/mui/table/CustomTablePagination.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/Delete\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Edit\"","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/IconButton\"","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/TableRow\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TableSortLabel\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TextField\"","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/external commonjs \"@mui/material/Checkbox\"","webpack://openstack-uicore-foundation/./src/components/mui/BulkEditTable/components/Toolbar.js","webpack://openstack-uicore-foundation/./src/components/mui/BulkEditTable/components/Heading.js","webpack://openstack-uicore-foundation/./src/components/mui/BulkEditTable/components/Cell.js","webpack://openstack-uicore-foundation/./src/components/mui/BulkEditTable/BulkEditTable.module.less?3db7","webpack://openstack-uicore-foundation/./src/components/mui/BulkEditTable/components/Row.js","webpack://openstack-uicore-foundation/./src/components/mui/BulkEditTable/hooks/useRowSelection.js","webpack://openstack-uicore-foundation/./src/components/mui/BulkEditTable/BulkEditTable.js","webpack://openstack-uicore-foundation/./src/components/mui/BulkEditTable/index.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/TablePagination\");","/**\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 TablePagination from \"@mui/material/TablePagination\";\nimport PropTypes from \"prop-types\";\nimport { DEFAULT_PER_PAGE, FIFTY_PER_PAGE, TWENTY_PER_PAGE } from \"../../../utils/constants\";\n\nconst PAGINATION_SX = {\n \".MuiTablePagination-toolbar\": {\n alignItems: \"baseline\",\n marginTop: \"1.6rem\"\n },\n \".MuiTablePagination-selectLabel\": {\n color: \"rgba(0, 0, 0, 0.6)\",\n fontSize: \"12px\",\n fontWeight: \"normal\"\n },\n \".MuiTablePagination-select\": {\n color: \"rgba(0, 0, 0, 0.6)\",\n fontSize: \"12px\",\n fontWeight: \"normal\"\n },\n \".MuiTablePagination-spacer\": {\n display: \"none\"\n },\n \".MuiTablePagination-displayedRows\": {\n marginLeft: \"auto\"\n }\n};\n\nconst BASE_PER_PAGE_OPTIONS = [DEFAULT_PER_PAGE, TWENTY_PER_PAGE, FIFTY_PER_PAGE];\n\nconst CustomTablePagination = ({ totalRows, perPage, currentPage, onPageChange, onPerPageChange }) => {\n const initialPerPage = React.useRef(perPage);\n\n let perPageOptions = BASE_PER_PAGE_OPTIONS.includes(initialPerPage.current)\n ? BASE_PER_PAGE_OPTIONS\n : [...BASE_PER_PAGE_OPTIONS, initialPerPage.current].sort((a, b) => a - b);\n\n if (!onPerPageChange) {\n perPageOptions = [initialPerPage.current];\n }\n\n const handlePageChange = (_, newPage) => {\n onPageChange(newPage + 1);\n };\n\n const handleRowsPerPageChange = (ev) => {\n onPerPageChange(ev.target.value);\n };\n\n return (\n <TablePagination\n component=\"div\"\n count={totalRows ?? 0}\n rowsPerPageOptions={perPageOptions}\n rowsPerPage={perPage}\n page={currentPage - 1}\n onPageChange={handlePageChange}\n onRowsPerPageChange={onPerPageChange ? handleRowsPerPageChange : undefined}\n labelRowsPerPage={T.translate(\"mui_table.rows_per_page\")}\n sx={PAGINATION_SX}\n />\n );\n};\n\nCustomTablePagination.propTypes = {\n totalRows: PropTypes.number,\n perPage: PropTypes.number.isRequired,\n currentPage: PropTypes.number.isRequired,\n onPageChange: PropTypes.func.isRequired,\n onPerPageChange: PropTypes.func\n};\n\nexport default CustomTablePagination;\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;\nexport const BPS = 100;\n\nexport const CODE_200 = 200;\n\nexport const DEBOUNCE_WAIT_250 = 250;\nexport const DEBOUNCE_WAIT = 500;\n\nexport const NOTIFICATION_TIMEOUT = 2000;\nexport const DEFAULT_PER_PAGE = 10;\nexport const TWENTY_PER_PAGE = 20;\nexport const FIFTY_PER_PAGE = 50;\nexport const MAX_PER_PAGE = 100;\n\nexport const INT_BASE = 10;\n\nexport const ONE_HUNDRED = 100;\nexport const MILLISECONDS_IN_SECOND = 1000;\n\nexport const MILLISECONDS_TO_SECONDS = 1000;\n\nexport const BYTES_PER_MB = 1_048_576; // 1024 * 1024\n\nexport const MAX_INVENTORY_IMAGE_UPLOAD_SIZE = 512000;\nexport const MAX_INVENTORY_IMAGES_UPLOAD_QTY = 5;\nexport const ALLOWED_INVENTORY_IMAGE_FORMATS = [\"jpg\", \"jpeg\", \"png\"];\n\nexport const METAFIELD_TYPES_WITH_OPTIONS = [\n \"CheckBoxList\",\n \"ComboBox\",\n \"RadioButtonList\"\n];\n\nexport const METAFIELD_TYPES = [\n \"CheckBox\",\n ...METAFIELD_TYPES_WITH_OPTIONS,\n \"Text\",\n \"TextArea\",\n \"Quantity\",\n \"DateTime\",\n \"Time\"\n];\n\nexport const DISCOUNT_TYPES = {\n AMOUNT: \"Amount\",\n RATE: \"Rate\"\n};\n\nexport const RATE_FIELDS = {\n EARLY_BIRD: \"early_bird_rate\",\n STANDARD: \"standard_rate\",\n ONSITE: \"onsite_rate\"\n};\n\nexport const DECIMAL_DIGITS = 2;\n\nexport const FILE_UPLOAD_STATUS = {\n PENDING: \"PENDING\",\n DEADLINE_ALERT: \"DEADLINE ALERT\",\n DEADLINE_MISSED: \"DEADLINE MISSED\",\n COMPLETE: \"COMPLETE\"\n};\n\nexport const FILE_UPLOAD_STATUS_COLOR = {\n [FILE_UPLOAD_STATUS.COMPLETE]: \"success.light\",\n [FILE_UPLOAD_STATUS.DEADLINE_MISSED]: \"error\",\n [FILE_UPLOAD_STATUS.DEADLINE_ALERT]: \"warning.light\",\n [FILE_UPLOAD_STATUS.PENDING]: \"default\"\n};\n\nexport const FILE_UPLOAD_STATUS_BKGR_COLOR = {\n [FILE_UPLOAD_STATUS.COMPLETE]: \"white\",\n [FILE_UPLOAD_STATUS.DEADLINE_MISSED]: \"#D32F2F0A\",\n [FILE_UPLOAD_STATUS.DEADLINE_ALERT]: \"#EF6C000A\",\n [FILE_UPLOAD_STATUS.PENDING]: \"white\"\n};\n\nexport const DATE_FORMAT = \"MM/DD/YYYY\";\nexport const DATETIME_FORMAT = \"MM/DD/YYYY hh:mm a\";\n\nexport const SPONSOR_FORMS_METAFIELD_CLASS = {\n FORM: \"Form\",\n ITEM: \"Item\"\n};\n\nexport const SPONSOR_ORDER_GRID_ITEM_TYPES = {\n CHARGE: \"Charge\",\n PAYMENT: \"Payment\",\n REFUND: \"Refund\",\n DISCOUNT: \"Discount\",\n CANCELLED: \"Cancelled\"\n};","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@mui/icons-material/Delete\");","module.exports = require(\"@mui/icons-material/Edit\");","module.exports = require(\"@mui/material/Box\");","module.exports = require(\"@mui/material/Button\");","module.exports = require(\"@mui/material/IconButton\");","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/TableRow\");","module.exports = require(\"@mui/material/TableSortLabel\");","module.exports = require(\"@mui/material/TextField\");","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};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/Checkbox\");","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\n\nconst Toolbar = ({ editEnabled, hasSelection, onEdit, onApply, onCancel }) => (\n <Box sx={{ display: \"flex\", gap: 1, mb: 2 }}>\n {editEnabled ? (\n <>\n <Button variant=\"contained\" onClick={onApply}>\n {T.translate(\"bulk_actions_page.btn_apply_changes\")}\n </Button>\n <Button variant=\"outlined\" onClick={onCancel}>\n {T.translate(\"general.cancel\")}\n </Button>\n </>\n ) : (\n <Button variant=\"contained\" onClick={onEdit} disabled={!hasSelection}>\n {T.translate(\"event_list.edit_selected\")}\n </Button>\n )}\n </Box>\n);\n\nToolbar.propTypes = {\n editEnabled: PropTypes.bool,\n hasSelection: PropTypes.bool,\n onEdit: PropTypes.func,\n onApply: PropTypes.func,\n onCancel: PropTypes.func\n};\n\nexport default Toolbar;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport Box from \"@mui/material/Box\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableSortLabel from \"@mui/material/TableSortLabel\";\nimport { visuallyHidden } from \"@mui/utils\";\n\nconst Heading = (props) => {\n const {\n editEnabled,\n sortable,\n sortDir,\n onSort,\n columnIndex,\n columnKey,\n width,\n children\n } = props;\n\n const handleSort = () => {\n if (!onSort || !sortable || editEnabled) return;\n\n onSort(columnIndex, columnKey, sortDir ? sortDir * -1 : 1);\n };\n\n const headerSx = width ? { width, minWidth: width, maxWidth: width } : {};\n\n if (!sortable || editEnabled) {\n return <TableCell sx={headerSx}>{children}</TableCell>;\n }\n\n return (\n <TableCell sx={headerSx}>\n <TableSortLabel\n active={!!sortDir}\n direction={sortDir === -1 ? \"desc\" : \"asc\"}\n onClick={handleSort}\n >\n {children}\n {sortDir ? (\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 </TableCell>\n );\n};\n\nHeading.propTypes = {\n editEnabled: PropTypes.bool,\n onSort: PropTypes.func,\n sortDir: PropTypes.number,\n columnIndex: PropTypes.number,\n columnKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n sortable: PropTypes.bool,\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n children: PropTypes.node\n};\n\nexport default Heading;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport TextField from \"@mui/material/TextField\";\n\nconst DEFAULT_PLACEHOLDER = \"Enter text...\";\n\nconst Cell = ({ col, row, editRow, isEditingRow, onChange }) => {\n if (isEditingRow && col.editableField === true) {\n return (\n <TextField\n id={col.columnKey}\n placeholder={col.placeholder || DEFAULT_PLACEHOLDER}\n multiline\n minRows={2}\n fullWidth\n size=\"small\"\n onChange={onChange}\n value={editRow[col.columnKey] || \"\"}\n />\n );\n }\n\n if (isEditingRow && col.editableField) {\n // editableField functions may short-circuit (e.g. `cond && <Input />`) and\n // return `undefined` rather than `false`, which React rejects as a component return value.\n return (\n col.editableField({\n value:\n editRow[col.columnKey]?.id ??\n editRow[col.columnKey]?.value ??\n editRow[col.columnKey],\n onChange,\n row: editRow,\n rowData: editRow[col.columnKey]\n }) ?? null\n );\n }\n\n if (col.render) {\n return col.render(row[col.columnKey], row) ?? null;\n }\n\n return (\n <span style={{ fontWeight: \"normal\" }}>{row[col.columnKey] ?? null}</span>\n );\n};\n\nCell.propTypes = {\n col: PropTypes.object.isRequired,\n row: PropTypes.object.isRequired,\n editRow: PropTypes.object.isRequired,\n isEditingRow: PropTypes.bool,\n onChange: PropTypes.func\n};\n\nexport default Cell;\n","// extracted by mini-css-extract-plugin\nexport default {\"tableWrapper\":\"Xhu4_LGKTq3e40qfe5Wt\",\"dataColumn\":\"_0CBHbvjBDEYwSThSUofl\",\"checkColumn\":\"UloruHeHpGPH5R7sq1kU\",\"actionColumn\":\"MSifStCaXi3PkMXSJE_n\",\"bulkEditCol\":\"LmYr4a7JbDJJhz4VmZZk\",\"dottedBorderLeft\":\"OpMx28gG4w8RWw4ugfTz\"};","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport Box from \"@mui/material/Box\";\nimport TableRow from \"@mui/material/TableRow\";\nimport TableCell from \"@mui/material/TableCell\";\nimport Checkbox from \"@mui/material/Checkbox\";\nimport IconButton from \"@mui/material/IconButton\";\nimport EditIcon from \"@mui/icons-material/Edit\";\nimport DeleteIcon from \"@mui/icons-material/Delete\";\nimport Cell from \"./Cell\";\nimport styles from \"../BulkEditTable.module.less\";\n\n// the 250px min-width while editing comes from the .bulkEditCol class\n// (applied via className below) so it isn't duplicated here\nconst getCellStyle = (col) => ({\n ...(col.width\n ? { width: col.width, minWidth: col.width, maxWidth: col.width }\n : {}),\n ...col.customStyle\n});\n\nconst Row = (props) => {\n const {\n row,\n columns,\n editEnabled,\n isSelected,\n editRow,\n onToggle,\n onFieldChange,\n actions\n } = props;\n\n const isEditingRow = isSelected && editEnabled;\n\n const onRowChange = (ev) => {\n const { value, id } = ev.target;\n onFieldChange(id, value);\n };\n\n return (\n <TableRow role=\"row\" hover>\n <TableCell\n align=\"center\"\n className={styles.checkColumn}\n sx={{ backgroundColor: \"#fff\" }}\n >\n <Checkbox\n checked={isSelected}\n onChange={onToggle}\n slotProps={{ input: { \"aria-label\": `Select row ${row.id}` } }}\n />\n </TableCell>\n <TableCell sx={{ fontWeight: \"normal\" }}>{row.id}</TableCell>\n {columns\n .filter((col) => col.columnKey !== \"id\")\n .map((col) => (\n <TableCell\n key={`${row.id}_${col.columnKey}`}\n className={\n isEditingRow && col.editableField\n ? styles.bulkEditCol\n : styles.dataColumn\n }\n sx={{ fontWeight: \"normal\" }}\n style={getCellStyle(col)}\n >\n <Cell\n col={col}\n row={row}\n editRow={editRow}\n isEditingRow={isEditingRow}\n onChange={onRowChange}\n />\n </TableCell>\n ))}\n {(actions?.edit || actions?.delete) && (\n <TableCell\n align=\"center\"\n className={`${styles.actionColumn} ${styles.dottedBorderLeft}`}\n sx={{ backgroundColor: \"#fff\" }}\n >\n <Box sx={{ display: \"flex\", justifyContent: \"center\", gap: 1 }}>\n {actions.edit && (\n <IconButton\n size=\"medium\"\n onClick={() => actions.edit.onClick(row)}\n sx={{ padding: 0 }}\n aria-label={`Edit event ${row.id}`}\n >\n <EditIcon fontSize=\"large\" />\n </IconButton>\n )}\n {actions.delete && (\n <IconButton\n size=\"medium\"\n onClick={() => actions.delete.onClick(row)}\n sx={{ padding: 0 }}\n aria-label={`Delete event ${row.id}`}\n >\n <DeleteIcon fontSize=\"large\" />\n </IconButton>\n )}\n </Box>\n </TableCell>\n )}\n </TableRow>\n );\n};\n\nRow.propTypes = {\n row: PropTypes.object.isRequired,\n columns: PropTypes.array.isRequired,\n editEnabled: PropTypes.bool,\n isSelected: PropTypes.bool,\n editRow: PropTypes.object.isRequired,\n onToggle: PropTypes.func,\n onFieldChange: PropTypes.func,\n actions: PropTypes.object\n};\n\nexport default Row;\n","import { useState } from \"react\";\n\nconst useRowSelection = () => {\n const [selectedRows, setSelectedRows] = useState([]);\n const [editEnabled, setEditEnabled] = useState(false);\n\n const isSelected = (rowId) => selectedRows.some((row) => row.id === rowId);\n\n const toggleRow = (row) => {\n setSelectedRows((current) =>\n isSelected(row.id)\n ? current.filter((r) => r.id !== row.id)\n : [...current, row]\n );\n };\n\n const isAllSelected = (rows) =>\n rows.length > 0 && rows.every((row) => isSelected(row.id));\n\n const toggleAll = (rows) => {\n setSelectedRows(isAllSelected(rows) ? [] : rows);\n };\n\n const editField = (rowId, key, value) => {\n setSelectedRows((current) =>\n current.map((row) => (row.id === rowId ? { ...row, [key]: value } : row))\n );\n };\n\n const reset = () => {\n setSelectedRows([]);\n setEditEnabled(false);\n };\n\n return {\n selectedRows,\n isSelected,\n toggleRow,\n isAllSelected,\n toggleAll,\n editField,\n editEnabled,\n enterEditMode: () => setEditEnabled(true),\n cancel: reset,\n reset\n };\n};\n\nexport default useRowSelection;\n","import React, { useEffect } from \"react\";\nimport PropTypes from \"prop-types\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\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 TableRow from \"@mui/material/TableRow\";\nimport Checkbox from \"@mui/material/Checkbox\";\nimport Toolbar from \"./components/Toolbar\";\nimport Heading from \"./components/Heading\";\nimport Row from \"./components/Row\";\nimport useRowSelection from \"./hooks/useRowSelection\";\nimport styles from \"./BulkEditTable.module.less\";\nimport CustomTablePagination from \"../table/CustomTablePagination\";\n\nconst BulkEditTable = ({ options, columns, data, onSort, onUpdate, totalRows, perPage, currentPage, onPageChange, onPerPageChange }) => {\n const {\n selectedRows,\n isSelected,\n toggleRow,\n isAllSelected,\n toggleAll,\n editField,\n editEnabled,\n enterEditMode,\n cancel,\n reset\n } = useRowSelection();\n\n const dataIds = data.map((row) => row.id).join(\",\");\n\n // reset selection/edit state whenever the set of rows shown changes\n // (pagination, filtering, sorting, search, etc.)\n useEffect(() => {\n reset();\n }, [dataIds]);\n\n const getSortDir = (columnKey) =>\n columnKey === options.sortCol ? options.sortDir : null;\n\n const handleUpdateEvents = (evt) => {\n evt.stopPropagation();\n evt.preventDefault();\n onUpdate(selectedRows)\n .then(() => reset())\n .catch((error) => {\n console.error(\"Error updating events:\", error);\n });\n };\n\n return (\n <Box sx={{ width: \"100%\" }}>\n <Toolbar\n editEnabled={editEnabled}\n hasSelection={selectedRows.length > 0}\n onEdit={enterEditMode}\n onApply={handleUpdateEvents}\n onCancel={cancel}\n />\n <Paper elevation={0} sx={{ width: \"100%\", mb: 2 }}>\n <TableContainer\n component={Paper}\n className={styles.tableWrapper}\n sx={{ borderRadius: 0, boxShadow: \"none\" }}\n >\n <Table>\n <TableHead sx={{ backgroundColor: \"#EAEDF4\" }}>\n <TableRow>\n <TableCell\n align=\"center\"\n className={styles.checkColumn}\n sx={{ backgroundColor: \"#EAEDF4\" }}\n >\n <Checkbox\n checked={isAllSelected(data)}\n onChange={() => toggleAll(data)}\n slotProps={{ input: { \"aria-label\": \"select all\" } }}\n />\n </TableCell>\n {columns.map((col, i) => {\n const sortable = !!col.sortable;\n const colWidth = col.width ?? \"\";\n\n return (\n <Heading\n editEnabled={editEnabled}\n onSort={onSort}\n sortDir={getSortDir(col.columnKey)}\n sortable={sortable}\n columnIndex={i}\n columnKey={col.columnKey}\n width={colWidth}\n key={`heading_${col.columnKey}`}\n >\n {col.label}\n </Heading>\n );\n })}\n {options.actions && (\n <TableCell\n align=\"center\"\n className={styles.actionColumn}\n sx={{ backgroundColor: \"#EAEDF4\" }}\n >\n {options.actionsHeader || \" \"}\n </TableCell>\n )}\n </TableRow>\n </TableHead>\n <TableBody>\n {columns.length > 0 &&\n data.map((row) => (\n <Row\n key={`row_${row.id}`}\n row={row}\n editEnabled={editEnabled}\n isSelected={isSelected(row.id)}\n editRow={selectedRows.find((r) => r.id === row.id) || row}\n onToggle={() => toggleRow(row)}\n onFieldChange={(key, value) =>\n editField(row.id, key, value)\n }\n columns={columns}\n actions={options.actions}\n />\n ))}\n </TableBody>\n </Table>\n </TableContainer>\n {perPage && currentPage && onPageChange && (\n <CustomTablePagination\n totalRows={totalRows}\n perPage={perPage}\n currentPage={currentPage}\n onPageChange={onPageChange}\n onPerPageChange={onPerPageChange}\n />\n )}\n </Paper>\n </Box>\n );\n};\n\nBulkEditTable.propTypes = {\n options: PropTypes.object.isRequired,\n columns: PropTypes.array.isRequired,\n data: PropTypes.array.isRequired,\n onSort: PropTypes.func.isRequired,\n onUpdate: PropTypes.func.isRequired,\n totalRows: PropTypes.number,\n perPage: PropTypes.number,\n currentPage: PropTypes.number,\n onPageChange: PropTypes.func,\n onPerPageChange: PropTypes.func\n};\n\nexport default BulkEditTable;\n","import BulkEditTable from \"./BulkEditTable\";\n\nexport default BulkEditTable;\n"],"names":["root","factory","exports","module","define","amd","this","require","PAGINATION_SX","alignItems","marginTop","color","fontSize","fontWeight","display","marginLeft","BASE_PER_PAGE_OPTIONS","DEFAULT_PER_PAGE","TWENTY_PER_PAGE","FIFTY_PER_PAGE","CustomTablePagination","totalRows","perPage","currentPage","onPageChange","onPerPageChange","initialPerPage","React","perPageOptions","includes","current","sort","a","b","TablePagination","component","count","rowsPerPageOptions","rowsPerPage","page","handlePageChange","_","newPage","onRowsPerPageChange","ev","target","value","undefined","labelRowsPerPage","T","sx","propTypes","PropTypes","isRequired","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","Toolbar","editEnabled","hasSelection","onEdit","onApply","onCancel","Box","gap","mb","Button","variant","onClick","disabled","Heading","props","sortable","sortDir","onSort","columnIndex","columnKey","width","children","headerSx","minWidth","maxWidth","TableCell","TableSortLabel","active","direction","handleSort","visuallyHidden","Cell","col","row","editRow","isEditingRow","onChange","editableField","TextField","id","placeholder","multiline","minRows","fullWidth","size","_editRow$col$columnKe","_editRow$col$columnKe2","rowData","render","style","getCellStyle","_objectSpread","customStyle","Row","columns","isSelected","onToggle","onFieldChange","actions","onRowChange","TableRow","role","hover","align","className","styles","backgroundColor","Checkbox","checked","slotProps","input","filter","map","edit","delete","justifyContent","IconButton","padding","EditIcon","DeleteIcon","useRowSelection","selectedRows","setSelectedRows","useState","setEditEnabled","rowId","some","isAllSelected","rows","length","every","reset","toggleRow","toggleAll","editField","enterEditMode","cancel","BulkEditTable","options","data","onUpdate","dataIds","join","useEffect","getSortDir","sortCol","evt","stopPropagation","preventDefault","then","catch","error","console","Paper","elevation","TableContainer","borderRadius","boxShadow","Table","TableHead","i","colWidth","label","actionsHeader","TableBody","find"],"sourceRoot":""}
1
+ {"version":3,"file":"components/mui/bulk-edit-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,iGCTT,MAAM,EAA+BC,QAAQ,iC,0CCmB7C,MAAMC,EAAgB,CACpB,8BAA+B,CAC7BC,WAAY,WACZC,UAAW,UAEb,kCAAmC,CACjCC,MAAO,qBACPC,SAAU,OACVC,WAAY,UAEd,6BAA8B,CAC5BF,MAAO,qBACPC,SAA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B,EAAIJ,EAAQ3C,eAAO,IAAA+C,OAAA,EAAfA,EAAiB9B,UAC1C7H,IAAAA,cAAC2E,IAAS,CACRuC,MAAM,SACNC,UAAWC,EACX9F,GAAI,CAAE+F,gBAAiB,YAEtBkC,EAAQ8B,eAAiB,OAKlCrL,IAAAA,cAACsL,IAAS,KACP9E,EAAQwC,OAAS,GAChBQ,EAAK7B,KAAKxC,GACRnF,IAAAA,cAACuG,GAAG,CACFnE,IAAK,OAAO+C,EAAI0B,KAChB1B,IAAKA,EACL0B,MAAOA,EACP1D,YAAaA,EACbsD,WAAYA,EAAWtB,EAAI0B,IAC3BzB,QAASiD,EAAakD,MAAMxI,GAAMA,EAAE8D,KAAW1B,EAAI0B,MAAW1B,EAC9DuB,SAAUA,IAAMkC,EAAUzD,GAC1BwB,cAAeA,CAACvE,EAAKlB,IACnBiI,EAAUhE,EAAI0B,GAAQzE,EAAKlB,GAE7BsF,QAASA,EACTI,QAAS2C,EAAQ3C,eAM5BjH,GAAWC,GAAeC,GACzBG,IAAAA,cAACP,GAAAA,QAAqB,CACpBC,UAAWA,EACXC,QAASA,EACTC,YAAaA,EACbC,aAAcA,EACdC,gBAAiBA,KAInB,EAIVwJ,GAAc/H,UAAY,CACxBgI,QAAS/H,IAAAA,OAAiBC,WAC1B+E,QAAShF,IAAAA,MAAgBC,WACzB+H,KAAMhI,IAAAA,MAAgBC,WACtB0C,OAAQ3C,IAAAA,KAAeC,WACvBgI,SAAUjI,IAAAA,KAAeC,WACzBoF,MAAOrF,IAAAA,OACP9B,UAAW8B,IAAAA,OACX7B,QAAS6B,IAAAA,OACT5B,YAAa4B,IAAAA,OACb3B,aAAc2B,IAAAA,KACd1B,gBAAiB0B,IAAAA,MAGnB8H,GAAcnB,aAAe,CAC3BtB,MAAO,MAGT,MCnKA,GDmKA,G","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TablePagination\"","webpack://openstack-uicore-foundation/./src/components/mui/table/CustomTablePagination.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/Delete\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/icons-material/Edit\"","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/IconButton\"","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/TableRow\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TableSortLabel\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TextField\"","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/external commonjs \"@mui/material/Checkbox\"","webpack://openstack-uicore-foundation/./src/components/mui/BulkEditTable/components/Toolbar.js","webpack://openstack-uicore-foundation/./src/components/mui/BulkEditTable/components/Heading.js","webpack://openstack-uicore-foundation/./src/components/mui/BulkEditTable/components/Cell.js","webpack://openstack-uicore-foundation/./src/components/mui/BulkEditTable/BulkEditTable.module.less?3db7","webpack://openstack-uicore-foundation/./src/components/mui/BulkEditTable/components/Row.js","webpack://openstack-uicore-foundation/./src/components/mui/BulkEditTable/hooks/useRowSelection.js","webpack://openstack-uicore-foundation/./src/components/mui/BulkEditTable/BulkEditTable.js","webpack://openstack-uicore-foundation/./src/components/mui/BulkEditTable/index.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/TablePagination\");","/**\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 TablePagination from \"@mui/material/TablePagination\";\nimport PropTypes from \"prop-types\";\nimport { DEFAULT_PER_PAGE, FIFTY_PER_PAGE, TWENTY_PER_PAGE } from \"../../../utils/constants\";\n\nconst PAGINATION_SX = {\n \".MuiTablePagination-toolbar\": {\n alignItems: \"baseline\",\n marginTop: \"1.6rem\"\n },\n \".MuiTablePagination-selectLabel\": {\n color: \"rgba(0, 0, 0, 0.6)\",\n fontSize: \"12px\",\n fontWeight: \"normal\"\n },\n \".MuiTablePagination-select\": {\n color: \"rgba(0, 0, 0, 0.6)\",\n fontSize: \"12px\",\n fontWeight: \"normal\"\n },\n \".MuiTablePagination-spacer\": {\n display: \"none\"\n },\n \".MuiTablePagination-displayedRows\": {\n marginLeft: \"auto\"\n }\n};\n\nconst BASE_PER_PAGE_OPTIONS = [DEFAULT_PER_PAGE, TWENTY_PER_PAGE, FIFTY_PER_PAGE];\n\nconst CustomTablePagination = ({ totalRows, perPage, currentPage, onPageChange, onPerPageChange }) => {\n const perPageOptions = React.useMemo(() => {\n if (!onPerPageChange) return [perPage];\n return BASE_PER_PAGE_OPTIONS.includes(perPage)\n ? BASE_PER_PAGE_OPTIONS\n : [...BASE_PER_PAGE_OPTIONS, perPage].sort((a, b) => a - b);\n }, [perPage, onPerPageChange]);\n\n const handlePageChange = (_, newPage) => {\n onPageChange(newPage + 1);\n };\n\n const handleRowsPerPageChange = (ev) => {\n onPerPageChange(parseInt(ev.target.value, 10));\n };\n\n return (\n <TablePagination\n component=\"div\"\n count={totalRows ?? 0}\n rowsPerPageOptions={perPageOptions}\n rowsPerPage={perPage}\n page={currentPage - 1}\n onPageChange={handlePageChange}\n onRowsPerPageChange={onPerPageChange ? handleRowsPerPageChange : undefined}\n labelRowsPerPage={T.translate(\"mui_table.rows_per_page\")}\n sx={PAGINATION_SX}\n />\n );\n};\n\nCustomTablePagination.propTypes = {\n totalRows: PropTypes.number,\n perPage: PropTypes.number.isRequired,\n currentPage: PropTypes.number.isRequired,\n onPageChange: PropTypes.func.isRequired,\n onPerPageChange: PropTypes.func\n};\n\nexport default CustomTablePagination;\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;\nexport const BPS = 100;\n\nexport const CODE_200 = 200;\n\nexport const DEBOUNCE_WAIT_250 = 250;\nexport const DEBOUNCE_WAIT = 500;\n\nexport const NOTIFICATION_TIMEOUT = 2000;\nexport const DEFAULT_PER_PAGE = 10;\nexport const TWENTY_PER_PAGE = 20;\nexport const FIFTY_PER_PAGE = 50;\nexport const MAX_PER_PAGE = 100;\n\nexport const INT_BASE = 10;\n\nexport const ONE_HUNDRED = 100;\nexport const MILLISECONDS_IN_SECOND = 1000;\n\nexport const MILLISECONDS_TO_SECONDS = 1000;\n\nexport const BYTES_PER_MB = 1_048_576; // 1024 * 1024\n\nexport const MAX_INVENTORY_IMAGE_UPLOAD_SIZE = 512000;\nexport const MAX_INVENTORY_IMAGES_UPLOAD_QTY = 5;\nexport const ALLOWED_INVENTORY_IMAGE_FORMATS = [\"jpg\", \"jpeg\", \"png\"];\n\nexport const METAFIELD_TYPES_WITH_OPTIONS = [\n \"CheckBoxList\",\n \"ComboBox\",\n \"RadioButtonList\"\n];\n\nexport const METAFIELD_TYPES = [\n \"CheckBox\",\n ...METAFIELD_TYPES_WITH_OPTIONS,\n \"Text\",\n \"TextArea\",\n \"Quantity\",\n \"DateTime\",\n \"Time\"\n];\n\nexport const DISCOUNT_TYPES = {\n AMOUNT: \"Amount\",\n RATE: \"Rate\"\n};\n\nexport const RATE_FIELDS = {\n EARLY_BIRD: \"early_bird_rate\",\n STANDARD: \"standard_rate\",\n ONSITE: \"onsite_rate\"\n};\n\nexport const DECIMAL_DIGITS = 2;\n\nexport const FILE_UPLOAD_STATUS = {\n PENDING: \"PENDING\",\n DEADLINE_ALERT: \"DEADLINE ALERT\",\n DEADLINE_MISSED: \"DEADLINE MISSED\",\n COMPLETE: \"COMPLETE\"\n};\n\nexport const FILE_UPLOAD_STATUS_COLOR = {\n [FILE_UPLOAD_STATUS.COMPLETE]: \"success.light\",\n [FILE_UPLOAD_STATUS.DEADLINE_MISSED]: \"error\",\n [FILE_UPLOAD_STATUS.DEADLINE_ALERT]: \"warning.light\",\n [FILE_UPLOAD_STATUS.PENDING]: \"default\"\n};\n\nexport const FILE_UPLOAD_STATUS_BKGR_COLOR = {\n [FILE_UPLOAD_STATUS.COMPLETE]: \"white\",\n [FILE_UPLOAD_STATUS.DEADLINE_MISSED]: \"#D32F2F0A\",\n [FILE_UPLOAD_STATUS.DEADLINE_ALERT]: \"#EF6C000A\",\n [FILE_UPLOAD_STATUS.PENDING]: \"white\"\n};\n\nexport const DATE_FORMAT = \"MM/DD/YYYY\";\nexport const DATETIME_FORMAT = \"MM/DD/YYYY hh:mm a\";\n\nexport const SPONSOR_FORMS_METAFIELD_CLASS = {\n FORM: \"Form\",\n ITEM: \"Item\"\n};\n\nexport const SPONSOR_ORDER_GRID_ITEM_TYPES = {\n CHARGE: \"Charge\",\n PAYMENT: \"Payment\",\n REFUND: \"Refund\",\n DISCOUNT: \"Discount\",\n CANCELLED: \"Cancelled\"\n};","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@mui/icons-material/Delete\");","module.exports = require(\"@mui/icons-material/Edit\");","module.exports = require(\"@mui/material/Box\");","module.exports = require(\"@mui/material/Button\");","module.exports = require(\"@mui/material/IconButton\");","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/TableRow\");","module.exports = require(\"@mui/material/TableSortLabel\");","module.exports = require(\"@mui/material/TextField\");","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};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/Checkbox\");","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\n\nconst Toolbar = ({ editEnabled, hasSelection, onEdit, onApply, onCancel }) => (\n <Box sx={{ display: \"flex\", gap: 1, mb: 2 }}>\n {editEnabled ? (\n <>\n <Button variant=\"contained\" onClick={onApply}>\n {T.translate(\"bulk_edit_table.apply_changes\")}\n </Button>\n <Button variant=\"outlined\" onClick={onCancel}>\n {T.translate(\"general.cancel\")}\n </Button>\n </>\n ) : (\n <Button variant=\"contained\" onClick={onEdit} disabled={!hasSelection}>\n {T.translate(\"bulk_edit_table.edit_selected\")}\n </Button>\n )}\n </Box>\n);\n\nToolbar.propTypes = {\n editEnabled: PropTypes.bool,\n hasSelection: PropTypes.bool,\n onEdit: PropTypes.func,\n onApply: PropTypes.func,\n onCancel: PropTypes.func\n};\n\nexport default Toolbar;\n","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport Box from \"@mui/material/Box\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableSortLabel from \"@mui/material/TableSortLabel\";\nimport { visuallyHidden } from \"@mui/utils\";\n\nconst Heading = (props) => {\n const {\n editEnabled,\n sortable,\n sortDir,\n onSort,\n columnIndex,\n columnKey,\n width,\n children\n } = props;\n\n const handleSort = () => {\n if (!onSort || !sortable || editEnabled) return;\n\n onSort(columnIndex, columnKey, sortDir ? sortDir * -1 : 1);\n };\n\n const headerSx = width ? { width, minWidth: width, maxWidth: width } : {};\n\n if (!sortable || editEnabled) {\n return <TableCell sx={headerSx}>{children}</TableCell>;\n }\n\n return (\n <TableCell sx={headerSx}>\n <TableSortLabel\n active={!!sortDir}\n direction={sortDir === -1 ? \"desc\" : \"asc\"}\n onClick={handleSort}\n >\n {children}\n {sortDir ? (\n <Box component=\"span\" sx={visuallyHidden}>\n {sortDir === -1\n ? T.translate(\"bulk_edit_table.sorted_desc\")\n : T.translate(\"bulk_edit_table.sorted_asc\")}\n </Box>\n ) : null}\n </TableSortLabel>\n </TableCell>\n );\n};\n\nHeading.propTypes = {\n editEnabled: PropTypes.bool,\n onSort: PropTypes.func,\n sortDir: PropTypes.number,\n columnIndex: PropTypes.number,\n columnKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n sortable: PropTypes.bool,\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n children: PropTypes.node\n};\n\nexport default Heading;\n","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport TextField from \"@mui/material/TextField\";\n\nconst DEFAULT_PLACEHOLDER = \"Enter text...\";\n\nconst Cell = ({ col, row, editRow, isEditingRow, onChange }) => {\n if (isEditingRow && col.editableField === true) {\n return (\n <TextField\n id={col.columnKey}\n placeholder={col.placeholder || DEFAULT_PLACEHOLDER}\n multiline\n minRows={2}\n fullWidth\n size=\"small\"\n onChange={onChange}\n value={editRow[col.columnKey] ?? \"\"}\n />\n );\n }\n\n if (isEditingRow && col.editableField) {\n // editableField functions may short-circuit (e.g. `cond && <Input />`) and\n // return `undefined` rather than `false`, which React rejects as a component return value.\n return (\n col.editableField({\n value:\n editRow[col.columnKey]?.id ??\n editRow[col.columnKey]?.value ??\n editRow[col.columnKey],\n onChange: (ev) => onChange({ target: { value: ev.target.value, id: col.columnKey } }),\n row: editRow,\n rowData: editRow[col.columnKey]\n }) ?? null\n );\n }\n\n if (col.render) {\n return col.render(row[col.columnKey], row) ?? null;\n }\n\n return (\n <span style={{ fontWeight: \"normal\" }}>{row[col.columnKey] ?? null}</span>\n );\n};\n\nCell.propTypes = {\n col: PropTypes.object.isRequired,\n row: PropTypes.object.isRequired,\n editRow: PropTypes.object.isRequired,\n isEditingRow: PropTypes.bool,\n onChange: PropTypes.func\n};\n\nexport default Cell;\n","// extracted by mini-css-extract-plugin\nexport default {\"tableWrapper\":\"Xhu4_LGKTq3e40qfe5Wt\",\"dataColumn\":\"_0CBHbvjBDEYwSThSUofl\",\"checkColumn\":\"UloruHeHpGPH5R7sq1kU\",\"actionColumn\":\"MSifStCaXi3PkMXSJE_n\",\"bulkEditCol\":\"LmYr4a7JbDJJhz4VmZZk\",\"dottedBorderLeft\":\"OpMx28gG4w8RWw4ugfTz\"};","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport Box from \"@mui/material/Box\";\nimport TableRow from \"@mui/material/TableRow\";\nimport TableCell from \"@mui/material/TableCell\";\nimport Checkbox from \"@mui/material/Checkbox\";\nimport IconButton from \"@mui/material/IconButton\";\nimport EditIcon from \"@mui/icons-material/Edit\";\nimport DeleteIcon from \"@mui/icons-material/Delete\";\nimport Cell from \"./Cell\";\nimport styles from \"../BulkEditTable.module.less\";\n\n// the 250px min-width while editing comes from the .bulkEditCol class\n// (applied via className below) so it isn't duplicated here\nconst getCellStyle = (col) => ({\n ...(col.width\n ? { width: col.width, minWidth: col.width, maxWidth: col.width }\n : {}),\n ...col.customStyle\n});\n\nconst Row = (props) => {\n const {\n row,\n columns,\n editEnabled,\n isSelected,\n editRow,\n onToggle,\n onFieldChange,\n actions,\n idKey\n } = props;\n\n const isEditingRow = isSelected && editEnabled;\n\n const onRowChange = (ev) => {\n const { value, id } = ev.target;\n onFieldChange(id, value);\n };\n\n return (\n <TableRow role=\"row\" hover>\n <TableCell\n align=\"center\"\n className={styles.checkColumn}\n sx={{ backgroundColor: \"#fff\" }}\n >\n <Checkbox\n checked={isSelected}\n onChange={onToggle}\n slotProps={{ input: { \"aria-label\": `Select row ${row[idKey]}` } }}\n />\n </TableCell>\n <TableCell sx={{ fontWeight: \"normal\" }}>{row[idKey]}</TableCell>\n {columns\n .filter((col) => col.columnKey !== idKey)\n .map((col) => (\n <TableCell\n key={`${row[idKey]}_${col.columnKey}`}\n className={\n isEditingRow && col.editableField\n ? styles.bulkEditCol\n : styles.dataColumn\n }\n sx={{ fontWeight: \"normal\" }}\n style={getCellStyle(col)}\n >\n <Cell\n col={col}\n row={row}\n editRow={editRow}\n isEditingRow={isEditingRow}\n onChange={onRowChange}\n />\n </TableCell>\n ))}\n {(actions?.edit || actions?.delete) && (\n <TableCell\n align=\"center\"\n className={`${styles.actionColumn} ${styles.dottedBorderLeft}`}\n sx={{ backgroundColor: \"#fff\" }}\n >\n <Box sx={{ display: \"flex\", justifyContent: \"center\", gap: 1 }}>\n {actions.edit && (\n <IconButton\n size=\"medium\"\n onClick={() => actions.edit.onClick(row)}\n sx={{ padding: 0 }}\n aria-label={`Edit event ${row[idKey]}`}\n >\n <EditIcon fontSize=\"large\" />\n </IconButton>\n )}\n {actions.delete && (\n <IconButton\n size=\"medium\"\n onClick={() => actions.delete.onClick(row)}\n sx={{ padding: 0 }}\n aria-label={`Delete event ${row[idKey]}`}\n >\n <DeleteIcon fontSize=\"large\" />\n </IconButton>\n )}\n </Box>\n </TableCell>\n )}\n </TableRow>\n );\n};\n\nRow.propTypes = {\n row: PropTypes.object.isRequired,\n columns: PropTypes.array.isRequired,\n editEnabled: PropTypes.bool,\n isSelected: PropTypes.bool,\n editRow: PropTypes.object.isRequired,\n onToggle: PropTypes.func,\n onFieldChange: PropTypes.func,\n actions: PropTypes.object,\n idKey: PropTypes.string\n};\n\nRow.defaultProps = {\n idKey: \"id\"\n};\n\nexport default Row;\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 { useState } from \"react\";\n\nconst useRowSelection = (idKey = \"id\") => {\n const [selectedRows, setSelectedRows] = useState([]);\n const [editEnabled, setEditEnabled] = useState(false);\n\n const isSelected = (rowId) => selectedRows.some((row) => row[idKey] === rowId);\n\n const toggleRow = (row) => {\n setSelectedRows((current) =>\n current.some((r) => r[idKey] === row[idKey])\n ? current.filter((r) => r[idKey] !== row[idKey])\n : [...current, row]\n );\n };\n\n const isAllSelected = (rows) =>\n rows.length > 0 && rows.every((row) => isSelected(row[idKey]));\n\n const toggleAll = (rows) => {\n setSelectedRows((current) =>\n rows.length > 0 && rows.every((row) => current.some((r) => r[idKey] === row[idKey]))\n ? []\n : rows\n );\n };\n\n const editField = (rowId, key, value) => {\n setSelectedRows((current) =>\n current.map((row) => (row[idKey] === rowId ? { ...row, [key]: value } : row))\n );\n };\n\n const reset = () => {\n setSelectedRows([]);\n setEditEnabled(false);\n };\n\n return {\n selectedRows,\n isSelected,\n toggleRow,\n isAllSelected,\n toggleAll,\n editField,\n editEnabled,\n enterEditMode: () => setEditEnabled(true),\n cancel: reset,\n reset\n };\n};\n\nexport default useRowSelection;\n","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React, { useEffect } from \"react\";\nimport PropTypes from \"prop-types\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\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 TableRow from \"@mui/material/TableRow\";\nimport Checkbox from \"@mui/material/Checkbox\";\nimport Toolbar from \"./components/Toolbar\";\nimport Heading from \"./components/Heading\";\nimport Row from \"./components/Row\";\nimport useRowSelection from \"./hooks/useRowSelection\";\nimport styles from \"./BulkEditTable.module.less\";\nimport CustomTablePagination from \"../table/CustomTablePagination\";\n\nconst BulkEditTable = ({ options, columns, data, onSort, onUpdate, totalRows, perPage, currentPage, onPageChange, onPerPageChange, idKey }) => {\n const {\n selectedRows,\n isSelected,\n toggleRow,\n isAllSelected,\n toggleAll,\n editField,\n editEnabled,\n enterEditMode,\n cancel,\n reset\n } = useRowSelection(idKey);\n\n const dataIds = data.map((row) => row[idKey]).join(\",\");\n\n // reset selection/edit state whenever the set of rows shown changes\n // (pagination, filtering, sorting, search, etc.)\n useEffect(() => {\n reset();\n }, [dataIds]);\n\n const getSortDir = (columnKey) =>\n columnKey === options.sortCol ? options.sortDir : null;\n\n const handleUpdateEvents = (evt) => {\n evt.stopPropagation();\n evt.preventDefault();\n Promise.resolve(onUpdate(selectedRows))\n .then(() => reset())\n .catch((error) => {\n console.error(\"Error updating events:\", error);\n });\n };\n\n return (\n <Box sx={{ width: \"100%\" }}>\n <Toolbar\n editEnabled={editEnabled}\n hasSelection={selectedRows.length > 0}\n onEdit={enterEditMode}\n onApply={handleUpdateEvents}\n onCancel={cancel}\n />\n <Paper elevation={0} sx={{ width: \"100%\", mb: 2 }}>\n <TableContainer\n component={Paper}\n className={styles.tableWrapper}\n sx={{ borderRadius: 0, boxShadow: \"none\" }}\n >\n <Table>\n <TableHead sx={{ backgroundColor: \"#EAEDF4\" }}>\n <TableRow>\n <TableCell\n align=\"center\"\n className={styles.checkColumn}\n sx={{ backgroundColor: \"#EAEDF4\" }}\n >\n <Checkbox\n checked={isAllSelected(data)}\n onChange={() => toggleAll(data)}\n slotProps={{ input: { \"aria-label\": \"select all\" } }}\n />\n </TableCell>\n {columns.map((col, i) => {\n const sortable = !!col.sortable;\n const colWidth = col.width ?? \"\";\n\n return (\n <Heading\n editEnabled={editEnabled}\n onSort={onSort}\n sortDir={getSortDir(col.columnKey)}\n sortable={sortable}\n columnIndex={i}\n columnKey={col.columnKey}\n width={colWidth}\n key={`heading_${col.columnKey}`}\n >\n {col.header ?? col.label ?? col.value}\n </Heading>\n );\n })}\n {(options.actions?.edit || options.actions?.delete) && (\n <TableCell\n align=\"center\"\n className={styles.actionColumn}\n sx={{ backgroundColor: \"#EAEDF4\" }}\n >\n {options.actionsHeader || \" \"}\n </TableCell>\n )}\n </TableRow>\n </TableHead>\n <TableBody>\n {columns.length > 0 &&\n data.map((row) => (\n <Row\n key={`row_${row[idKey]}`}\n row={row}\n idKey={idKey}\n editEnabled={editEnabled}\n isSelected={isSelected(row[idKey])}\n editRow={selectedRows.find((r) => r[idKey] === row[idKey]) || row}\n onToggle={() => toggleRow(row)}\n onFieldChange={(key, value) =>\n editField(row[idKey], key, value)\n }\n columns={columns}\n actions={options.actions}\n />\n ))}\n </TableBody>\n </Table>\n </TableContainer>\n {perPage && currentPage && onPageChange && (\n <CustomTablePagination\n totalRows={totalRows}\n perPage={perPage}\n currentPage={currentPage}\n onPageChange={onPageChange}\n onPerPageChange={onPerPageChange}\n />\n )}\n </Paper>\n </Box>\n );\n};\n\nBulkEditTable.propTypes = {\n options: PropTypes.object.isRequired,\n columns: PropTypes.array.isRequired,\n data: PropTypes.array.isRequired,\n onSort: PropTypes.func.isRequired,\n onUpdate: PropTypes.func.isRequired,\n idKey: PropTypes.string,\n totalRows: PropTypes.number,\n perPage: PropTypes.number,\n currentPage: PropTypes.number,\n onPageChange: PropTypes.func,\n onPerPageChange: PropTypes.func\n};\n\nBulkEditTable.defaultProps = {\n idKey: \"id\"\n};\n\nexport default BulkEditTable;\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 BulkEditTable from \"./BulkEditTable\";\n\nexport default BulkEditTable;\n"],"names":["root","factory","exports","module","define","amd","this","require","PAGINATION_SX","alignItems","marginTop","color","fontSize","fontWeight","display","marginLeft","BASE_PER_PAGE_OPTIONS","DEFAULT_PER_PAGE","TWENTY_PER_PAGE","FIFTY_PER_PAGE","CustomTablePagination","totalRows","perPage","currentPage","onPageChange","onPerPageChange","perPageOptions","React","includes","sort","a","b","TablePagination","component","count","rowsPerPageOptions","rowsPerPage","page","handlePageChange","_","newPage","onRowsPerPageChange","ev","parseInt","target","value","undefined","labelRowsPerPage","T","sx","propTypes","PropTypes","isRequired","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","Toolbar","editEnabled","hasSelection","onEdit","onApply","onCancel","Box","gap","mb","Button","variant","onClick","disabled","Heading","props","sortable","sortDir","onSort","columnIndex","columnKey","width","children","headerSx","minWidth","maxWidth","TableCell","TableSortLabel","active","direction","handleSort","visuallyHidden","Cell","col","row","editRow","isEditingRow","onChange","editableField","TextField","id","placeholder","multiline","minRows","fullWidth","size","_editRow$col$columnKe","_editRow$col$columnKe2","rowData","render","style","getCellStyle","_objectSpread","customStyle","Row","columns","isSelected","onToggle","onFieldChange","actions","idKey","onRowChange","TableRow","role","hover","align","className","styles","backgroundColor","Checkbox","checked","slotProps","input","filter","map","edit","delete","justifyContent","IconButton","padding","EditIcon","DeleteIcon","defaultProps","useRowSelection","selectedRows","setSelectedRows","useState","setEditEnabled","rowId","some","reset","toggleRow","current","isAllSelected","rows","length","every","toggleAll","editField","enterEditMode","cancel","BulkEditTable","options","data","onUpdate","_options$actions","_options$actions2","dataIds","join","useEffect","getSortDir","sortCol","evt","stopPropagation","preventDefault","Promise","resolve","then","catch","error","console","Paper","elevation","TableContainer","borderRadius","boxShadow","Table","TableHead","i","colWidth","header","label","actionsHeader","TableBody","find"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},8619:e=>{e.exports=require("@mui/material")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")}},r={};function t(o){var l=r[o];if(void 0!==l)return l.exports;var n=r[o]={exports:{}};return e[o](n,n.exports,t),n.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};t.r(o),t.d(o,{default:()=>v});var l=t(6031),n=t.n(l),a=t(2462),i=t.n(a),u=t(2015),s=t.n(u),p=t(6842),d=t.n(p),c=t(8619),b=t(9825),f=t.n(b);const m=["id","value","options","placeholder","label","onChange"],y=e=>{let{id:r,value:t,options:o,placeholder:l,label:a,onChange:u}=e,p=i()(e,m);const b=l||d().translate("general.select_an_option");return s().createElement(c.FormControl,{fullWidth:!0},a&&s().createElement(c.InputLabel,{id:`${r}-label`},a),s().createElement(c.Select,n()({value:t,label:a,onChange:u,labelId:`${r}-label`,displayEmpty:!0},p,{renderValue:e=>{if(null==e||""===e||Array.isArray(e)&&0===e.length)return s().createElement("em",null,b);if(Array.isArray(e)){const r=Object.fromEntries(o.map((e=>[e.value,e.label])));return e.map((e=>r[e])).filter(Boolean).join(", ")}const r=o.find((({value:r})=>r===e));return r?r.label:""}}),null==o?void 0:o.map((e=>s().createElement(c.MenuItem,{key:`selectop-${e.value}`,value:e.value,disabled:e.disabled},e.label)))))};y.propTypes={id:f().string.isRequired,value:f().oneOfType([f().string,f().number,f().array]),options:f().arrayOf(f().shape({value:f().oneOfType([f().string,f().number]).isRequired,label:f().string.isRequired,disabled:f().bool})),label:f().string,placeholder:f().string,onChange:f().func.isRequired},y.defaultProps={value:null,label:"",placeholder:"",options:null};const v=y;return o})()));
1
+ !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},8619:e=>{e.exports=require("@mui/material")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")}},r={};function t(o){var l=r[o];if(void 0!==l)return l.exports;var n=r[o]={exports:{}};return e[o](n,n.exports,t),n.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};t.r(o),t.d(o,{default:()=>v});var l=t(6031),n=t.n(l),a=t(2462),i=t.n(a),u=t(2015),s=t.n(u),p=t(6842),d=t.n(p),c=t(8619),b=t(9825),f=t.n(b);const m=["id","value","options","placeholder","label","onChange"],y=e=>{let{id:r,value:t,options:o,placeholder:l,label:a,onChange:u}=e,p=i()(e,m);const b=l||d().translate("placeholders.select"),f=o??[];return s().createElement(c.FormControl,{fullWidth:!0},a&&s().createElement(c.InputLabel,{id:`${r}-label`},a),s().createElement(c.Select,n()({value:t,label:a,onChange:u,labelId:`${r}-label`,displayEmpty:!0},p,{renderValue:e=>{if(null==e||""===e||Array.isArray(e)&&0===e.length)return s().createElement("em",null,b);if(Array.isArray(e)){const r=Object.fromEntries(f.map((e=>[e.value,e.label])));return e.map((e=>r[e])).filter(Boolean).join(", ")}const r=f.find((({value:r})=>r===e));return r?r.label:""}}),f.map((e=>s().createElement(c.MenuItem,{key:`selectop-${e.value}`,value:e.value,disabled:e.disabled},e.label)))))};y.propTypes={id:f().string.isRequired,value:f().oneOfType([f().string,f().number,f().array]),options:f().arrayOf(f().shape({value:f().oneOfType([f().string,f().number]).isRequired,label:f().string.isRequired,disabled:f().bool})),label:f().string,placeholder:f().string,onChange:f().func.isRequired},y.defaultProps={value:null,label:"",placeholder:"",options:[]};const v=y;return o})()));
2
2
  //# sourceMappingURL=dropdown.js.map
@@ -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ACAA,IAAAA,QAEFnC,QAASmC,IAAAA,QACPA,IAAAA,MAAgB,CACdvC,MAAOuC,IAAAA,UAAoB,CAACA,IAAAA,OAAkBA,IAAAA,SAC3CC,WACHlC,MAAOiC,IAAAA,OAAiBC,WACxBH,SAAUE,IAAAA,QAGdjC,MAAOiC,IAAAA,OACPlC,YAAakC,IAAAA,OACbhC,SAAUgC,IAAAA,KAAeC,YAG3BvC,EAASwC,aAAe,CACtBzC,MAAO,KACPM,MAAO,GACPD,YAAa,GACbD,QAAS,MAGX,U","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material\"","webpack://openstack-uicore-foundation/external commonjs \"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/Dropdown/index.jsx"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"@mui/material\");","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 React from \"react\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport { Select, FormControl, MenuItem, InputLabel } from \"@mui/material\";\nimport PropTypes from \"prop-types\";\n\nconst Dropdown = ({\n id,\n value,\n options,\n placeholder,\n label,\n onChange,\n ...rest\n}) => {\n const finalPlaceholder =\n placeholder || T.translate(\"general.select_an_option\");\n\n return (\n <FormControl fullWidth>\n {label && <InputLabel id={`${id}-label`}>{label}</InputLabel>}\n <Select\n value={value}\n label={label}\n onChange={onChange}\n labelId={`${id}-label`}\n displayEmpty\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...rest}\n renderValue={(selected) => {\n if (\n selected == null ||\n selected === \"\" ||\n (Array.isArray(selected) && selected.length === 0)\n ) {\n return <em>{finalPlaceholder}</em>;\n }\n if (Array.isArray(selected)) {\n const lookup = Object.fromEntries(\n options.map((o) => [o.value, o.label])\n );\n return selected\n .map((v) => lookup[v])\n .filter(Boolean)\n .join(\", \");\n }\n const selectedOption = options.find(\n ({ value }) => value === selected\n );\n return selectedOption ? selectedOption.label : \"\";\n }}\n >\n {options?.map((op) => (\n <MenuItem key={`selectop-${op.value}`} value={op.value} disabled={op.disabled}>\n {op.label}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n );\n};\n\nDropdown.propTypes = {\n id: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number,\n PropTypes.array\n ]),\n options: PropTypes.arrayOf(\n PropTypes.shape({\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n .isRequired,\n label: PropTypes.string.isRequired,\n disabled: PropTypes.bool\n })\n ),\n label: PropTypes.string,\n placeholder: PropTypes.string,\n onChange: PropTypes.func.isRequired\n};\n\nDropdown.defaultProps = {\n value: null,\n label: \"\",\n placeholder: \"\",\n options: null\n};\n\nexport default Dropdown;\n"],"names":["root","factory","exports","module","define","amd","this","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","Dropdown","_ref","id","options","placeholder","label","onChange","rest","_objectWithoutProperties","_excluded","finalPlaceholder","T","React","FormControl","fullWidth","InputLabel","Select","_extends","labelId","displayEmpty","renderValue","selected","Array","isArray","length","lookup","fromEntries","map","v","filter","Boolean","join","selectedOption","find","op","MenuItem","disabled","propTypes","PropTypes","isRequired","defaultProps"],"sourceRoot":""}
1
+ {"version":3,"file":"components/mui/dropdown.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,mCCTTH,EAAOD,QAAUK,QAAQ,iC,WCAzBJ,EAAOD,QAAUK,QAAQ,iD,WCAzBJ,EAAOD,QAAUK,QAAQ,gB,WCAzBJ,EAAOD,QAAUK,QAAQ,6B,WCAzBJ,EAAOD,QAAUK,QAAQ,a,WCAzBJ,EAAOD,QAAUK,QAAQ,Q,GCCrBC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaT,QAGrB,IAAIC,EAASK,EAAyBE,GAAY,CAGjDR,QAAS,CAAC,GAOX,OAHAW,EAAoBH,GAAUP,EAAQA,EAAOD,QAASO,GAG/CN,EAAOD,OACf,C,MCrBAO,EAAoBK,EAAKX,IACxB,IAAIY,EAASZ,GAAUA,EAAOa,WAC7B,IAAOb,EAAiB,QACxB,IAAM,EAEP,OADAM,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,C,WCLdN,EAAoBQ,EAAI,CAACf,EAASiB,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,E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AAQ,EAAE,IAGlDO,EAAkBgB,KAAKO,GACtBtB,IAAAA,cAACuB,EAAAA,SAAQ,CAACnD,IAAK,YAAYkD,EAAGpC,QAASA,MAAOoC,EAAGpC,MAAOsC,SAAUF,EAAGE,UAClEF,EAAG9B,UAIE,EAIlBL,EAASsC,UAAY,CACnBpC,GAAIqC,IAAAA,OAAiBC,WACrBzC,MAAOwC,IAAAA,UAAoB,CACzBA,IAAAA,OACAA,IAAAA,OACAA,IAAAA,QAEFpC,QAASoC,IAAAA,QACPA,IAAAA,MAAgB,CACdxC,MAAOwC,IAAAA,UAAoB,CAACA,IAAAA,OAAkBA,IAAAA,SAC3CC,WACHnC,MAAOkC,IAAAA,OAAiBC,WACxBH,SAAUE,IAAAA,QAGdlC,MAAOkC,IAAAA,OACPnC,YAAamC,IAAAA,OACbjC,SAAUiC,IAAAA,KAAeC,YAG3BxC,EAASyC,aAAe,CACtB1C,MAAO,KACPM,MAAO,GACPD,YAAa,GACbD,QAAS,IAGX,U","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material\"","webpack://openstack-uicore-foundation/external commonjs \"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/Dropdown/index.jsx"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"@mui/material\");","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 React from \"react\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport { Select, FormControl, MenuItem, InputLabel } from \"@mui/material\";\nimport PropTypes from \"prop-types\";\n\nconst Dropdown = ({\n id,\n value,\n options,\n placeholder,\n label,\n onChange,\n ...rest\n}) => {\n const finalPlaceholder =\n placeholder || T.translate(\"placeholders.select\");\n const normalizedOptions = options ?? [];\n\n return (\n <FormControl fullWidth>\n {label && <InputLabel id={`${id}-label`}>{label}</InputLabel>}\n <Select\n value={value}\n label={label}\n onChange={onChange}\n labelId={`${id}-label`}\n displayEmpty\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...rest}\n renderValue={(selected) => {\n if (\n selected == null ||\n selected === \"\" ||\n (Array.isArray(selected) && selected.length === 0)\n ) {\n return <em>{finalPlaceholder}</em>;\n }\n if (Array.isArray(selected)) {\n const lookup = Object.fromEntries(\n normalizedOptions.map((o) => [o.value, o.label])\n );\n return selected\n .map((v) => lookup[v])\n .filter(Boolean)\n .join(\", \");\n }\n const selectedOption = normalizedOptions.find(\n ({ value }) => value === selected\n );\n return selectedOption ? selectedOption.label : \"\";\n }}\n >\n {normalizedOptions.map((op) => (\n <MenuItem key={`selectop-${op.value}`} value={op.value} disabled={op.disabled}>\n {op.label}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n );\n};\n\nDropdown.propTypes = {\n id: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number,\n PropTypes.array\n ]),\n options: PropTypes.arrayOf(\n PropTypes.shape({\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n .isRequired,\n label: PropTypes.string.isRequired,\n disabled: PropTypes.bool\n })\n ),\n label: PropTypes.string,\n placeholder: PropTypes.string,\n onChange: PropTypes.func.isRequired\n};\n\nDropdown.defaultProps = {\n value: null,\n label: \"\",\n placeholder: \"\",\n options: []\n};\n\nexport default Dropdown;\n"],"names":["root","factory","exports","module","define","amd","this","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","Dropdown","_ref","id","options","placeholder","label","onChange","rest","_objectWithoutProperties","_excluded","finalPlaceholder","T","normalizedOptions","React","FormControl","fullWidth","InputLabel","Select","_extends","labelId","displayEmpty","renderValue","selected","Array","isArray","length","lookup","fromEntries","map","v","filter","Boolean","join","selectedOption","find","op","MenuItem","disabled","propTypes","PropTypes","isRequired","defaultProps"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={9299:(e,t,n)=>{var r=n(2015),o=n.n(r),a=n(9825),i=n.n(a),l=n(8619),c=n(8177),s=n.n(c),u=n(1519),m=n.n(u);const d=require("@mui/icons-material/Info");var p=n.n(d);const g=require("@mui/icons-material/Warning");var f=n.n(g);const y={warning:o().createElement(f(),{color:"warning"}),success:o().createElement(s(),{color:"success"}),error:o().createElement(m(),{color:"error"}),info:o().createElement(p(),{color:"info"})},x=({open:e,title:t,text:n,iconType:r="",onConfirm:a,onCancel:i,confirmButtonText:c="Confirm",confirmButtonColor:s="primary",cancelButtonText:u="Cancel",cancelButtonColor:m="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"}},y[r]&&o().createElement("div",{style:{marginRight:10}},y[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:m,variant:"outlined",sx:{whiteSpace:"nowrap",minWidth:100}},u),o().createElement(l.Button,{fullWidth:!0,onClick:a,color:s,variant:"contained",sx:{whiteSpace:"nowrap",minWidth:100}},c)));x.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},x.defaultProps={open:!1,iconType:"warning",confirmButtonText:"Confirm",confirmButtonColor:"primary",cancelButtonText:"Cancel",cancelButtonColor:"default"}},6130:(e,t,n)=>{n.d(t,{default:()=>a});n(1116),n(2015),n(9299);const r="__oif_confirm_dialog_bridge__",o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{},a=({title:e,text:t,iconType:n="",confirmButtonText:a="Confirm",cancelButtonText:i="Cancel",confirmButtonColor:l="primary",cancelButtonColor:c="primary"})=>{if(!o[r])throw new Error("[openstack-uicore-foundation] showConfirmDialog: <GlobalConfirmDialog /> is not mounted. Add <GlobalConfirmDialog /> to the root of your app.");return o[r]({title:e,text:t,iconType:n,confirmButtonText:a,cancelButtonText:i,confirmButtonColor:l,cancelButtonColor:c})}},5420:(e,t,n)=>{n.d(t,{default:()=>g});var r=n(2015),o=n(6842),a=n.n(o);const i=require("@mui/material/TablePagination");var l=n.n(i),c=n(9825),s=n.n(c),u=n(3209);const m={".MuiTablePagination-toolbar":{alignItems:"baseline",marginTop:"1.6rem"},".MuiTablePagination-selectLabel":{color:"rgba(0, 0, 0, 0.6)",fontSize:"12px",fontWeight:"normal"},".MuiTablePagination-select":{color:"rgba(0, 0, 0, 0.6)",fontSize:"12px",fontWeight:"normal"},".MuiTablePagination-spacer":{display:"none"},".MuiTablePagination-displayedRows":{marginLeft:"auto"}},d=[u.WU,u.k6,u.Lr],p=({totalRows:e,perPage:t,currentPage:n,onPageChange:o,onPerPageChange:i})=>{const c=r.useRef(t);let s=d.includes(c.current)?d:[...d,c.current].sort(((e,t)=>e-t));i||(s=[c.current]);return r.createElement(l(),{component:"div",count:e??0,rowsPerPageOptions:s,rowsPerPage:t,page:n-1,onPageChange:(e,t)=>{o(t+1)},onRowsPerPageChange:i?e=>{i(e.target.value)}:void 0,labelRowsPerPage:a().translate("mui_table.rows_per_page"),sx:m})};p.propTypes={totalRows:s().number,perPage:s().number.isRequired,currentPage:s().number.isRequired,onPageChange:s().func.isRequired,onPerPageChange:s().func};const g=p},3209:(e,t,n)=>{n.d(t,{Lr:()=>a,WU:()=>r,k6:()=>o});const r=10,o=20,a=50},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8177:e=>{e.exports=require("@mui/icons-material/CheckCircle")},6084:e=>{e.exports=require("@mui/icons-material/Delete")},9247:e=>{e.exports=require("@mui/icons-material/Edit")},1519:e=>{e.exports=require("@mui/icons-material/Error")},8619:e=>{e.exports=require("@mui/material")},6989:e=>{e.exports=require("@mui/material/Box")},6368:e=>{e.exports=require("@mui/material/Button")},270:e=>{e.exports=require("@mui/material/Paper")},9292:e=>{e.exports=require("@mui/material/Table")},9008:e=>{e.exports=require("@mui/material/TableBody")},5684:e=>{e.exports=require("@mui/material/TableCell")},5783:e=>{e.exports=require("@mui/material/TableContainer")},8202:e=>{e.exports=require("@mui/material/TableHead")},464:e=>{e.exports=require("@mui/material/TableRow")},38:e=>{e.exports=require("@mui/material/TableSortLabel")},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:()=>V});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),y=n.n(f),x=n(5684),h=n.n(x),b=n(5783),E=n.n(b),v=n(8202),C=n.n(v),w=n(38),P=n.n(w),T=n(464),B=n.n(T),q=n(270),_=n.n(q),O=n(8619),W=n(9247),k=n.n(W),S=n(6084),D=n.n(S),j=n(6831);const R="Z35249KJgMpoE1f5td0j";var K=n(6130),M=n(5420);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 I(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 A={backgroundColor:"background.light",color:"text.disabled"},L=({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(O.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,fontWeight:"normal"}},e),l&&i.createElement(k(),{fontSize:"small",sx:{opacity:.5,position:"absolute",right:0,"&:hover":{opacity:1}}}))},V=({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:x,onDelete:b,onCellChange:v,deleteDialogBody:w})=>{const[T,q]=i.useState(null),{sortCol:W,sortDir:S}=m,z=(e,t={})=>I(I({},t),(e=>m.disableProp&&e[m.disableProp]?A:null)(e)||{}),V=(e,t)=>"function"==typeof e.editable?e.editable(t):!!e.editable;return i.createElement(u(),{sx:{width:"100%"}},i.createElement(_(),{elevation:0,sx:{width:"100%",mb:2}},i.createElement(E(),{component:_(),sx:{borderRadius:0,boxShadow:"none"}},i.createElement(g(),null,i.createElement(C(),{sx:{backgroundColor:"#EAEAEA"}},i.createElement(B(),null,e.map((e=>i.createElement(h(),{key:e.columnKey,sx:{width:e.width,minWidth:e.width,maxWidth:e.width,fontWeight:"normal"},align:e.align??"left"},e.sortable?i.createElement(P(),{active:W===e.columnKey,direction:W===e.columnKey&&-1===S?"desc":"asc",onClick:()=>s(e.columnKey,-1*S),sx:{fontWeight:"normal"}},e.header,W===e.columnKey?i.createElement(u(),{component:"span",sx:j.visuallyHidden},-1===S?c().translate("mui_table.sorted_desc"):c().translate("mui_table.sorted_asc")):null):i.createElement("span",{style:{fontWeight:"normal"}},e.header)))),f&&i.createElement(h(),{sx:{width:40,fontWeight:"normal"}}),x&&i.createElement(h(),{sx:{width:80,fontWeight:"normal"}}),b&&i.createElement(h(),{sx:{width:40,fontWeight:"normal"}}))),i.createElement(y(),null,t.map((t=>i.createElement(B(),{key:t.id},e.map((n=>i.createElement(h(),{key:`${t.id}-${n.columnKey}`,onClick:()=>((t,n)=>{const r=e.find((e=>e.columnKey===n));r&&V(r,t)&&q({rowId:t.id,columnKey:n})})(t,n.columnKey),sx:z(t,{cursor:V(n,t)?"pointer":"default",padding:V(n,t)?"8px 16px":void 0,fontWeight:"normal"})},V(n,t)?i.createElement(L,{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):i.createElement("span",{style:{fontWeight:"normal"}},t[n.columnKey])))),f&&i.createElement(h(),{sx:z(t),className:R},i.createElement(O.IconButton,{onClick:()=>f(t),size:"small","aria-label":c().translate("general.edit")},i.createElement(k(),null))),x&&i.createElement(h(),{align:"center",sx:I({},z(t,{width:80,fontWeight:"normal"})),className:R},i.createElement(d(),{variant:"text",color:"inherit",size:"small",onClick:()=>x(t),sx:{fontSize:"1.3rem",fontWeight:"normal",lineHeight:"2.2rem",padding:"4px 5px",color:"rgba(0,0,0,0.56)"}},t.is_archived?c().translate("general.unarchive"):c().translate("general.archive"))),b&&i.createElement(h(),{sx:z(t),className:R},i.createElement(O.IconButton,{onClick:()=>(async e=>{await(0,K.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:"warning",confirmButtonText:c().translate("general.yes_delete")})&&b(e.id)})(t),size:"small","aria-label":c().translate("general.delete")},i.createElement(D(),null))))))))),r&&o&&a&&i.createElement(M.default,{totalRows:n??t.length,perPage:r,currentPage:o,onPageChange:a,onPerPageChange:l})))};return r})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={9299:(e,t,n)=>{var r=n(2015),o=n.n(r),a=n(9825),i=n.n(a),l=n(8619),c=n(8177),s=n.n(c),u=n(1519),m=n.n(u);const d=require("@mui/icons-material/Info");var p=n.n(d);const g=require("@mui/icons-material/Warning");var f=n.n(g);const y={warning:o().createElement(f(),{color:"warning"}),success:o().createElement(s(),{color:"success"}),error:o().createElement(m(),{color:"error"}),info:o().createElement(p(),{color:"info"})},x=({open:e,title:t,text:n,iconType:r="",onConfirm:a,onCancel:i,confirmButtonText:c="Confirm",confirmButtonColor:s="primary",cancelButtonText:u="Cancel",cancelButtonColor:m="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"}},y[r]&&o().createElement("div",{style:{marginRight:10}},y[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:m,variant:"outlined",sx:{whiteSpace:"nowrap",minWidth:100}},u),o().createElement(l.Button,{fullWidth:!0,onClick:a,color:s,variant:"contained",sx:{whiteSpace:"nowrap",minWidth:100}},c)));x.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},x.defaultProps={open:!1,iconType:"warning",confirmButtonText:"Confirm",confirmButtonColor:"primary",cancelButtonText:"Cancel",cancelButtonColor:"default"}},6130:(e,t,n)=>{n.d(t,{default:()=>a});n(1116),n(2015),n(9299);const r="__oif_confirm_dialog_bridge__",o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{},a=({title:e,text:t,iconType:n="",confirmButtonText:a="Confirm",cancelButtonText:i="Cancel",confirmButtonColor:l="primary",cancelButtonColor:c="primary"})=>{if(!o[r])throw new Error("[openstack-uicore-foundation] showConfirmDialog: <GlobalConfirmDialog /> is not mounted. Add <GlobalConfirmDialog /> to the root of your app.");return o[r]({title:e,text:t,iconType:n,confirmButtonText:a,cancelButtonText:i,confirmButtonColor:l,cancelButtonColor:c})}},5420:(e,t,n)=>{n.d(t,{default:()=>g});var r=n(2015),o=n(6842),a=n.n(o);const i=require("@mui/material/TablePagination");var l=n.n(i),c=n(9825),s=n.n(c),u=n(3209);const m={".MuiTablePagination-toolbar":{alignItems:"baseline",marginTop:"1.6rem"},".MuiTablePagination-selectLabel":{color:"rgba(0, 0, 0, 0.6)",fontSize:"12px",fontWeight:"normal"},".MuiTablePagination-select":{color:"rgba(0, 0, 0, 0.6)",fontSize:"12px",fontWeight:"normal"},".MuiTablePagination-spacer":{display:"none"},".MuiTablePagination-displayedRows":{marginLeft:"auto"}},d=[u.WU,u.k6,u.Lr],p=({totalRows:e,perPage:t,currentPage:n,onPageChange:o,onPerPageChange:i})=>{const c=r.useMemo((()=>i?d.includes(t)?d:[...d,t].sort(((e,t)=>e-t)):[t]),[t,i]);return r.createElement(l(),{component:"div",count:e??0,rowsPerPageOptions:c,rowsPerPage:t,page:n-1,onPageChange:(e,t)=>{o(t+1)},onRowsPerPageChange:i?e=>{i(parseInt(e.target.value,10))}:void 0,labelRowsPerPage:a().translate("mui_table.rows_per_page"),sx:m})};p.propTypes={totalRows:s().number,perPage:s().number.isRequired,currentPage:s().number.isRequired,onPageChange:s().func.isRequired,onPerPageChange:s().func};const g=p},3209:(e,t,n)=>{n.d(t,{Lr:()=>a,WU:()=>r,k6:()=>o});const r=10,o=20,a=50},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8177:e=>{e.exports=require("@mui/icons-material/CheckCircle")},6084:e=>{e.exports=require("@mui/icons-material/Delete")},9247:e=>{e.exports=require("@mui/icons-material/Edit")},1519:e=>{e.exports=require("@mui/icons-material/Error")},8619:e=>{e.exports=require("@mui/material")},6989:e=>{e.exports=require("@mui/material/Box")},6368:e=>{e.exports=require("@mui/material/Button")},270:e=>{e.exports=require("@mui/material/Paper")},9292:e=>{e.exports=require("@mui/material/Table")},9008:e=>{e.exports=require("@mui/material/TableBody")},5684:e=>{e.exports=require("@mui/material/TableCell")},5783:e=>{e.exports=require("@mui/material/TableContainer")},8202:e=>{e.exports=require("@mui/material/TableHead")},464:e=>{e.exports=require("@mui/material/TableRow")},38:e=>{e.exports=require("@mui/material/TableSortLabel")},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:()=>V});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),y=n.n(f),x=n(5684),h=n.n(x),b=n(5783),E=n.n(b),v=n(8202),C=n.n(v),w=n(38),P=n.n(w),T=n(464),B=n.n(T),q=n(270),_=n.n(q),O=n(8619),W=n(9247),k=n.n(W),S=n(6084),D=n.n(S),j=n(6831);const R="Z35249KJgMpoE1f5td0j";var K=n(6130),M=n(5420);function I(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 z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const A={backgroundColor:"background.light",color:"text.disabled"},L=({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(O.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,fontWeight:"normal"}},e),l&&i.createElement(k(),{fontSize:"small",sx:{opacity:.5,position:"absolute",right:0,"&:hover":{opacity:1}}}))},V=({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:x,onDelete:b,onCellChange:v,deleteDialogBody:w})=>{const[T,q]=i.useState(null),{sortCol:W,sortDir:S}=m,I=(e,t={})=>z(z({},t),(e=>m.disableProp&&e[m.disableProp]?A:null)(e)||{}),V=(e,t)=>"function"==typeof e.editable?e.editable(t):!!e.editable;return i.createElement(u(),{sx:{width:"100%"}},i.createElement(_(),{elevation:0,sx:{width:"100%",mb:2}},i.createElement(E(),{component:_(),sx:{borderRadius:0,boxShadow:"none"}},i.createElement(g(),null,i.createElement(C(),{sx:{backgroundColor:"#EAEAEA"}},i.createElement(B(),null,e.map((e=>i.createElement(h(),{key:e.columnKey,sx:{width:e.width,minWidth:e.width,maxWidth:e.width,fontWeight:"normal"},align:e.align??"left"},e.sortable?i.createElement(P(),{active:W===e.columnKey,direction:W===e.columnKey&&-1===S?"desc":"asc",onClick:()=>s(e.columnKey,-1*S),sx:{fontWeight:"normal"}},e.header,W===e.columnKey?i.createElement(u(),{component:"span",sx:j.visuallyHidden},-1===S?c().translate("mui_table.sorted_desc"):c().translate("mui_table.sorted_asc")):null):i.createElement("span",{style:{fontWeight:"normal"}},e.header)))),f&&i.createElement(h(),{sx:{width:40,fontWeight:"normal"}}),x&&i.createElement(h(),{sx:{width:80,fontWeight:"normal"}}),b&&i.createElement(h(),{sx:{width:40,fontWeight:"normal"}}))),i.createElement(y(),null,t.map((t=>i.createElement(B(),{key:t.id},e.map((n=>i.createElement(h(),{key:`${t.id}-${n.columnKey}`,onClick:()=>((t,n)=>{const r=e.find((e=>e.columnKey===n));r&&V(r,t)&&q({rowId:t.id,columnKey:n})})(t,n.columnKey),sx:I(t,{cursor:V(n,t)?"pointer":"default",padding:V(n,t)?"8px 16px":void 0,fontWeight:"normal"})},V(n,t)?i.createElement(L,{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):i.createElement("span",{style:{fontWeight:"normal"}},t[n.columnKey])))),f&&i.createElement(h(),{sx:I(t),className:R},i.createElement(O.IconButton,{onClick:()=>f(t),size:"small","aria-label":c().translate("general.edit")},i.createElement(k(),null))),x&&i.createElement(h(),{align:"center",sx:z({},I(t,{width:80,fontWeight:"normal"})),className:R},i.createElement(d(),{variant:"text",color:"inherit",size:"small",onClick:()=>x(t),sx:{fontSize:"1.3rem",fontWeight:"normal",lineHeight:"2.2rem",padding:"4px 5px",color:"rgba(0,0,0,0.56)"}},t.is_archived?c().translate("general.unarchive"):c().translate("general.archive"))),b&&i.createElement(h(),{sx:I(t),className:R},i.createElement(O.IconButton,{onClick:()=>(async e=>{await(0,K.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:"warning",confirmButtonText:c().translate("general.yes_delete")})&&b(e.id)})(t),size:"small","aria-label":c().translate("general.delete")},i.createElement(D(),null))))))))),r&&o&&a&&i.createElement(M.default,{totalRows:n??t.length,perPage:r,currentPage:o,onPageChange:a,onPerPageChange:l})))};return r})()));
2
2
  //# sourceMappingURL=editable-table.js.map