@soyfri/shared-library 1.1.7 → 1.1.9

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 (31) hide show
  1. package/cjs/components/Table/Table.cjs +1 -1
  2. package/esm/components/Table/Table.js +1 -1
  3. package/package.json +1 -11
  4. package/cjs/components/Flyout/Flyout.cjs +0 -2
  5. package/cjs/components/Flyout/Flyout.cjs.map +0 -1
  6. package/cjs/components/Flyout.cjs +0 -2
  7. package/cjs/components/Flyout.cjs.map +0 -1
  8. package/cjs/components/InputGroup/InputGroup.cjs +0 -2
  9. package/cjs/components/InputGroup/InputGroup.cjs.map +0 -1
  10. package/cjs/components/InputGroup.cjs +0 -2
  11. package/cjs/components/InputGroup.cjs.map +0 -1
  12. package/cjs/node_modules/@mui/icons-material/esm/Close.cjs +0 -2
  13. package/cjs/node_modules/@mui/icons-material/esm/Close.cjs.map +0 -1
  14. package/components/Flyout/index.ts +0 -1
  15. package/components/InputGroup/index.ts +0 -1
  16. package/esm/components/Flyout/Flyout.d.ts +0 -13
  17. package/esm/components/Flyout/Flyout.js +0 -2
  18. package/esm/components/Flyout/Flyout.js.map +0 -1
  19. package/esm/components/Flyout/Flyout.stories.d.ts +0 -12
  20. package/esm/components/Flyout/index.d.ts +0 -1
  21. package/esm/components/Flyout.js +0 -2
  22. package/esm/components/Flyout.js.map +0 -1
  23. package/esm/components/InputGroup/InputGroup.d.ts +0 -13
  24. package/esm/components/InputGroup/InputGroup.js +0 -2
  25. package/esm/components/InputGroup/InputGroup.js.map +0 -1
  26. package/esm/components/InputGroup/InputGroup.stories.d.ts +0 -8
  27. package/esm/components/InputGroup/index.d.ts +0 -1
  28. package/esm/components/InputGroup.js +0 -2
  29. package/esm/components/InputGroup.js.map +0 -1
  30. package/esm/node_modules/@mui/icons-material/esm/Close.js +0 -2
  31. package/esm/node_modules/@mui/icons-material/esm/Close.js.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/jsx-runtime.cjs"),t=require("react"),s=require("@mui/material"),r=require("../../node_modules/@mui/icons-material/esm/DownloadOutlined.cjs"),o=require("../../node_modules/@mui/icons-material/esm/FirstPage.cjs"),n=require("../../node_modules/@mui/icons-material/esm/LastPage.cjs"),i=require("../../node_modules/@mui/icons-material/esm/KeyboardArrowLeft.cjs"),l=require("../../node_modules/@mui/icons-material/esm/KeyboardArrowRight.cjs"),a=require("./exportsUtils.cjs"),x=require("../../node_modules/@mui/material/esm/Alert/Alert.cjs");const c=t.forwardRef((function(t,s){return e.jsxRuntimeExports.jsx(x,Object.assign({elevation:6,ref:s,variant:"filled"},t))}));function u({data:x,children:u,currentPage:p,pageSize:m,totalPages:d,previousPage:h,nextPage:j,pageSizeSelectorValue:b=10,onPageChange:E,onPageSizeChange:g,visiblePageNumbers:f=5,enableCSVExport:R=!1,csvExportFileName:y="data.csv",csvExportButtonText:C="Exportar CSV",csvExportColumns:S,enableExcelExport:v=!1,excelExportFileName:w="data.xlsx",excelExportButtonText:k="Exportar Excel",excelExportColumns:T,enableRowSelection:z=!1,rowIdentifier:I,onSelectionChange:B}){const P=t.Children.toArray(u).filter((e=>t.isValidElement(e)&&"Column"===e.type.displayName)),[q,M]=t.useState(!1),[_,A]=t.useState(""),[N,O]=t.useState("info"),[V,W]=t.useState([]);t.useEffect((()=>{W([])}),[x,p,m]),t.useEffect((()=>{null==B||B(V)}),[V,B]);const F=(e,t)=>{"clickaway"!==t&&M(!1)},D="function"==typeof E&&"number"==typeof p,[H,K]=t.useState(1),[L,G]=t.useState(b),U=D?p:H,$=D?m:L,J=D?x:x.slice((U-1)*$,U*$),Q=D?d:Math.ceil(x.length/$),X=e=>{e<1||e>Q||(D?null==E||E(e):K(e))},Y=(()=>{const e=[],t=Q,s=U,r=Math.floor(f/2);let o=Math.max(1,s-r),n=Math.min(t,s+r);n-o+1<f&&(1===o?n=Math.min(t,o+f-1):n===t&&(o=Math.max(1,t-f+1)));for(let t=o;t<=n;t++)e.push(t);return e})(),Z=e=>!!I&&V.some((t=>t[I]===e[I])),ee=J.filter(Z).length,te=J.length>0&&ee===J.length,se=ee>0&&ee<J.length;return e.jsxRuntimeExports.jsxs(s.TableContainer,{component:s.Paper,sx:{borderRadius:2,overflow:"hidden"},children:[e.jsxRuntimeExports.jsxs(s.Table,{sx:{minWidth:650},"aria-label":"custom table",children:[e.jsxRuntimeExports.jsx(s.TableHead,{sx:{backgroundColor:e=>e.palette.grey[100]},children:e.jsxRuntimeExports.jsxs(s.TableRow,{children:[z&&e.jsxRuntimeExports.jsxs(s.TableCell,{padding:"checkbox",sx:{width:"50px"},children:[" ",e.jsxRuntimeExports.jsx(s.Checkbox,{color:"primary",indeterminate:se,checked:te,onChange:e=>{if(I)if(e.target.checked){const e=[...V];J.forEach((t=>{const s=t[I];e.some((e=>e[I]===s))||e.push(t)})),W(e)}else{const e=V.filter((e=>!J.some((t=>t[I]===e[I]))));W(e)}else console.warn("`rowIdentifier` prop is required for row selection.")},inputProps:{"aria-label":"select all desserts"}})]}),P.map(((t,r)=>e.jsxRuntimeExports.jsx(s.TableCell,{sx:{fontWeight:"bold",color:e=>e.palette.text.secondary,width:t.props.width||"auto",whiteSpace:"nowrap"},children:e.jsxRuntimeExports.jsx(s.Typography,{variant:"subtitle2",fontWeight:"bold",children:t.props.name})},r)))]})}),e.jsxRuntimeExports.jsxs(s.TableBody,{children:[J.map(((t,r)=>{const o=z&&Z(t);return e.jsxRuntimeExports.jsxs(s.TableRow,{sx:{"&:last-child td, &:last-child th":{border:0},"&:hover":{backgroundColor:e=>e.palette.action.hover}},selected:o,children:[z&&e.jsxRuntimeExports.jsxs(s.TableCell,{padding:"checkbox",sx:{width:"50px"},children:[" ",e.jsxRuntimeExports.jsx(s.Checkbox,{color:"primary",checked:o,onClick:e=>((e,t)=>{if(!I)return void console.warn("`rowIdentifier` prop is required for row selection.");const s=t[I],r=V.findIndex((e=>e[I]===s));let o=[];-1===r?o=o.concat(V,t):0===r?o=o.concat(V.slice(1)):r===V.length-1?o=o.concat(V.slice(0,-1)):r>0&&(o=o.concat(V.slice(0,r),V.slice(r+1))),W(o)})(0,t),inputProps:{"aria-labelledby":`table-checkbox-${r}`}})]}),P.map(((r,o)=>{const{field:n,children:i}=r.props;let l;return l=Array.isArray(n)?n.reduce(((e,s)=>(e[s]=t[s],e)),{}):{[n]:t[n]},e.jsxRuntimeExports.jsx(s.TableCell,{sx:{width:r.props.width||"auto",whiteSpace:"nowrap"},children:i(l)},o)}))]},r)})),0===J.length&&e.jsxRuntimeExports.jsx(s.TableRow,{children:e.jsxRuntimeExports.jsx(s.TableCell,{colSpan:P.length+(z?1:0),sx:{textAlign:"center",py:4},children:e.jsxRuntimeExports.jsx(s.Typography,{variant:"body2",color:"text.secondary",children:"No hay datos disponibles para mostrar."})})})]})]}),(Q>0||R||v||z&&V.length>0)&&e.jsxRuntimeExports.jsxs(s.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",p:2,children:[Q>0&&e.jsxRuntimeExports.jsx(s.Select,{size:"small",value:$,onChange:e=>{return t=Number(e.target.value),void(D?(null==g||g(t),null==E||E(1)):(G(t),K(1)));var t},children:[1,2,3,5,10,20,50,100].map((t=>e.jsxRuntimeExports.jsxs(s.MenuItem,{value:t,children:["Mostrar ",t]},t)))}),Q>0&&e.jsxRuntimeExports.jsxs(s.Box,{display:"flex",alignItems:"center",gap:.5,sx:{flexGrow:1,justifyContent:"center"},children:[e.jsxRuntimeExports.jsx(s.IconButton,{onClick:()=>X(1),disabled:U<=1,size:"small",color:"primary",children:e.jsxRuntimeExports.jsx(o,{fontSize:"small"})}),e.jsxRuntimeExports.jsx(s.IconButton,{onClick:()=>X(U-1),disabled:U<=1,size:"small",color:"primary",children:e.jsxRuntimeExports.jsx(i,{fontSize:"small"})}),Y.map((t=>e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>X(t),variant:U===t?"contained":"text",size:"small",sx:{minWidth:"32px",height:"32px"},children:t},t))),e.jsxRuntimeExports.jsx(s.IconButton,{onClick:()=>X(U+1),disabled:U>=Q,size:"small",color:"primary",children:e.jsxRuntimeExports.jsx(l,{fontSize:"small"})}),e.jsxRuntimeExports.jsx(s.IconButton,{onClick:()=>X(Q),disabled:U>=Q,size:"small",color:"primary",children:e.jsxRuntimeExports.jsx(n,{fontSize:"small"})})]}),z&&V.length>0&&e.jsxRuntimeExports.jsxs(s.Typography,{variant:"subtitle2",sx:{mr:2},children:[V.length," seleccionados"]}),(R||v)&&e.jsxRuntimeExports.jsxs(s.Box,{display:"flex",alignItems:"center",gap:1,children:[R&&e.jsxRuntimeExports.jsx(s.Button,{variant:"text",color:"primary",onClick:()=>a.exportToCSV({data:x,columns:P,fileName:y,exportColumns:S,setSnackbarOpen:M,setSnackbarMessage:A,setSnackbarSeverity:O}),size:"small",startIcon:e.jsxRuntimeExports.jsx(r,{}),children:C}),v&&e.jsxRuntimeExports.jsx(s.Button,{variant:"text",color:"primary",onClick:()=>a.exportToExcel({data:x,columns:P,fileName:w,exportColumns:T,setSnackbarOpen:M,setSnackbarMessage:A,setSnackbarSeverity:O}),size:"small",startIcon:e.jsxRuntimeExports.jsx(r,{}),children:k})]})]}),e.jsxRuntimeExports.jsx(s.Snackbar,{open:q,autoHideDuration:3e3,onClose:F,anchorOrigin:{vertical:"bottom",horizontal:"center"},children:e.jsxRuntimeExports.jsx(c,{onClose:F,severity:N,sx:{width:"100%"},children:_})})]})}exports.Table=u,exports.default=u;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/jsx-runtime.cjs"),t=require("react"),s=require("@mui/material"),r=require("../../node_modules/@mui/icons-material/esm/DownloadOutlined.cjs"),o=require("../../node_modules/@mui/icons-material/esm/FirstPage.cjs"),n=require("../../node_modules/@mui/icons-material/esm/LastPage.cjs"),i=require("../../node_modules/@mui/icons-material/esm/KeyboardArrowLeft.cjs"),l=require("../../node_modules/@mui/icons-material/esm/KeyboardArrowRight.cjs"),a=require("./exportsUtils.cjs"),x=require("../../node_modules/@mui/material/esm/Alert/Alert.cjs");const c=t.forwardRef((function(t,s){return e.jsxRuntimeExports.jsx(x,Object.assign({elevation:6,ref:s,variant:"filled"},t))}));function u({data:x,children:u,currentPage:p,pageSize:m,totalPages:d,previousPage:h,nextPage:j,pageSizeSelectorValue:b=10,onPageChange:E,onPageSizeChange:g,visiblePageNumbers:f=5,enableCSVExport:R=!1,csvExportFileName:y="data.csv",csvExportButtonText:C="Exportar CSV",csvExportColumns:S,enableExcelExport:v=!1,excelExportFileName:w="data.xlsx",excelExportButtonText:k="Exportar Excel",excelExportColumns:T,enableRowSelection:z=!1,rowIdentifier:I,onSelectionChange:B}){const P=t.Children.toArray(u).filter((e=>t.isValidElement(e)&&"Column"===e.type.displayName)),[q,M]=t.useState(!1),[_,A]=t.useState(""),[N,O]=t.useState("info"),[V,W]=t.useState([]);t.useEffect((()=>{W([])}),[x,p,m]),t.useEffect((()=>{null==B||B(V)}),[V,B]);const F=(e,t)=>{"clickaway"!==t&&M(!1)},D="function"==typeof E&&"number"==typeof p,[H,K]=t.useState(1),[L,G]=t.useState(b),U=D?p:H,$=D?m:L,J=D?x:x.slice((U-1)*$,U*$),Q=D?d:Math.ceil(x.length/$),X=e=>{e<1||e>Q||(D?null==E||E(e):K(e))},Y=(()=>{const e=[],t=Q,s=U,r=Math.floor(f/2);let o=Math.max(1,s-r),n=Math.min(t,s+r);n-o+1<f&&(1===o?n=Math.min(t,o+f-1):n===t&&(o=Math.max(1,t-f+1)));for(let t=o;t<=n;t++)e.push(t);return e})(),Z=e=>!!I&&V.some((t=>t[I]===e[I])),ee=J.filter(Z).length,te=J.length>0&&ee===J.length,se=ee>0&&ee<J.length;return e.jsxRuntimeExports.jsxs(s.TableContainer,{component:s.Paper,sx:{borderRadius:2,overflow:"auto"},children:[e.jsxRuntimeExports.jsxs(s.Table,{sx:{minWidth:650},"aria-label":"custom table",children:[e.jsxRuntimeExports.jsx(s.TableHead,{sx:{backgroundColor:e=>e.palette.grey[100]},children:e.jsxRuntimeExports.jsxs(s.TableRow,{children:[z&&e.jsxRuntimeExports.jsxs(s.TableCell,{padding:"checkbox",sx:{width:"50px"},children:[" ",e.jsxRuntimeExports.jsx(s.Checkbox,{color:"primary",indeterminate:se,checked:te,onChange:e=>{if(I)if(e.target.checked){const e=[...V];J.forEach((t=>{const s=t[I];e.some((e=>e[I]===s))||e.push(t)})),W(e)}else{const e=V.filter((e=>!J.some((t=>t[I]===e[I]))));W(e)}else console.warn("`rowIdentifier` prop is required for row selection.")},inputProps:{"aria-label":"select all desserts"}})]}),P.map(((t,r)=>e.jsxRuntimeExports.jsx(s.TableCell,{sx:{fontWeight:"bold",color:e=>e.palette.text.secondary,width:t.props.width||"auto",whiteSpace:"nowrap"},children:e.jsxRuntimeExports.jsx(s.Typography,{variant:"subtitle2",fontWeight:"bold",children:t.props.name})},r)))]})}),e.jsxRuntimeExports.jsxs(s.TableBody,{children:[J.map(((t,r)=>{const o=z&&Z(t);return e.jsxRuntimeExports.jsxs(s.TableRow,{sx:{"&:last-child td, &:last-child th":{border:0},"&:hover":{backgroundColor:e=>e.palette.action.hover}},selected:o,children:[z&&e.jsxRuntimeExports.jsxs(s.TableCell,{padding:"checkbox",sx:{width:"50px"},children:[" ",e.jsxRuntimeExports.jsx(s.Checkbox,{color:"primary",checked:o,onClick:e=>((e,t)=>{if(!I)return void console.warn("`rowIdentifier` prop is required for row selection.");const s=t[I],r=V.findIndex((e=>e[I]===s));let o=[];-1===r?o=o.concat(V,t):0===r?o=o.concat(V.slice(1)):r===V.length-1?o=o.concat(V.slice(0,-1)):r>0&&(o=o.concat(V.slice(0,r),V.slice(r+1))),W(o)})(0,t),inputProps:{"aria-labelledby":`table-checkbox-${r}`}})]}),P.map(((r,o)=>{const{field:n,children:i}=r.props;let l;return l=Array.isArray(n)?n.reduce(((e,s)=>(e[s]=t[s],e)),{}):{[n]:t[n]},e.jsxRuntimeExports.jsx(s.TableCell,{sx:{width:r.props.width||"auto",whiteSpace:"nowrap"},children:i(l)},o)}))]},r)})),0===J.length&&e.jsxRuntimeExports.jsx(s.TableRow,{children:e.jsxRuntimeExports.jsx(s.TableCell,{colSpan:P.length+(z?1:0),sx:{textAlign:"center",py:4},children:e.jsxRuntimeExports.jsx(s.Typography,{variant:"body2",color:"text.secondary",children:"No hay datos disponibles para mostrar."})})})]})]}),(Q>0||R||v||z&&V.length>0)&&e.jsxRuntimeExports.jsxs(s.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",p:2,children:[Q>0&&e.jsxRuntimeExports.jsx(s.Select,{size:"small",value:$,onChange:e=>{return t=Number(e.target.value),void(D?(null==g||g(t),null==E||E(1)):(G(t),K(1)));var t},children:[1,2,3,5,10,20,50,100].map((t=>e.jsxRuntimeExports.jsxs(s.MenuItem,{value:t,children:["Mostrar ",t]},t)))}),Q>0&&e.jsxRuntimeExports.jsxs(s.Box,{display:"flex",alignItems:"center",gap:.5,sx:{flexGrow:1,justifyContent:"center"},children:[e.jsxRuntimeExports.jsx(s.IconButton,{onClick:()=>X(1),disabled:U<=1,size:"small",color:"primary",children:e.jsxRuntimeExports.jsx(o,{fontSize:"small"})}),e.jsxRuntimeExports.jsx(s.IconButton,{onClick:()=>X(U-1),disabled:U<=1,size:"small",color:"primary",children:e.jsxRuntimeExports.jsx(i,{fontSize:"small"})}),Y.map((t=>e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>X(t),variant:U===t?"contained":"text",size:"small",sx:{minWidth:"32px",height:"32px"},children:t},t))),e.jsxRuntimeExports.jsx(s.IconButton,{onClick:()=>X(U+1),disabled:U>=Q,size:"small",color:"primary",children:e.jsxRuntimeExports.jsx(l,{fontSize:"small"})}),e.jsxRuntimeExports.jsx(s.IconButton,{onClick:()=>X(Q),disabled:U>=Q,size:"small",color:"primary",children:e.jsxRuntimeExports.jsx(n,{fontSize:"small"})})]}),z&&V.length>0&&e.jsxRuntimeExports.jsxs(s.Typography,{variant:"subtitle2",sx:{mr:2},children:[V.length," seleccionados"]}),(R||v)&&e.jsxRuntimeExports.jsxs(s.Box,{display:"flex",alignItems:"center",gap:1,children:[R&&e.jsxRuntimeExports.jsx(s.Button,{variant:"text",color:"primary",onClick:()=>a.exportToCSV({data:x,columns:P,fileName:y,exportColumns:S,setSnackbarOpen:M,setSnackbarMessage:A,setSnackbarSeverity:O}),size:"small",startIcon:e.jsxRuntimeExports.jsx(r,{}),children:C}),v&&e.jsxRuntimeExports.jsx(s.Button,{variant:"text",color:"primary",onClick:()=>a.exportToExcel({data:x,columns:P,fileName:w,exportColumns:T,setSnackbarOpen:M,setSnackbarMessage:A,setSnackbarSeverity:O}),size:"small",startIcon:e.jsxRuntimeExports.jsx(r,{}),children:k})]})]}),e.jsxRuntimeExports.jsx(s.Snackbar,{open:q,autoHideDuration:3e3,onClose:F,anchorOrigin:{vertical:"bottom",horizontal:"center"},children:e.jsxRuntimeExports.jsx(c,{onClose:F,severity:N,sx:{width:"100%"},children:_})})]})}exports.Table=u,exports.default=u;
