@zac-apps/commons 2.2.0 → 2.3.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +20 -20
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/objectWithoutProperties";import r from"@babel/runtime/helpers/defineProperty";import*as t from"react";import n,{useState as i,useEffect as o}from"react";import a from"@mui/material/Snackbar";import l from"@mui/material/Alert";import{jsx as c,jsxs as m}from"react/jsx-runtime";import u from"@mui/material/Grid";import p from"@mui/material/Accordion";import s from"@mui/material/AccordionSummary";import f from"@mui/material/AccordionDetails";import d from"@mui/material/Typography";import h from"@mui/icons-material/ExpandMore";import{createTheme as y,ThemeProvider as x,CssBaseline as b}from"@mui/material";import{green as g,yellow as v,pink as j,lightGreen as C,red as O}from"@mui/material/colors";import A,{Link as S}from"next/link";import P from"@mui/material/Link";import w from"@mui/material/Box";import k from"@mui/material/AppBar";import T from"@mui/material/Toolbar";import D from"@babel/runtime/helpers/slicedToArray";import{usePathname as I,useRouter as E}from"next/navigation";import z from"@mui/material/IconButton";import F from"@mui/material/MenuItem";import M from"@mui/material/Menu";import B from"@mui/material/Divider";import W from"@mui/icons-material/Menu";import G from"@mui/icons-material/MenuOpen";import U from"@mui/material/Table";import H from"@mui/material/TableContainer";import L from"@mui/material/Paper";import R from"@mui/material/TextField";import V from"@mui/material/InputAdornment";import Z from"@mui/material/CircularProgress";import _ from"@mui/material/ToggleButtonGroup";import q from"@mui/material/ToggleButton";import J from"next/image";import Q from"@mui/material/Button";import{styled as K}from"@mui/material/styles";import N,{tableCellClasses as X}from"@mui/material/TableCell";import Y from"@mui/material/useMediaQuery";import $ from"@mui/material/Drawer";import ee from"@mui/material/List";import re from"@mui/material/ListItem";import te from"@mui/icons-material/ManageSearch";import ne from"@mui/icons-material/Close";var ie=["alert","SetAlert","message"];function oe(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}var ae=n.forwardRef(function(e,t){return c(l,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}({elevation:6,ref:t,variant:"filled"},e))});function le(r){var t=r.alert,n=r.SetAlert,i=r.message,o=e(r,ie),l=o.autoHideDuration||3e3,m=o.severity||"error",u=o.sx||{width:"100%"},p=function(e,r){"clickaway"!==r&&n(!1)};return c(a,{open:t,autoHideDuration:l,onClose:p,children:c(ae,{severity:m,onClose:p,sx:u,children:i})})}var ce=y({palette:{primary:{main:"#c1002a"},secondary:{main:"#636363"},error:{main:j[900]},running:{main:O[900],contrastText:"#fff"},available:{main:C[200],contrastText:"#000"},info:{main:j[100]},success:{main:v[500]},empty:{main:g[500],contrastText:"#000"}}});function me(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pe(e){var r=e.sx||{};return c(u,{size:{xs:e.xs||e.size||12,lg:e.lg||e.size||6,md:e.md||12},sx:ue({},r),children:m(p,{defaultExpanded:!e.collapsed,square:!1,elevation:2,children:[c(s,{expandIcon:c(h,{}),sx:{backgroundColor:ce.palette.divider},children:c(d,{variant:"h5",children:e.title})}),c(f,{children:e.children})]})})}function se(e){var r=e.children,t=e.reverse;return c(u,{container:!0,spacing:2,sx:{display:"flex",flexGrow:1,justifyContent:"center",flexWrap:t?"wrap-reverse":"wrap"},children:r})}function fe(e){var r=e.title,t=e.iconUrl,n=e.iconAlt,i=e.children;return r||(r="JGU-ZAC Apps"),c(k,{position:"sticky",children:m(T,{children:[i," ",c(d,{variant:"h6",component:"div",sx:{flexGrow:1},children:r}),t?c("img",{src:t,width:"48px",alt:n}):null]})})}function de(e){var r=e.anchorEl;return c(r?G:W,{})}function he(e){var r=e.availApps,n=e.start,i=e.basePath,o=t.useState(null),a=D(o,2),l=a[0],u=a[1],p=Boolean(l),s=function(){u(null)},f=I();function d(){return n?m(t.Fragment,{children:[c(F,{component:A,href:i,selected:f===i,onClick:s,children:"Start"}),c(B,{})]}):null}return i&&null!==i||(i="/"),m("div",{children:[c(z,{size:"large",edge:"start",color:"inherit","aria-label":"menu",sx:{mr:2},onClick:function(e){u(e.currentTarget)},children:c(de,{anchorEl:l})}),m(M,{id:"lock-menu",anchorEl:l,open:p,onClose:s,slotProps:{"aria-labelledby":"lock-button",role:"listbox"},children:[c(d,{}),r.map(function(e,r){return c(F,{component:A,href:e.path,selected:f===e.path+"/",onClick:s,children:e.name},e.name)})]})]})}function ye(e){var r=e.footerContent;return c(n.Fragment,{children:c(u,{sx:{p:1,backgroundColor:ce.palette.divider,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",minHeight:64},children:c(u,{children:c(d,{variant:"body2",children:r})})})})}function xe(e){var r=e.title,t=e.availApps,i=e.footerContent,o=e.children,a=e.basePath,l=e.menu,u=e.iconUrl,p=e.iconAlt;return a&&null!==a||(a="/"),i&&null!==i||(i=""),m(n.Fragment,{children:[c(fe,{title:c(P,{component:S,href:a,sx:{color:ce.palette.primary.contrastText},children:r}),iconUrl:u,iconAlt:p,children:l?c(he,{availApps:t,basePath:a,start:!0}):null}),c(w,{sx:{p:3,minHeight:"calc(100% - 128px)",display:"flex",justifyContent:"center"},children:o}),c(ye,{footerContent:i})]})}function be(e){var r=e.title,t=e.availApps,n=e.footerContent,i=e.basePath,o=e.iconUrl,a=e.iconAlt,l=e.children;return m(x,{theme:ce,children:[c(b,{}),c(xe,{title:r,availApps:t,footerContent:n,basePath:i,iconUrl:o,iconAlt:a,menu:!0,children:l})]})}function ge(e){var r=e.children;return c(H,{component:L,children:c(U,{size:"small","aria-label":"a dense table",children:r})})}function ve(e){var r=e.children;return c(B,{textAlign:"left",children:r})}function je(e){var r=e.input,t=e.SetInput,o=e.error,a=e.SetError,l=e.minValue,u=e.maxValue,p=e.adornment,s=e.label,f=e.helperText,d=e.size,h=i(""),y=D(h,2),x=y[0],b=y[1],g=i(!1),v=D(g,2),j=v[0],C=v[1],O={};return"small"===d&&(O={maxWidth:75}),m(n.Fragment,{children:[c(R,{size:"small",sx:O,onChange:function(e){return function(e){var r=!1,n=e.target.value;n.match(/[0-9-]*/)[0]&&n.match(/[0-9-]*/)[0]===n||(r=!0,b("Input is not numerical.")),(n>u||n<l)&&(r=!0,b("Input is outside allowed boundaries.")),t(n),a(r),C(r)}(e)},value:r,error:o,label:s,helperText:f,inputProps:{inputMode:"numeric"},InputProps:{endAdornment:c(V,{position:"end",children:p})}}),c(le,{alert:j,SetAlert:C,message:x})]})}function Ce(e){return e.toString()+" %"}function Oe(){return c(u,{container:!0,sx:{display:"flex",flexGrow:1,justifyContent:"center",alignContent:"center"},children:c(Z,{})})}function Ae(e){var r=e.url,t=e.SetState,n=e.SetMetaData,a=e.reload,l=e.SetReload;e.error;var c=e.SetError,m=i(),u=D(m,2),p=u[0],s=u[1],f=i(),d=D(f,2);d[0];var h=d[1],y=null;return t||(t=s,y=p),c||(c=h),a||(a=!1),o(function(){try{fetch(r,{headers:{"Content-Type":"application/json",Accept:"application/json"}}).then(function(e){return n&&n(e.headers),console.log(e),e.ok?e.json():(c({error:e.statusText}),{error:e.statusText})}).then(function(e){console.log(e),t(e)})}catch(e){console.log(e),c({error:e})}l&&l(!1)},[a]),y}function Se(e){var r=e.children,t=e.matches,n=e.justify;return c(u,t?{sx:{display:"flex",justifyContent:n,alignItems:"center"},children:r}:{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:r})}function Pe(e){var r=e.listmode,t=e.setup,i=e.spec,o=e.SetSpec,a=e.SetFilter,l=e.routerActive,m=l?E():null,p=l?I():null;return c(n.Fragment,{children:c(u,{children:c(_,{value:i,exclusive:!0,color:"primary",onChange:function(e,t){null!==t&&(o(t),a&&a({}),l&&m.push(p+"?spec="+t+"&mode="+r))},size:"small",children:Object.keys(t).map(function(e){return c(q,{value:e,children:e},"spec_"+e)})})})})}function we(e){var r=e.availApps;return c(u,{children:m(pe,{title:"Welcome to ZAC Apps",xs:12,lg:8,children:[c("p",{children:"Select an app to get started."}),c(u,{container:!0,sx:{display:"flex",flexWrap:"wrap",justifyContent:"center"},children:r.map(function(e){return m(Q,{sx:{m:5,minWidth:250,display:"flex",flexDirection:"column"},variant:"outlined",component:S,href:e.path,children:[c("p",{children:c(J,{src:e.icon,alt:e.name,height:100})}),c("p",{children:e.name})]},"button_"+e.path)})})]})})}var ke=K(N)(function(e){var t=e.theme;return r(r({},"&.".concat(X.head),{backgroundColor:t.palette.grey[300]}),"&.".concat(X.body),{fontSize:14})});function Te(e){var r=e.url,t=e.reload,n=e.SetReload,a=i(),l=D(a,2),c=l[0],m=l[1],u=i(),p=D(u,2),s=p[0],f=p[1];return o(function(){fetch(r,{headers:{"Content-Type":"application/json",Accept:"application/json"}}).then(function(e){return f(e.headers),console.log(e),e.json()}).then(function(e){console.log(e),m(e)}),t&&n(!1)},[t]),{data:c,metadata:s}}function De(e){var r=e.children,t=Y(ce.breakpoints.up("lg")),o=i(!1),a=D(o,2),l=a[0],u=a[1],p=function(e){return function(r){("keydown"!==r.type||"Tab"!==r.key&&"Shift"!==r.key)&&u(e)}};return m(n.Fragment,{children:[c(Q,{variant:"outlined",onClick:p(!0),startIcon:c(te,{fontSize:"inherit"}),children:"Search/Filter"}),c($,{anchor:"left",open:l,onClose:p(!1),sx:{maxWidth:"350px"},children:c(w,{role:"presentation",width:t?"420px":"100%",children:m(ee,{children:[c(re,{sx:{justifyContent:"right"},children:c(z,{onClick:p(!1),children:c(ne,{})})}),c(B,{}),r]})})})]})}export{pe as AppCard,De as AppDrawer,se as AppGrid,fe as AppMenu,be as AppRoot,ge as AppTable,ce as AppTheme,xe as AppWrapper,ve as DivTitle,le as ErrorAlert,ye as Footer,de as MenuButton,he as NextListMenu,je as NumField,Ce as Percentage,Oe as Progress,Ae as PublicFetch,Se as RespGrid,Pe as SpecSwitch,we as Start,ke as TableHeadCell,Te as useFetch};
|
|
1
|
+
import e from"@babel/runtime/helpers/objectWithoutProperties";import r from"@babel/runtime/helpers/defineProperty";import*as t from"react";import n,{useState as i,useEffect as o}from"react";import a from"@mui/material/Snackbar";import l from"@mui/material/Alert";import{jsx as c,jsxs as m}from"react/jsx-runtime";import s from"@mui/material/Grid";import u from"@mui/material/Accordion";import p from"@mui/material/AccordionSummary";import d from"@mui/material/AccordionDetails";import f from"@mui/material/Typography";import h from"@mui/icons-material/ExpandMore";import{createTheme as v,ThemeProvider as g,CssBaseline as y}from"@mui/material";import{green as x,yellow as b,pink as C,lightGreen as A,red as j}from"@mui/material/colors";import w,{Link as O}from"next/link";import P from"@mui/material/Link";import S from"@mui/material/Box";import _ from"@mui/material/AppBar";import k from"@mui/material/Toolbar";import T from"/assets/cafca_logo_2026_pos_red.svg";import D from"/assets/cafca_logo_2026_neg_red.svg";import I from"/assets/cafca_logo_2026_pos_white.svg";import E from"/assets/cafca_logo_2026_neg_white.svg";import F from"/assets/cafca_logo_2026_pos_grey.svg";import z from"/assets/cafca_logo_2026_neg_grey.svg";import L from"@babel/runtime/helpers/slicedToArray";import{usePathname as M,useRouter as W}from"next/navigation";import G from"@mui/material/IconButton";import B from"@mui/material/MenuItem";import U from"@mui/material/Menu";import Z from"@mui/material/Divider";import R from"@mui/icons-material/Menu";import H from"@mui/icons-material/MenuOpen";import N from"@mui/material/Table";import V from"@mui/material/TableContainer";import q from"@mui/material/Paper";import J from"@mui/material/TextField";import Q from"@mui/material/InputAdornment";import K from"@mui/material/CircularProgress";import X from"@mui/material/ToggleButtonGroup";import Y from"@mui/material/ToggleButton";import $ from"next/image";import ee from"@mui/material/Button";import{styled as re}from"@mui/material/styles";import te,{tableCellClasses as ne}from"@mui/material/TableCell";import ie from"@mui/material/useMediaQuery";import oe from"@mui/material/Drawer";import ae from"@mui/material/List";import le from"@mui/material/ListItem";import ce from"@mui/icons-material/ManageSearch";import me from"@mui/icons-material/Close";var se=["alert","SetAlert","message"];function ue(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}var pe=n.forwardRef(function(e,t){return c(l,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ue(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ue(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}({elevation:6,ref:t,variant:"filled"},e))});function de(r){var t=r.alert,n=r.SetAlert,i=r.message,o=e(r,se),l=o.autoHideDuration||3e3,m=o.severity||"error",s=o.sx||{width:"100%"},u=function(e,r){"clickaway"!==r&&n(!1)};return c(a,{open:t,autoHideDuration:l,onClose:u,children:c(pe,{severity:m,onClose:u,sx:s,children:i})})}var fe=v({palette:{primary:{main:"#c1002a"},secondary:{main:"#636363"},error:{main:C[900]},running:{main:j[900],contrastText:"#fff"},available:{main:A[200],contrastText:"#000"},info:{main:C[100]},success:{main:b[500]},empty:{main:x[500],contrastText:"#000"}}});function he(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?he(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):he(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ge(e){var r=e.sx||{};return c(s,{size:{xs:e.xs||e.size||12,lg:e.lg||e.size||6,md:e.md||12},sx:ve({},r),children:m(u,{defaultExpanded:!e.collapsed,square:!1,elevation:2,children:[c(p,{expandIcon:c(h,{}),sx:{backgroundColor:fe.palette.divider},children:c(f,{variant:"h5",children:e.title})}),c(d,{children:e.children})]})})}function ye(e){var r=e.children,t=e.reverse;return c(s,{container:!0,spacing:2,sx:{display:"flex",flexGrow:1,justifyContent:"center",flexWrap:t?"wrap-reverse":"wrap"},children:r})}var xe={positive:{red:{src:T.src,alt:"CAFCA Logo Positive Red"},white:{src:I.src,alt:"ZAC Apps Logo Positive White"},grey:{src:F.src,alt:"ZAC Apps Logo Positive Grey"}},negative:{red:{src:D.src,alt:"CAFCA Logo Negative Red"},white:{src:E.src,alt:"ZAC Apps Logo Negative White"},grey:{src:z.src,alt:"ZAC Apps Logo Negative Grey"}}};function be(){var e;return(null===(e=xe[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"negative"])||void 0===e||null===(e=e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"red"])||void 0===e?void 0:e.src)||xe.negative.red.src}function Ce(){var e;return(null===(e=xe[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"negative"])||void 0===e||null===(e=e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"red"])||void 0===e?void 0:e.alt)||xe.negative.red.alt}function Ae(e){var r=null!=e?e:{variant:"negative",color:"red",width:"48px"},t=r.variant,n=r.color,i=r.width,o=r.style;return c("img",{src:be(t,n),width:i,style:o,alt:Ce(t,n)})}function je(e){var r=null!=e?e:{},t=r.title,n=void 0===t?"JGU-ZAC Apps":t,i=r.iconUrl,o=r.variant,a=void 0===o?"negative":o,l=r.color,s=void 0===l?"red":l,u=r.iconAlt,p=r.width,d=void 0===p?"48px":p,h=r.children,v=i?c("img",{src:i,alt:u,width:d}):c(Ae,{variant:a,color:s,width:d});return c(_,{position:"sticky",children:m(k,{children:[h," ",c(f,{variant:"h6",component:"div",sx:{flexGrow:1},children:n}),v]})})}function we(e){var r=e.anchorEl;return c(r?H:R,{})}function Oe(e){var r=e.availApps,n=e.start,i=e.basePath,o=t.useState(null),a=L(o,2),l=a[0],s=a[1],u=Boolean(l),p=function(){s(null)},d=M();function f(){return n?m(t.Fragment,{children:[c(B,{component:w,href:i,selected:d===i,onClick:p,children:"Start"}),c(Z,{})]}):null}return i&&null!==i||(i="/"),m("div",{children:[c(G,{size:"large",edge:"start",color:"inherit","aria-label":"menu",sx:{mr:2},onClick:function(e){s(e.currentTarget)},children:c(we,{anchorEl:l})}),m(U,{id:"lock-menu",anchorEl:l,open:u,onClose:p,slotProps:{"aria-labelledby":"lock-button",role:"listbox"},children:[c(f,{}),r.map(function(e,r){return c(B,{component:w,href:e.path,selected:d===e.path+"/",onClick:p,children:e.name},e.name)})]})]})}function Pe(e){var r=e.footerContent;return c(n.Fragment,{children:c(s,{sx:{p:1,backgroundColor:fe.palette.divider,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",minHeight:64},children:c(s,{children:c(f,{variant:"body2",children:r})})})})}function Se(e){var r=e.title,t=e.availApps,i=e.footerContent,o=e.children,a=e.basePath,l=e.menu,s=e.iconUrl,u=e.iconAlt;return a&&null!==a||(a="/"),i&&null!==i||(i=""),m(n.Fragment,{children:[c(je,{title:c(P,{component:O,href:a,sx:{color:fe.palette.primary.contrastText},children:r}),iconUrl:s,iconAlt:u,children:l?c(Oe,{availApps:t,basePath:a,start:!0}):null}),c(S,{sx:{p:3,minHeight:"calc(100% - 128px)",display:"flex",justifyContent:"center"},children:o}),c(Pe,{footerContent:i})]})}function _e(e){var r=e.title,t=e.availApps,n=e.footerContent,i=e.basePath,o=e.iconUrl,a=e.iconAlt,l=e.children;return m(g,{theme:fe,children:[c(y,{}),c(Se,{title:r,availApps:t,footerContent:n,basePath:i,iconUrl:o,iconAlt:a,menu:!0,children:l})]})}function ke(e){var r=e.children;return c(V,{component:q,children:c(N,{size:"small","aria-label":"a dense table",children:r})})}function Te(e){var r=e.children;return c(Z,{textAlign:"left",children:r})}function De(e){var r=e.input,t=e.SetInput,o=e.error,a=e.SetError,l=e.minValue,s=e.maxValue,u=e.adornment,p=e.label,d=e.helperText,f=e.size,h=i(""),v=L(h,2),g=v[0],y=v[1],x=i(!1),b=L(x,2),C=b[0],A=b[1],j={};return"small"===f&&(j={maxWidth:75}),m(n.Fragment,{children:[c(J,{size:"small",sx:j,onChange:function(e){return function(e){var r=!1,n=e.target.value;n.match(/[0-9-]*/)[0]&&n.match(/[0-9-]*/)[0]===n||(r=!0,y("Input is not numerical.")),(n>s||n<l)&&(r=!0,y("Input is outside allowed boundaries.")),t(n),a(r),A(r)}(e)},value:r,error:o,label:p,helperText:d,inputProps:{inputMode:"numeric"},InputProps:{endAdornment:c(Q,{position:"end",children:u})}}),c(de,{alert:C,SetAlert:A,message:g})]})}function Ie(e){return e.toString()+" %"}function Ee(){return c(s,{container:!0,sx:{display:"flex",flexGrow:1,justifyContent:"center",alignContent:"center"},children:c(K,{})})}function Fe(e){var r=e.url,t=e.SetState,n=e.SetMetaData,a=e.reload,l=e.SetReload;e.error;var c=e.SetError,m=i(),s=L(m,2),u=s[0],p=s[1],d=i(),f=L(d,2);f[0];var h=f[1],v=null;return t||(t=p,v=u),c||(c=h),a||(a=!1),o(function(){try{fetch(r,{headers:{"Content-Type":"application/json",Accept:"application/json"}}).then(function(e){return n&&n(e.headers),console.log(e),e.ok?e.json():(c({error:e.statusText}),{error:e.statusText})}).then(function(e){console.log(e),t(e)})}catch(e){console.log(e),c({error:e})}l&&l(!1)},[a]),v}function ze(e){var r=e.children,t=e.matches,n=e.justify;return c(s,t?{sx:{display:"flex",justifyContent:n,alignItems:"center"},children:r}:{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:r})}function Le(e){var r=e.listmode,t=e.setup,i=e.spec,o=e.SetSpec,a=e.SetFilter,l=e.routerActive,m=l?W():null,u=l?M():null;return c(n.Fragment,{children:c(s,{children:c(X,{value:i,exclusive:!0,color:"primary",onChange:function(e,t){null!==t&&(o(t),a&&a({}),l&&m.push(u+"?spec="+t+"&mode="+r))},size:"small",children:Object.keys(t).map(function(e){return c(Y,{value:e,children:e},"spec_"+e)})})})})}function Me(e){var r=e.availApps;return c(s,{children:m(ge,{title:"Welcome to ZAC Apps",xs:12,lg:8,children:[c("p",{children:"Select an app to get started."}),c(s,{container:!0,sx:{display:"flex",flexWrap:"wrap",justifyContent:"center"},children:r.map(function(e){return m(ee,{sx:{m:5,minWidth:250,display:"flex",flexDirection:"column"},variant:"outlined",component:O,href:e.path,children:[c("p",{children:c($,{src:e.icon,alt:e.name,height:100})}),c("p",{children:e.name})]},"button_"+e.path)})})]})})}var We=re(te)(function(e){var t=e.theme;return r(r({},"&.".concat(ne.head),{backgroundColor:t.palette.grey[300]}),"&.".concat(ne.body),{fontSize:14})});function Ge(e){var r=e.url,t=e.reload,n=e.SetReload,a=i(),l=L(a,2),c=l[0],m=l[1],s=i(),u=L(s,2),p=u[0],d=u[1];return o(function(){fetch(r,{headers:{"Content-Type":"application/json",Accept:"application/json"}}).then(function(e){return d(e.headers),console.log(e),e.json()}).then(function(e){console.log(e),m(e)}),t&&n(!1)},[t]),{data:c,metadata:p}}function Be(e){var r=e.children,t=ie(fe.breakpoints.up("lg")),o=i(!1),a=L(o,2),l=a[0],s=a[1],u=function(e){return function(r){("keydown"!==r.type||"Tab"!==r.key&&"Shift"!==r.key)&&s(e)}};return m(n.Fragment,{children:[c(ee,{variant:"outlined",onClick:u(!0),startIcon:c(ce,{fontSize:"inherit"}),children:"Search/Filter"}),c(oe,{anchor:"left",open:l,onClose:u(!1),sx:{maxWidth:"350px"},children:c(S,{role:"presentation",width:t?"420px":"100%",children:m(ae,{children:[c(le,{sx:{justifyContent:"right"},children:c(G,{onClick:u(!1),children:c(me,{})})}),c(Z,{}),r]})})})]})}export{ge as AppCard,Be as AppDrawer,ye as AppGrid,Ae as AppIcons,je as AppMenu,_e as AppRoot,ke as AppTable,fe as AppTheme,Se as AppWrapper,Te as DivTitle,de as ErrorAlert,Pe as Footer,we as MenuButton,Oe as NextListMenu,De as NumField,Ie as Percentage,Ee as Progress,Fe as PublicFetch,ze as RespGrid,Le as SpecSwitch,Me as Start,We as TableHeadCell,Ge as useFetch};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zac-apps/commons",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0-beta.2",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"rollup": "node_modules/rollup/dist/rollup.js",
|
|
6
6
|
"dev": "next dev",
|
|
@@ -29,33 +29,33 @@
|
|
|
29
29
|
"license": "CC-BY-SA-4.0",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@emotion/react": "^11.14.0",
|
|
32
|
-
"@emotion/styled": "^11.14.1"
|
|
33
|
-
"@mui/icons-material": "^7.3.7",
|
|
34
|
-
"@mui/material": "^7.3.7"
|
|
32
|
+
"@emotion/styled": "^11.14.1"
|
|
35
33
|
},
|
|
36
34
|
"devDependencies": {
|
|
37
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
38
|
-
"@rollup/plugin-babel": "^
|
|
39
|
-
"@rollup/plugin-commonjs": "^29.0.
|
|
35
|
+
"@babel/plugin-transform-runtime": "^7.29.7",
|
|
36
|
+
"@rollup/plugin-babel": "^7.1.0",
|
|
37
|
+
"@rollup/plugin-commonjs": "^29.0.3",
|
|
40
38
|
"@rollup/plugin-json": "^6.1.0",
|
|
41
39
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
42
|
-
"@rollup/plugin-terser": "^0.
|
|
40
|
+
"@rollup/plugin-terser": "^1.0.0",
|
|
43
41
|
"@semantic-release/git": "^10.0.1",
|
|
44
|
-
"@semantic-release/gitlab": "^13.
|
|
45
|
-
"@semantic-release/npm": "^13.1.
|
|
46
|
-
"@storybook/addon-links": "^10.
|
|
47
|
-
"@storybook/addon-onboarding": "^10.
|
|
48
|
-
"@storybook/nextjs": "^10.
|
|
49
|
-
"@storybook/react": "^10.
|
|
50
|
-
"babel-loader": "^10.
|
|
42
|
+
"@semantic-release/gitlab": "^13.3.3",
|
|
43
|
+
"@semantic-release/npm": "^13.1.5",
|
|
44
|
+
"@storybook/addon-links": "^10.4.6",
|
|
45
|
+
"@storybook/addon-onboarding": "^10.4.6",
|
|
46
|
+
"@storybook/nextjs": "^10.4.6",
|
|
47
|
+
"@storybook/react": "^10.4.6",
|
|
48
|
+
"babel-loader": "^10.1.1",
|
|
51
49
|
"eslint": "^9",
|
|
52
|
-
"eslint-config-next": "16.
|
|
53
|
-
"eslint-plugin-storybook": "^10.
|
|
54
|
-
"rollup": "^4.
|
|
55
|
-
"semantic-release": "^25.0.
|
|
56
|
-
"storybook": "^10.
|
|
50
|
+
"eslint-config-next": "16.2.10",
|
|
51
|
+
"eslint-plugin-storybook": "^10.4.6",
|
|
52
|
+
"rollup": "^4.62.2",
|
|
53
|
+
"semantic-release": "^25.0.5",
|
|
54
|
+
"storybook": "^10.4.6"
|
|
57
55
|
},
|
|
58
56
|
"peerDependencies": {
|
|
57
|
+
"@mui/icons-material": "^9 || ^7",
|
|
58
|
+
"@mui/material": "^9 || ^7",
|
|
59
59
|
"next": "^16 || ^15",
|
|
60
60
|
"react": "^19 || ^18",
|
|
61
61
|
"react-dom": "^19 || ^18"
|