@zac-apps/commons 2.3.0-beta.1 → 2.3.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.
- package/dist/index.js +1 -1
- package/package.json +1 -1
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 g,ThemeProvider as x,CssBaseline as y}from"@mui/material";import{green as v,yellow as b,pink as j,lightGreen as C,red as O}from"@mui/material/colors";import A,{Link as w}from"next/link";import S from"@mui/material/Link";import P from"@mui/material/Box";import k from"@mui/material/AppBar";import T from"@mui/material/Toolbar";import D from"/assets/cafca_logo_2026_neg_white.svg";import I from"@babel/runtime/helpers/slicedToArray";import{usePathname as E,useRouter as z}from"next/navigation";import F from"@mui/material/IconButton";import M from"@mui/material/MenuItem";import B from"@mui/material/Menu";import W from"@mui/material/Divider";import G from"@mui/icons-material/Menu";import U from"@mui/icons-material/MenuOpen";import _ 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 q from"@mui/material/ToggleButtonGroup";import J from"@mui/material/ToggleButton";import Q from"next/image";import K from"@mui/material/Button";import{styled as N}from"@mui/material/styles";import X,{tableCellClasses as Y}from"@mui/material/TableCell";import $ from"@mui/material/useMediaQuery";import ee from"@mui/material/Drawer";import re from"@mui/material/List";import te from"@mui/material/ListItem";import ne from"@mui/icons-material/ManageSearch";import ie from"@mui/icons-material/Close";var oe=["alert","SetAlert","message"];function ae(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 le=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?ae(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}({elevation:6,ref:t,variant:"filled"},e))});function ce(r){var t=r.alert,n=r.SetAlert,i=r.message,o=e(r,oe),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(le,{severity:m,onClose:p,sx:u,children:i})})}var me=g({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:b[500]},empty:{main:v[500],contrastText:"#000"}}});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}function pe(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}function se(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:pe({},r),children:m(p,{defaultExpanded:!e.collapsed,square:!1,elevation:2,children:[c(s,{expandIcon:c(h,{}),sx:{backgroundColor:me.palette.divider},children:c(d,{variant:"h5",children:e.title})}),c(f,{children:e.children})]})})}function fe(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 de(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}),c("img",t?{src:t,width:"48px",alt:n}:{src:D.src,width:"48px",alt:n})]})})}function he(e){var r=e.anchorEl;return c(r?U:G,{})}function ge(e){var r=e.availApps,n=e.start,i=e.basePath,o=t.useState(null),a=I(o,2),l=a[0],u=a[1],p=Boolean(l),s=function(){u(null)},f=E();function d(){return n?m(t.Fragment,{children:[c(M,{component:A,href:i,selected:f===i,onClick:s,children:"Start"}),c(W,{})]}):null}return i&&null!==i||(i="/"),m("div",{children:[c(F,{size:"large",edge:"start",color:"inherit","aria-label":"menu",sx:{mr:2},onClick:function(e){u(e.currentTarget)},children:c(he,{anchorEl:l})}),m(B,{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(M,{component:A,href:e.path,selected:f===e.path+"/",onClick:s,children:e.name},e.name)})]})]})}function xe(e){var r=e.footerContent;return c(n.Fragment,{children:c(u,{sx:{p:1,backgroundColor:me.palette.divider,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",minHeight:64},children:c(u,{children:c(d,{variant:"body2",children:r})})})})}function ye(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(de,{title:c(S,{component:w,href:a,sx:{color:me.palette.primary.contrastText},children:r}),iconUrl:u,iconAlt:p,children:l?c(ge,{availApps:t,basePath:a,start:!0}):null}),c(P,{sx:{p:3,minHeight:"calc(100% - 128px)",display:"flex",justifyContent:"center"},children:o}),c(xe,{footerContent:i})]})}function ve(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:me,children:[c(y,{}),c(ye,{title:r,availApps:t,footerContent:n,basePath:i,iconUrl:o,iconAlt:a,menu:!0,children:l})]})}function be(e){var r=e.children;return c(H,{component:L,children:c(_,{size:"small","aria-label":"a dense table",children:r})})}function je(e){var r=e.children;return c(W,{textAlign:"left",children:r})}function Ce(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(""),g=I(h,2),x=g[0],y=g[1],v=i(!1),b=I(v,2),j=b[0],C=b[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,y("Input is not numerical.")),(n>u||n<l)&&(r=!0,y("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(ce,{alert:j,SetAlert:C,message:x})]})}function Oe(e){return e.toString()+" %"}function Ae(){return c(u,{container:!0,sx:{display:"flex",flexGrow:1,justifyContent:"center",alignContent:"center"},children:c(Z,{})})}function we(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=I(m,2),p=u[0],s=u[1],f=i(),d=I(f,2);d[0];var h=d[1],g=null;return t||(t=s,g=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]),g}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?z():null,p=l?E():null;return c(n.Fragment,{children:c(u,{children:c(q,{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(J,{value:e,children:e},"spec_"+e)})})})})}function ke(e){var r=e.availApps;return c(u,{children:m(se,{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(K,{sx:{m:5,minWidth:250,display:"flex",flexDirection:"column"},variant:"outlined",component:w,href:e.path,children:[c("p",{children:c(Q,{src:e.icon,alt:e.name,height:100})}),c("p",{children:e.name})]},"button_"+e.path)})})]})})}console.log("DefaultIcon",D);var Te=N(X)(function(e){var t=e.theme;return r(r({},"&.".concat(Y.head),{backgroundColor:t.palette.grey[300]}),"&.".concat(Y.body),{fontSize:14})});function De(e){var r=e.url,t=e.reload,n=e.SetReload,a=i(),l=I(a,2),c=l[0],m=l[1],u=i(),p=I(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 Ie(e){var r=e.children,t=$(me.breakpoints.up("lg")),o=i(!1),a=I(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(K,{variant:"outlined",onClick:p(!0),startIcon:c(ne,{fontSize:"inherit"}),children:"Search/Filter"}),c(ee,{anchor:"left",open:l,onClose:p(!1),sx:{maxWidth:"350px"},children:c(P,{role:"presentation",width:t?"420px":"100%",children:m(re,{children:[c(te,{sx:{justifyContent:"right"},children:c(F,{onClick:p(!1),children:c(ie,{})})}),c(W,{}),r]})})})]})}export{se as AppCard,Ie as AppDrawer,fe as AppGrid,de as AppMenu,ve as AppRoot,be as AppTable,me as AppTheme,ye as AppWrapper,je as DivTitle,ce as ErrorAlert,xe as Footer,he as MenuButton,ge as NextListMenu,Ce as NumField,Oe as Percentage,Ae as Progress,we as PublicFetch,Se as RespGrid,Pe as SpecSwitch,ke as Start,Te as TableHeadCell,De 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};
|