2
2
  //# sourceMappingURL=Table.cjs.map
@@ -1,2 +1,2 @@
1
- import{j as e}from"../../_virtual/jsx-runtime.js";import r,{Children as t,isValidElement as o,useState as l,useEffect as s}from"react";import{TableContainer as i,Paper as a,Table as n,TableHead as c,TableRow as d,TableCell as m,Checkbox as x,Typography as p,TableBody as h,Box as u,Select as f,MenuItem as j,IconButton as g,Button as b,Snackbar as y}from"@mui/material";import v from"../../node_modules/@mui/icons-material/esm/DownloadOutlined.js";import w from"../../node_modules/@mui/icons-material/esm/FirstPage.js";import C from"../../node_modules/@mui/icons-material/esm/LastPage.js";import k from"../../node_modules/@mui/icons-material/esm/KeyboardArrowLeft.js";import S from"../../node_modules/@mui/icons-material/esm/KeyboardArrowRight.js";import{exportToCSV as z,exportToExcel as E}from"./exportsUtils.js";import P from"../../node_modules/@mui/material/esm/Alert/Alert.js";const I=r.forwardRef((function(r,t){return e.jsx(P,Object.assign({elevation:6,ref:t,variant:"filled"},r))}));function M({data:r,children:P,currentPage:M,pageSize:A,totalPages:N,previousPage:_,nextPage:O,pageSizeSelectorValue:R=10,onPageChange:W,onPageSizeChange:F,visiblePageNumbers:T=5,enableCSVExport:V=!1,csvExportFileName:q="data.csv",csvExportButtonText:B="Exportar CSV",csvExportColumns:D,enableExcelExport:K=!1,excelExportFileName:L="data.xlsx",excelExportButtonText:G="Exportar Excel",excelExportColumns:H,enableRowSelection:U=!1,rowIdentifier:$,onSelectionChange:J}){const Q=t.toArray(P).filter((e=>o(e)&&"Column"===e.type.displayName)),[X,Y]=l(!1),[Z,ee]=l(""),[re,te]=l("info"),[oe,le]=l([]);s((()=>{le([])}),[r,M,A]),s((()=>{null==J||J(oe)}),[oe,J]);const se=(e,r)=>{"clickaway"!==r&&Y(!1)},ie="function"==typeof W&&"number"==typeof M,[ae,ne]=l(1),[ce,de]=l(R),me=ie?M:ae,xe=ie?A:ce,pe=ie?r:r.slice((me-1)*xe,me*xe),he=ie?N:Math.ceil(r.length/xe),ue=e=>{e<1||e>he||(ie?null==W||W(e):ne(e))},fe=(()=>{const e=[],r=he,t=me,o=Math.floor(T/2);let l=Math.max(1,t-o),s=Math.min(r,t+o);s-l+1<T&&(1===l?s=Math.min(r,l+T-1):s===r&&(l=Math.max(1,r-T+1)));for(let r=l;r<=s;r++)e.push(r);return e})(),je=e=>!!$&&oe.some((r=>r[$]===e[$])),ge=pe.filter(je).length,be=pe.length>0&&ge===pe.length,ye=ge>0&&ge<pe.length;return e.jsxs(i,{component:a,sx:{borderRadius:2,overflow:"hidden"},children:[e.jsxs(n,{sx:{minWidth:650},"aria-label":"custom table",children:[e.jsx(c,{sx:{backgroundColor:e=>e.palette.grey[100]},children:e.jsxs(d,{children:[U&&e.jsxs(m,{padding:"checkbox",sx:{width:"50px"},children:[" ",e.jsx(x,{color:"primary",indeterminate:ye,checked:be,onChange:e=>{if($)if(e.target.checked){const e=[...oe];pe.forEach((r=>{const t=r[$];e.some((e=>e[$]===t))||e.push(r)})),le(e)}else{const e=oe.filter((e=>!pe.some((r=>r[$]===e[$]))));le(e)}else console.warn("`rowIdentifier` prop is required for row selection.")},inputProps:{"aria-label":"select all desserts"}})]}),Q.map(((r,t)=>e.jsx(m,{sx:{fontWeight:"bold",color:e=>e.palette.text.secondary,width:r.props.width||"auto",whiteSpace:"nowrap"},children:e.jsx(p,{variant:"subtitle2",fontWeight:"bold",children:r.props.name})},t)))]})}),e.jsxs(h,{children:[pe.map(((r,t)=>{const o=U&&je(r);return e.jsxs(d,{sx:{"&:last-child td, &:last-child th":{border:0},"&:hover":{backgroundColor:e=>e.palette.action.hover}},selected:o,children:[U&&e.jsxs(m,{padding:"checkbox",sx:{width:"50px"},children:[" ",e.jsx(x,{color:"primary",checked:o,onClick:e=>((e,r)=>{if(!$)return void console.warn("`rowIdentifier` prop is required for row selection.");const t=r[$],o=oe.findIndex((e=>e[$]===t));let l=[];-1===o?l=l.concat(oe,r):0===o?l=l.concat(oe.slice(1)):o===oe.length-1?l=l.concat(oe.slice(0,-1)):o>0&&(l=l.concat(oe.slice(0,o),oe.slice(o+1))),le(l)})(0,r),inputProps:{"aria-labelledby":`table-checkbox-${t}`}})]}),Q.map(((t,o)=>{const{field:l,children:s}=t.props;let i;return i=Array.isArray(l)?l.reduce(((e,t)=>(e[t]=r[t],e)),{}):{[l]:r[l]},e.jsx(m,{sx:{width:t.props.width||"auto",whiteSpace:"nowrap"},children:s(i)},o)}))]},t)})),0===pe.length&&e.jsx(d,{children:e.jsx(m,{colSpan:Q.length+(U?1:0),sx:{textAlign:"center",py:4},children:e.jsx(p,{variant:"body2",color:"text.secondary",children:"No hay datos disponibles para mostrar."})})})]})]}),(he>0||V||K||U&&oe.length>0)&&e.jsxs(u,{display:"flex",justifyContent:"space-between",alignItems:"center",p:2,children:[he>0&&e.jsx(f,{size:"small",value:xe,onChange:e=>{return r=Number(e.target.value),void(ie?(null==F||F(r),null==W||W(1)):(de(r),ne(1)));var r},children:[1,2,3,5,10,20,50,100].map((r=>e.jsxs(j,{value:r,children:["Mostrar ",r]},r)))}),he>0&&e.jsxs(u,{display:"flex",alignItems:"center",gap:.5,sx:{flexGrow:1,justifyContent:"center"},children:[e.jsx(g,{onClick:()=>ue(1),disabled:me<=1,size:"small",color:"primary",children:e.jsx(w,{fontSize:"small"})}),e.jsx(g,{onClick:()=>ue(me-1),disabled:me<=1,size:"small",color:"primary",children:e.jsx(k,{fontSize:"small"})}),fe.map((r=>e.jsx(b,{onClick:()=>ue(r),variant:me===r?"contained":"text",size:"small",sx:{minWidth:"32px",height:"32px"},children:r},r))),e.jsx(g,{onClick:()=>ue(me+1),disabled:me>=he,size:"small",color:"primary",children:e.jsx(S,{fontSize:"small"})}),e.jsx(g,{onClick:()=>ue(he),disabled:me>=he,size:"small",color:"primary",children:e.jsx(C,{fontSize:"small"})})]}),U&&oe.length>0&&e.jsxs(p,{variant:"subtitle2",sx:{mr:2},children:[oe.length," seleccionados"]}),(V||K)&&e.jsxs(u,{display:"flex",alignItems:"center",gap:1,children:[V&&e.jsx(b,{variant:"text",color:"primary",onClick:()=>z({data:r,columns:Q,fileName:q,exportColumns:D,setSnackbarOpen:Y,setSnackbarMessage:ee,setSnackbarSeverity:te}),size:"small",startIcon:e.jsx(v,{}),children:B}),K&&e.jsx(b,{variant:"text",color:"primary",onClick:()=>E({data:r,columns:Q,fileName:L,exportColumns:H,setSnackbarOpen:Y,setSnackbarMessage:ee,setSnackbarSeverity:te}),size:"small",startIcon:e.jsx(v,{}),children:G})]})]}),e.jsx(y,{open:X,autoHideDuration:3e3,onClose:se,anchorOrigin:{vertical:"bottom",horizontal:"center"},children:e.jsx(I,{onClose:se,severity:re,sx:{width:"100%"},children:Z})})]})}export{M as Table,M as default};
1
+ import{j as e}from"../../_virtual/jsx-runtime.js";import r,{Children as t,isValidElement as o,useState as l,useEffect as s}from"react";import{TableContainer as i,Paper as a,Table as n,TableHead as c,TableRow as d,TableCell as m,Checkbox as x,Typography as p,TableBody as h,Box as u,Select as f,MenuItem as j,IconButton as g,Button as b,Snackbar as y}from"@mui/material";import v from"../../node_modules/@mui/icons-material/esm/DownloadOutlined.js";import w from"../../node_modules/@mui/icons-material/esm/FirstPage.js";import C from"../../node_modules/@mui/icons-material/esm/LastPage.js";import k from"../../node_modules/@mui/icons-material/esm/KeyboardArrowLeft.js";import S from"../../node_modules/@mui/icons-material/esm/KeyboardArrowRight.js";import{exportToCSV as z,exportToExcel as E}from"./exportsUtils.js";import P from"../../node_modules/@mui/material/esm/Alert/Alert.js";const I=r.forwardRef((function(r,t){return e.jsx(P,Object.assign({elevation:6,ref:t,variant:"filled"},r))}));function M({data:r,children:P,currentPage:M,pageSize:A,totalPages:N,previousPage:_,nextPage:O,pageSizeSelectorValue:R=10,onPageChange:W,onPageSizeChange:F,visiblePageNumbers:T=5,enableCSVExport:V=!1,csvExportFileName:q="data.csv",csvExportButtonText:B="Exportar CSV",csvExportColumns:D,enableExcelExport:K=!1,excelExportFileName:L="data.xlsx",excelExportButtonText:G="Exportar Excel",excelExportColumns:H,enableRowSelection:U=!1,rowIdentifier:$,onSelectionChange:J}){const Q=t.toArray(P).filter((e=>o(e)&&"Column"===e.type.displayName)),[X,Y]=l(!1),[Z,ee]=l(""),[re,te]=l("info"),[oe,le]=l([]);s((()=>{le([])}),[r,M,A]),s((()=>{null==J||J(oe)}),[oe,J]);const se=(e,r)=>{"clickaway"!==r&&Y(!1)},ie="function"==typeof W&&"number"==typeof M,[ae,ne]=l(1),[ce,de]=l(R),me=ie?M:ae,xe=ie?A:ce,pe=ie?r:r.slice((me-1)*xe,me*xe),he=ie?N:Math.ceil(r.length/xe),ue=e=>{e<1||e>he||(ie?null==W||W(e):ne(e))},fe=(()=>{const e=[],r=he,t=me,o=Math.floor(T/2);let l=Math.max(1,t-o),s=Math.min(r,t+o);s-l+1<T&&(1===l?s=Math.min(r,l+T-1):s===r&&(l=Math.max(1,r-T+1)));for(let r=l;r<=s;r++)e.push(r);return e})(),je=e=>!!$&&oe.some((r=>r[$]===e[$])),ge=pe.filter(je).length,be=pe.length>0&&ge===pe.length,ye=ge>0&&ge<pe.length;return e.jsxs(i,{component:a,sx:{borderRadius:2,overflow:"auto"},children:[e.jsxs(n,{sx:{minWidth:650},"aria-label":"custom table",children:[e.jsx(c,{sx:{backgroundColor:e=>e.palette.grey[100]},children:e.jsxs(d,{children:[U&&e.jsxs(m,{padding:"checkbox",sx:{width:"50px"},children:[" ",e.jsx(x,{color:"primary",indeterminate:ye,checked:be,onChange:e=>{if($)if(e.target.checked){const e=[...oe];pe.forEach((r=>{const t=r[$];e.some((e=>e[$]===t))||e.push(r)})),le(e)}else{const e=oe.filter((e=>!pe.some((r=>r[$]===e[$]))));le(e)}else console.warn("`rowIdentifier` prop is required for row selection.")},inputProps:{"aria-label":"select all desserts"}})]}),Q.map(((r,t)=>e.jsx(m,{sx:{fontWeight:"bold",color:e=>e.palette.text.secondary,width:r.props.width||"auto",whiteSpace:"nowrap"},children:e.jsx(p,{variant:"subtitle2",fontWeight:"bold",children:r.props.name})},t)))]})}),e.jsxs(h,{children:[pe.map(((r,t)=>{const o=U&&je(r);return e.jsxs(d,{sx:{"&:last-child td, &:last-child th":{border:0},"&:hover":{backgroundColor:e=>e.palette.action.hover}},selected:o,children:[U&&e.jsxs(m,{padding:"checkbox",sx:{width:"50px"},children:[" ",e.jsx(x,{color:"primary",checked:o,onClick:e=>((e,r)=>{if(!$)return void console.warn("`rowIdentifier` prop is required for row selection.");const t=r[$],o=oe.findIndex((e=>e[$]===t));let l=[];-1===o?l=l.concat(oe,r):0===o?l=l.concat(oe.slice(1)):o===oe.length-1?l=l.concat(oe.slice(0,-1)):o>0&&(l=l.concat(oe.slice(0,o),oe.slice(o+1))),le(l)})(0,r),inputProps:{"aria-labelledby":`table-checkbox-${t}`}})]}),Q.map(((t,o)=>{const{field:l,children:s}=t.props;let i;return i=Array.isArray(l)?l.reduce(((e,t)=>(e[t]=r[t],e)),{}):{[l]:r[l]},e.jsx(m,{sx:{width:t.props.width||"auto",whiteSpace:"nowrap"},children:s(i)},o)}))]},t)})),0===pe.length&&e.jsx(d,{children:e.jsx(m,{colSpan:Q.length+(U?1:0),sx:{textAlign:"center",py:4},children:e.jsx(p,{variant:"body2",color:"text.secondary",children:"No hay datos disponibles para mostrar."})})})]})]}),(he>0||V||K||U&&oe.length>0)&&e.jsxs(u,{display:"flex",justifyContent:"space-between",alignItems:"center",p:2,children:[he>0&&e.jsx(f,{size:"small",value:xe,onChange:e=>{return r=Number(e.target.value),void(ie?(null==F||F(r),null==W||W(1)):(de(r),ne(1)));var r},children:[1,2,3,5,10,20,50,100].map((r=>e.jsxs(j,{value:r,children:["Mostrar ",r]},r)))}),he>0&&e.jsxs(u,{display:"flex",alignItems:"center",gap:.5,sx:{flexGrow:1,justifyContent:"center"},children:[e.jsx(g,{onClick:()=>ue(1),disabled:me<=1,size:"small",color:"primary",children:e.jsx(w,{fontSize:"small"})}),e.jsx(g,{onClick:()=>ue(me-1),disabled:me<=1,size:"small",color:"primary",children:e.jsx(k,{fontSize:"small"})}),fe.map((r=>e.jsx(b,{onClick:()=>ue(r),variant:me===r?"contained":"text",size:"small",sx:{minWidth:"32px",height:"32px"},children:r},r))),e.jsx(g,{onClick:()=>ue(me+1),disabled:me>=he,size:"small",color:"primary",children:e.jsx(S,{fontSize:"small"})}),e.jsx(g,{onClick:()=>ue(he),disabled:me>=he,size:"small",color:"primary",children:e.jsx(C,{fontSize:"small"})})]}),U&&oe.length>0&&e.jsxs(p,{variant:"subtitle2",sx:{mr:2},children:[oe.length," seleccionados"]}),(V||K)&&e.jsxs(u,{display:"flex",alignItems:"center",gap:1,children:[V&&e.jsx(b,{variant:"text",color:"primary",onClick:()=>z({data:r,columns:Q,fileName:q,exportColumns:D,setSnackbarOpen:Y,setSnackbarMessage:ee,setSnackbarSeverity:te}),size:"small",startIcon:e.jsx(v,{}),children:B}),K&&e.jsx(b,{variant:"text",color:"primary",onClick:()=>E({data:r,columns:Q,fileName:L,exportColumns:H,setSnackbarOpen:Y,setSnackbarMessage:ee,setSnackbarSeverity:te}),size:"small",startIcon:e.jsx(v,{}),children:G})]})]}),e.jsx(y,{open:X,autoHideDuration:3e3,onClose:se,anchorOrigin:{vertical:"bottom",horizontal:"center"},children:e.jsx(I,{onClose:se,severity:re,sx:{width:"100%"},children:Z})})]})}export{M as Table,M as default};
2
2
  //# sourceMappingURL=Table.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soyfri/shared-library",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -48,11 +48,6 @@
48
48
  "require": "./cjs/components/Select.cjs",
49
49
  "types": "./esm/components/Select/Select.d.ts"
50
50
  },
51
- "./components/InputGroup": {
52
- "import": "./esm/components/InputGroup.js",
53
- "require": "./cjs/components/InputGroup.cjs",
54
- "types": "./esm/components/InputGroup/InputGroup.d.ts"
55
- },
56
51
  "./components/Input": {
57
52
  "import": "./esm/components/Input.js",
58
53
  "require": "./cjs/components/Input.cjs",
@@ -63,11 +58,6 @@
63
58
  "require": "./cjs/components/Icon.cjs",
64
59
  "types": "./esm/components/Icon/Icon.d.ts"
65
60
  },
66
- "./components/Flyout": {
67
- "import": "./esm/components/Flyout.js",
68
- "require": "./cjs/components/Flyout.cjs",
69
- "types": "./esm/components/Flyout/Flyout.d.ts"
70
- },
71
61
  "./components/DateTimePicker": {
72
62
  "import": "./esm/components/DateTimePicker.js",
73
63
  "require": "./cjs/components/DateTimePicker.cjs",
@@ -1,2 +0,0 @@
1
- "use strict";var e=require("../../_virtual/jsx-runtime.cjs"),t=require("react"),r=require("@mui/material"),s=require("../../node_modules/@mui/icons-material/esm/Close.cjs");module.exports=({open:o,onClose:i,title:n,anchor:a="right",children:l,size:x="medium",height:u="auto"})=>{const c=(e=>{switch(e){case"small":return Math.round(345);case"medium":default:return Math.round(517.5);case"large":return Math.round(690)}})(x),m=t.useMemo((()=>"left"===a||"right"===a?{width:c}:{height:u,width:"100%"}),[a,c,u]);return e.jsxRuntimeExports.jsx(r.Drawer,{anchor:a,open:o,onClose:i,disableEscapeKeyDown:!1,ModalProps:{keepMounted:!0},children:e.jsxRuntimeExports.jsxs(r.Box,{sx:Object.assign(Object.assign({},m),{display:"flex",flexDirection:"column",p:2,backgroundColor:e=>e.palette.background.paper,color:e=>e.palette.text.primary,height:"100%"}),role:"presentation",children:[e.jsxRuntimeExports.jsxs(r.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,flexShrink:0},children:[n&&e.jsxRuntimeExports.jsx(r.Typography,{variant:"h6",component:"div",sx:{fontWeight:"bold"},children:n}),e.jsxRuntimeExports.jsx(r.IconButton,{onClick:i,sx:{ml:"auto"},children:e.jsxRuntimeExports.jsx(s,{})})]}),e.jsxRuntimeExports.jsx(r.Divider,{sx:{mb:2}})," ",e.jsxRuntimeExports.jsx(r.Box,{sx:{flexGrow:1,overflowY:"auto"},children:l})]})})};
2
- //# sourceMappingURL=Flyout.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Flyout.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";var t=require("./Flyout/Flyout.cjs");exports.Flyout=t;
2
- //# sourceMappingURL=Flyout.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Flyout.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";var e=require("../../_virtual/jsx-runtime.cjs"),t=require("react"),r=require("@mui/material"),i=require("../Input/Input.cjs"),o=require("../Select/Select.cjs"),s=require("../DatePicker/DatePicker.cjs"),u=require("../../node_modules/@mui/x-date-pickers/esm/DatePicker/DatePicker.cjs");module.exports=({children:n})=>{const d=t.Children.toArray(n),a=d.map(((n,a)=>{if(t.isValidElement(n)){const p=n.props,l=n.type,c=l===r.TextField||l===i.Input||l===r.Select||l===o.Select||l===u.DatePicker||l===s.DatePicker?t.cloneElement(n,Object.assign(Object.assign({},p),{sx:Object.assign(Object.assign({},p.sx),{"& .MuiOutlinedInput-notchedOutline":{border:"none"},".MuiInputLabel-shrink":{backgroundColor:"white"},fieldset:{border:"none !important"},"& .MuiInputBase-root .MuiButtonBase-root":{borderRight:"none"},".MuiFormControl-root .MuiFormControl-fullWidth > fieldset.MuiOutlinedInput-notchedOutline":{backgroundColor:"red"}})})):n;return e.jsxRuntimeExports.jsx(r.Box,{sx:{flexGrow:1,display:"flex",alignItems:"center",minWidth:0,borderRight:a<d.length-1?"1px solid #ccc":"none"},children:c},a)}return n}));return e.jsxRuntimeExports.jsx(r.Box,{className:"InputGroup",sx:{display:"flex",justifyContent:"space-between",height:"34px",border:"1px solid #ccc",borderRadius:"10px",padding:"8px 0px","& .MuiInputBase-root, & .MuiButtonBase-root, & .MuiChip-root":{borderRadius:0},"& > div:first-of-type .MuiInputBase-root, & > div:first-of-type .MuiButtonBase-root, & > div:first-of-type .MuiChip-root":{borderTopLeftRadius:"10px",borderBottomLeftRadius:"10px"},"& > div:last-of-type .MuiInputBase-root, & > div:last-of-type .MuiButtonBase-root, & > div:last-of-type .MuiChip-root":{borderTopRightRadius:"10px",borderBottomRightRadius:"10px"}},children:a})};
2
- //# sourceMappingURL=InputGroup.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InputGroup.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";var r=require("./InputGroup/InputGroup.cjs");exports.InputGroup=r;
2
- //# sourceMappingURL=InputGroup.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InputGroup.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";var e=require("../../../../_virtual/jsx-runtime.cjs"),r=require("../../material/esm/utils/createSvgIcon.cjs")(e.jsxRuntimeExports.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");module.exports=r;
2
- //# sourceMappingURL=Close.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Close.cjs","sources":["../../../../../../node_modules/@mui/icons-material/esm/Close.js"],"sourcesContent":["\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n}), 'Close');"],"names":["CloseIcon","createSvgIcon","_jsx","jsxRuntimeExports","jsx","d"],"mappings":"mEAIAA,uDAAeC,CAA2BC,EAAIC,kBAAAC,IAAC,OAAQ,CACrDC,EAAG,0GACD","x_google_ignoreList":[0]}
@@ -1 +0,0 @@
1
- export * from '../../esm/components/Flyout';
@@ -1 +0,0 @@
1
- export * from '../../esm/components/InputGroup';
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- type FlyoutSize = 'small' | 'medium' | 'large';
3
- export interface FlyoutProps {
4
- open: boolean;
5
- onClose: () => void;
6
- title?: string;
7
- anchor?: 'left' | 'top' | 'right' | 'bottom';
8
- children: React.ReactNode;
9
- size?: FlyoutSize;
10
- height?: string | number;
11
- }
12
- declare const Flyout: React.FC<FlyoutProps>;
13
- export default Flyout;
@@ -1,2 +0,0 @@
1
- import{j as e}from"../../_virtual/jsx-runtime.js";import{useMemo as t}from"react";import{Drawer as r,Box as o,Typography as s,IconButton as i,Divider as n}from"@mui/material";import a from"../../node_modules/@mui/icons-material/esm/Close.js";const l=({open:l,onClose:c,title:d,anchor:m="right",children:h,size:u="medium",height:x="auto"})=>{const p=(e=>{switch(e){case"small":return Math.round(345);case"medium":default:return Math.round(517.5);case"large":return Math.round(690)}})(u),f=t((()=>"left"===m||"right"===m?{width:p}:{height:x,width:"100%"}),[m,p,x]);return e.jsx(r,{anchor:m,open:l,onClose:c,disableEscapeKeyDown:!1,ModalProps:{keepMounted:!0},children:e.jsxs(o,{sx:Object.assign(Object.assign({},f),{display:"flex",flexDirection:"column",p:2,backgroundColor:e=>e.palette.background.paper,color:e=>e.palette.text.primary,height:"100%"}),role:"presentation",children:[e.jsxs(o,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,flexShrink:0},children:[d&&e.jsx(s,{variant:"h6",component:"div",sx:{fontWeight:"bold"},children:d}),e.jsx(i,{onClick:c,sx:{ml:"auto"},children:e.jsx(a,{})})]}),e.jsx(n,{sx:{mb:2}})," ",e.jsx(o,{sx:{flexGrow:1,overflowY:"auto"},children:h})]})})};export{l as default};
2
- //# sourceMappingURL=Flyout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Flyout.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,12 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import Flyout from './Flyout';
3
- declare const meta: Meta<typeof Flyout>;
4
- export default meta;
5
- type Story = StoryObj<typeof Flyout>;
6
- export declare const Default: Story;
7
- export declare const SmallLeft: Story;
8
- export declare const LargeRight: Story;
9
- export declare const TopAnchor: Story;
10
- export declare const BottomAnchor: Story;
11
- export declare const NoTitle: Story;
12
- export declare const CustomContent: Story;
@@ -1 +0,0 @@
1
- export { default as Flyout } from './Flyout';
@@ -1,2 +0,0 @@
1
- export{default as Flyout}from"./Flyout/Flyout.js";
2
- //# sourceMappingURL=Flyout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Flyout.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- interface InputGroupProps {
3
- /**
4
- * Los componentes hijos a ser agrupados.
5
- */
6
- children: React.ReactNode;
7
- }
8
- /**
9
- * Componente que agrupa elementos de entrada de Material-UI, eliminando sus
10
- * bordes y añadiendo un divisor entre ellos.
11
- */
12
- declare const InputGroup: React.FC<InputGroupProps>;
13
- export default InputGroup;
@@ -1,2 +0,0 @@
1
- import{j as t}from"../../_virtual/jsx-runtime.js";import{Children as o,isValidElement as e,cloneElement as r}from"react";import{Box as i,TextField as s,Select as n}from"@mui/material";import{Input as u}from"../Input/Input.js";import{Select as p}from"../Select/Select.js";import{DatePicker as a}from"../DatePicker/DatePicker.js";import{DatePicker as d}from"../../node_modules/@mui/x-date-pickers/esm/DatePicker/DatePicker.js";const l=({children:l})=>{const c=o.toArray(l),m=c.map(((o,l)=>{if(e(o)){const e=o.props,m=o.type,f=m===s||m===u||m===n||m===p||m===d||m===a?r(o,Object.assign(Object.assign({},e),{sx:Object.assign(Object.assign({},e.sx),{"& .MuiOutlinedInput-notchedOutline":{border:"none"},".MuiInputLabel-shrink":{backgroundColor:"white"},fieldset:{border:"none !important"},"& .MuiInputBase-root .MuiButtonBase-root":{borderRight:"none"},".MuiFormControl-root .MuiFormControl-fullWidth > fieldset.MuiOutlinedInput-notchedOutline":{backgroundColor:"red"}})})):o;return t.jsx(i,{sx:{flexGrow:1,display:"flex",alignItems:"center",minWidth:0,borderRight:l<c.length-1?"1px solid #ccc":"none"},children:f},l)}return o}));return t.jsx(i,{className:"InputGroup",sx:{display:"flex",justifyContent:"space-between",height:"34px",border:"1px solid #ccc",borderRadius:"10px",padding:"8px 0px","& .MuiInputBase-root, & .MuiButtonBase-root, & .MuiChip-root":{borderRadius:0},"& > div:first-of-type .MuiInputBase-root, & > div:first-of-type .MuiButtonBase-root, & > div:first-of-type .MuiChip-root":{borderTopLeftRadius:"10px",borderBottomLeftRadius:"10px"},"& > div:last-of-type .MuiInputBase-root, & > div:last-of-type .MuiButtonBase-root, & > div:last-of-type .MuiChip-root":{borderTopRightRadius:"10px",borderBottomRightRadius:"10px"}},children:m})};export{l as default};
2
- //# sourceMappingURL=InputGroup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InputGroup.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import InputGroup from './InputGroup';
3
- declare const meta: Meta<typeof InputGroup>;
4
- export default meta;
5
- type Story = StoryObj<typeof InputGroup>;
6
- export declare const BasicInputGroup: Story;
7
- export declare const CombinedInputGroup: Story;
8
- export declare const DatePickerInputGroup: Story;
@@ -1 +0,0 @@
1
- export { default as InputGroup } from './InputGroup';
@@ -1,2 +0,0 @@
1
- export{default as InputGroup}from"./InputGroup/InputGroup.js";
2
- //# sourceMappingURL=InputGroup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InputGroup.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{j as r}from"../../../../_virtual/jsx-runtime.js";import t from"../../material/esm/utils/createSvgIcon.js";var a=t(r.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");export{a as default};
2
- //# sourceMappingURL=Close.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Close.js","sources":["../../../../../../node_modules/@mui/icons-material/esm/Close.js"],"sourcesContent":["\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n}), 'Close');"],"names":["CloseIcon","createSvgIcon","_jsx","jsx","d"],"mappings":"iHAIA,IAAAA,EAAeC,EAA2BC,EAAIC,IAAC,OAAQ,CACrDC,EAAG,0GACD","x_google_ignoreList":[0]}