@zac-apps/commons 2.3.1-beta.1 → 2.4.0-beta.1
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 s from"@mui/material/Grid";import u from"@mui/material/Accordion";import p 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 v,ThemeProvider as g,CssBaseline as y}from"@mui/material";import{green as x,yellow as b,pink as C,lightGreen as w,red as A}from"@mui/material/colors";import j,{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"@babel/runtime/helpers/slicedToArray";import{usePathname as D,useRouter as L}from"next/navigation";import I from"@mui/material/IconButton";import U from"@mui/material/MenuItem";import E from"@mui/material/Menu";import F from"@mui/material/Divider";import R from"@mui/icons-material/Menu";import z from"@mui/icons-material/MenuOpen";import M from"@mui/material/Table";import W from"@mui/material/TableContainer";import G from"@mui/material/Paper";import B from"@mui/material/TextField";import Z from"@mui/material/InputAdornment";import H from"@mui/material/CircularProgress";import N from"@mui/material/ToggleButtonGroup";import V from"@mui/material/ToggleButton";import q from"next/image";import J from"@mui/material/Button";import{styled as Q}from"@mui/material/styles";import K,{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",s=o.sx||{width:"100%"},u=function(e,r){"clickaway"!==r&&n(!1)};return c(a,{open:t,autoHideDuration:l,onClose:u,children:c(ae,{severity:m,onClose:u,sx:s,children:i})})}var ce=v({palette:{primary:{main:"#c1002a"},secondary:{main:"#636363"},error:{main:C[900]},running:{main:A[900],contrastText:"#fff"},available:{main:w[200],contrastText:"#000"},info:{main:C[100]},success:{main:b[500]},empty:{main:x[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 se(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 ue(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:se({},r),children:m(u,{defaultExpanded:!e.collapsed,square:!1,elevation:2,children:[c(p,{expandIcon:c(h,{}),sx:{backgroundColor:ce.palette.divider},children:c(d,{variant:"h5",children:e.title})}),c(f,{children:e.children})]})})}function pe(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 fe=new URL("assets/cafca_logo_2026_pos_red.svg",import.meta.url).href,de=new URL("assets/cafca_logo_2026_neg_red.svg",import.meta.url).href,he=new URL("assets/cafca_logo_2026_pos_white.svg",import.meta.url).href,ve=new URL("assets/cafca_logo_2026_neg_white.svg",import.meta.url).href,ge=new URL("assets/cafca_logo_2026_pos_grey.svg",import.meta.url).href,ye=new URL("assets/cafca_logo_2026_neg_grey.svg",import.meta.url).href;function xe(e){return"string"==typeof e?e:null==e?void 0:e.src}var be={positive:{red:{src:xe(fe),alt:"CAFCA Logo Positive Red"},white:{src:xe(he),alt:"ZAC Apps Logo Positive White"},grey:{src:xe(ge),alt:"ZAC Apps Logo Positive Grey"}},negative:{red:{src:xe(de),alt:"CAFCA Logo Negative Red"},white:{src:xe(ve),alt:"ZAC Apps Logo Negative White"},grey:{src:xe(ye),alt:"ZAC Apps Logo Negative Grey"}}};function Ce(){var e;return(null===(e=be[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)||be.negative.red.src}function we(){var e;return(null===(e=be[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)||be.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:Ce(t,n),width:i,style:o,alt:we(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,f=void 0===p?"48px":p,h=r.children,v=i?c("img",{src:i,alt:u,width:f}):c(Ae,{variant:a,color:s,width:f});return c(_,{position:"sticky",children:m(k,{children:[h," ",c(d,{variant:"h6",component:"div",sx:{flexGrow:1},children:n}),v]})})}function Oe(e){var r=e.anchorEl;return c(r?z:R,{})}function Pe(e){var r=e.availApps,n=e.start,i=e.basePath,o=t.useState(null),a=T(o,2),l=a[0],s=a[1],u=Boolean(l),p=function(){s(null)},f=D();function d(){return n?m(t.Fragment,{children:[c(U,{component:j,href:i,selected:f===i,onClick:p,children:"Start"}),c(F,{})]}):null}return i&&null!==i||(i="/"),m("div",{children:[c(I,{size:"large",edge:"start",color:"inherit","aria-label":"menu",sx:{mr:2},onClick:function(e){s(e.currentTarget)},children:c(Oe,{anchorEl:l})}),m(E,{id:"lock-menu",anchorEl:l,open:u,onClose:p,slotProps:{"aria-labelledby":"lock-button",role:"listbox"},children:[c(d,{}),r.map(function(e,r){return c(U,{component:j,href:e.path,selected:f===e.path+"/",onClick:p,children:e.name},e.name)})]})]})}function Se(e){var r=e.footerContent;return c(n.Fragment,{children:c(s,{sx:{p:1,backgroundColor:ce.palette.divider,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",minHeight:64},children:c(s,{children:c(d,{variant:"body2",children:r})})})})}function _e(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:ce.palette.primary.contrastText},children:r}),iconUrl:s,iconAlt:u,children:l?c(Pe,{availApps:t,basePath:a,start:!0}):null}),c(S,{sx:{p:3,minHeight:"calc(100% - 128px)",display:"flex",justifyContent:"center"},children:o}),c(Se,{footerContent:i})]})}function ke(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:ce,children:[c(y,{}),c(_e,{title:r,availApps:t,footerContent:n,basePath:i,iconUrl:o,iconAlt:a,menu:!0,children:l})]})}function Te(e){var r=e.children;return c(W,{component:G,children:c(M,{size:"small","aria-label":"a dense table",children:r})})}function De(e){var r=e.children;return c(F,{textAlign:"left",children:r})}function Le(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,f=e.helperText,d=e.size,h=i(""),v=T(h,2),g=v[0],y=v[1],x=i(!1),b=T(x,2),C=b[0],w=b[1],A={};return"small"===d&&(A={maxWidth:75}),m(n.Fragment,{children:[c(B,{size:"small",sx:A,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),w(r)}(e)},value:r,error:o,label:p,helperText:f,inputProps:{inputMode:"numeric"},InputProps:{endAdornment:c(Z,{position:"end",children:u})}}),c(le,{alert:C,SetAlert:w,message:g})]})}function Ie(e){return e.toString()+" %"}function Ue(){return c(s,{container:!0,sx:{display:"flex",flexGrow:1,justifyContent:"center",alignContent:"center"},children:c(H,{})})}function Ee(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=T(m,2),u=s[0],p=s[1],f=i(),d=T(f,2);d[0];var h=d[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 Fe(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 Re(e){var r=e.listmode,t=e.setup,i=e.spec,o=e.SetSpec,a=e.SetFilter,l=e.routerActive,m=l?L():null,u=l?D():null;return c(n.Fragment,{children:c(s,{children:c(N,{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(V,{value:e,children:e},"spec_"+e)})})})})}function ze(e){var r=e.availApps;return c(s,{children:m(ue,{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(J,{sx:{m:5,minWidth:250,display:"flex",flexDirection:"column"},variant:"outlined",component:O,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)})})]})})}var Me=Q(K)(function(e){var t=e.theme;return r(r({},"&.".concat(X.head),{backgroundColor:t.palette.grey[300]}),"&.".concat(X.body),{fontSize:14})});function We(e){var r=e.url,t=e.reload,n=e.SetReload,a=i(),l=T(a,2),c=l[0],m=l[1],s=i(),u=T(s,2),p=u[0],f=u[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:p}}function Ge(e){var r=e.children,t=Y(ce.breakpoints.up("lg")),o=i(!1),a=T(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(J,{variant:"outlined",onClick:u(!0),startIcon:c(te,{fontSize:"inherit"}),children:"Search/Filter"}),c($,{anchor:"left",open:l,onClose:u(!1),sx:{maxWidth:"350px"},children:c(S,{role:"presentation",width:t?"420px":"100%",children:m(ee,{children:[c(re,{sx:{justifyContent:"right"},children:c(I,{onClick:u(!1),children:c(ne,{})})}),c(F,{}),r]})})})]})}export{ue as AppCard,Ge as AppDrawer,pe as AppGrid,Ae as AppIcons,je as AppMenu,ke as AppRoot,Te as AppTable,ce as AppTheme,_e as AppWrapper,De as DivTitle,le as ErrorAlert,Se as Footer,Oe as MenuButton,Pe as NextListMenu,Le as NumField,Ie as Percentage,Ue as Progress,Ee as PublicFetch,Fe as RespGrid,Re as SpecSwitch,ze as Start,Me as TableHeadCell,We as useFetch};
|
|
1
|
+
import e from"@babel/runtime/helpers/objectWithoutProperties";import r from"@babel/runtime/helpers/defineProperty";import*as t from"react";import n,{createContext as i,useContext as o,useState as a,useEffect as l}from"react";import c from"@mui/material/Snackbar";import u from"@mui/material/Alert";import{jsx as m,jsxs as s}from"react/jsx-runtime";import p from"@mui/material/Grid";import d from"@mui/material/Accordion";import f from"@mui/material/AccordionSummary";import h from"@mui/material/AccordionDetails";import v from"@mui/material/Typography";import g from"@mui/icons-material/ExpandMore";import{createTheme as y,ThemeProvider as b,CssBaseline as x}from"@mui/material";import{green as O,yellow as j,pink as w,lightGreen as C,red as A}from"@mui/material/colors";import P,{Link as S}from"next/link";import _ from"@mui/material/Link";import k from"@mui/material/Box";import D from"@mui/material/AppBar";import T from"@mui/material/Toolbar";import L from"@babel/runtime/helpers/slicedToArray";import{usePathname as E,useRouter as I}from"next/navigation";import W from"@mui/material/IconButton";import U from"@mui/material/MenuItem";import F from"@mui/material/Menu";import R from"@mui/material/Divider";import z from"@mui/icons-material/Menu";import M from"@mui/icons-material/MenuOpen";import G from"@mui/material/Table";import B from"@mui/material/TableContainer";import V from"@mui/material/Paper";import Z from"@mui/material/TextField";import H from"@mui/material/InputAdornment";import N 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 X}from"@mui/material/styles";import Y,{tableCellClasses as $}from"@mui/material/TableCell";import ee from"@mui/material/useMediaQuery";import re from"@mui/material/Drawer";import te from"@mui/material/List";import ne from"@mui/material/ListItem";import ie from"@mui/icons-material/ManageSearch";import oe from"@mui/icons-material/Close";var ae=["alert","SetAlert","message"];function le(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 ce=n.forwardRef(function(e,t){return m(u,function(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){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):le(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}({elevation:6,ref:t,variant:"filled"},e))});function ue(r){var t=r.alert,n=r.SetAlert,i=r.message,o=e(r,ae),a=o.autoHideDuration||3e3,l=o.severity||"error",u=o.sx||{width:"100%"},s=function(e,r){"clickaway"!==r&&n(!1)};return m(c,{open:t,autoHideDuration:a,onClose:s,children:m(ce,{severity:l,onClose:s,sx:u,children:i})})}var me=y({palette:{primary:{main:"#c1002a"},secondary:{main:"#636363"},error:{main:w[900]},running:{main:A[900],contrastText:"#fff"},available:{main:C[200],contrastText:"#000"},info:{main:w[100]},success:{main:j[500]},empty:{main:O[500],contrastText:"#000"}}});function se(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?se(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):se(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function de(e){var r=e.sx||{};return m(p,{size:{xs:e.xs||e.size||12,lg:e.lg||e.size||6,md:e.md||12},sx:pe({},r),children:s(d,{defaultExpanded:!e.collapsed,square:!1,elevation:2,children:[m(f,{expandIcon:m(g,{}),sx:{backgroundColor:me.palette.divider},children:m(v,{variant:"h5",children:e.title})}),m(h,{children:e.children})]})})}function fe(e){var r=e.children,t=e.reverse;return m(p,{container:!0,spacing:2,sx:{display:"flex",flexGrow:1,justifyContent:"center",flexWrap:t?"wrap-reverse":"wrap"},children:r})}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}var ge={title:"",availApps:[],footerContent:"",basePath:"/",menu:!1,iconVariant:"negative",iconColor:"red",iconUrl:"",iconAlt:"",iconWidth:"48px"},ye=i(ge);function be(e){var r=e.value,t=e.children;return m(ye.Provider,{value:ve(ve({},ge),null!=r?r:{}),children:t})}function xe(){return o(ye)}var Oe=new URL("assets/cafca_logo_2026_pos_red.svg",import.meta.url).href,je=new URL("assets/cafca_logo_2026_neg_red.svg",import.meta.url).href,we=new URL("assets/cafca_logo_2026_pos_white.svg",import.meta.url).href,Ce=new URL("assets/cafca_logo_2026_neg_white.svg",import.meta.url).href,Ae=new URL("assets/cafca_logo_2026_pos_grey.svg",import.meta.url).href,Pe=new URL("assets/cafca_logo_2026_neg_grey.svg",import.meta.url).href;function Se(e){return"string"==typeof e?e:null==e?void 0:e.src}var _e={positive:{red:{src:Se(Oe),alt:"CAFCA Logo Positive Red"},white:{src:Se(we),alt:"ZAC Apps Logo Positive White"},grey:{src:Se(Ae),alt:"ZAC Apps Logo Positive Grey"}},negative:{red:{src:Se(je),alt:"CAFCA Logo Negative Red"},white:{src:Se(Ce),alt:"ZAC Apps Logo Negative White"},grey:{src:Se(Pe),alt:"ZAC Apps Logo Negative Grey"}}};function ke(){var e;return(null===(e=_e[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)||_e.negative.red.src}function De(){var e;return(null===(e=_e[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)||_e.negative.red.alt}function Te(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 m("img",{src:ke(t,n),width:i,style:o,alt:De(t,n)})}function Le(e){var r=xe(),t=null!=e?e:{},n=t.title,i=void 0===n?r.title||"JGU-ZAC Apps":n,o=t.iconUrl,a=void 0===o?r.iconUrl:o,l=t.variant,c=void 0===l?r.iconVariant||"negative":l,u=t.color,p=void 0===u?r.iconColor||"red":u,d=t.iconAlt,f=void 0===d?r.iconAlt:d,h=t.width,g=void 0===h?r.iconWidth||"48px":h,y=t.children,b=a?m("img",{src:a,alt:f,width:g}):m(Te,{variant:c,color:p,width:g});return m(D,{position:"sticky",children:s(T,{children:[y," ",m(v,{variant:"h6",component:"div",sx:{flexGrow:1},children:i}),b]})})}function Ee(e){var r=e.anchorEl;return m(r?M:z,{})}function Ie(e){var r,n,i=e.availApps,o=e.start,a=e.basePath,l=xe(),c=null!==(r=null!=i?i:l.availApps)&&void 0!==r?r:[],u=null!==(n=null!=a?a:l.basePath)&&void 0!==n?n:"/",p=t.useState(null),d=L(p,2),f=d[0],h=d[1],v=Boolean(f),g=function(){h(null)},y=E();function b(){return o?s(t.Fragment,{children:[m(U,{component:P,href:u,selected:y===u,onClick:g,children:"Start"}),m(R,{})]}):null}return s("div",{children:[m(W,{size:"large",edge:"start",color:"inherit","aria-label":"menu",sx:{mr:2},onClick:function(e){h(e.currentTarget)},children:m(Ee,{anchorEl:f})}),s(F,{id:"lock-menu",anchorEl:f,open:v,onClose:g,slotProps:{"aria-labelledby":"lock-button",role:"listbox"},children:[m(b,{}),c.map(function(e,r){return m(U,{component:P,href:e.path,selected:y===e.path+"/",onClick:g,children:e.name},e.name)})]})]})}function We(e){var r,t=e.footerContent,i=xe(),o=null!==(r=null!=t?t:i.footerContent)&&void 0!==r?r:"";return m(n.Fragment,{children:m(p,{sx:{p:1,backgroundColor:me.palette.divider,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",minHeight:64},children:m(p,{children:m(v,{variant:"body2",children:o})})})})}function Ue(e){var r,t,i,o,a=xe(),l=null!==(r=e.title)&&void 0!==r?r:a.title,c=null!==(t=null!==(i=e.basePath)&&void 0!==i?i:a.basePath)&&void 0!==t?t:"/",u=null!==(o=e.menu)&&void 0!==o?o:a.menu,p=e.children;return s(n.Fragment,{children:[m(Le,{title:m(_,{component:S,href:c,sx:{color:me.palette.primary.contrastText},children:l}),children:u?m(Ie,{start:!0}):null}),m(k,{sx:{p:3,minHeight:"calc(100% - 128px)",display:"flex",justifyContent:"center"},children:p}),m(We,{})]})}function Fe(e){var r,t,n,i,o,a,l,c,u,p,d={title:null!==(r=e.title)&&void 0!==r?r:"",availApps:null!==(t=e.availApps)&&void 0!==t?t:[],footerContent:null!==(n=e.footerContent)&&void 0!==n?n:"",basePath:null!==(i=e.basePath)&&void 0!==i?i:"/",iconVariant:null!==(o=e.iconVariant)&&void 0!==o?o:"negative",iconColor:null!==(a=e.iconColor)&&void 0!==a?a:"red",iconUrl:null!==(l=e.iconUrl)&&void 0!==l?l:"",iconAlt:null!==(c=e.iconAlt)&&void 0!==c?c:"",iconWidth:null!==(u=e.iconWidth)&&void 0!==u?u:"48px",menu:null===(p=e.menu)||void 0===p||p};return s(b,{theme:me,children:[m(x,{}),m(be,{value:d,children:m(Ue,{children:e.children})})]})}function Re(e){var r=e.children;return m(B,{component:V,children:m(G,{size:"small","aria-label":"a dense table",children:r})})}function ze(e){var r=e.children;return m(R,{textAlign:"left",children:r})}function Me(e){var r=e.input,t=e.SetInput,i=e.error,o=e.SetError,l=e.minValue,c=e.maxValue,u=e.adornment,p=e.label,d=e.helperText,f=e.size,h=a(""),v=L(h,2),g=v[0],y=v[1],b=a(!1),x=L(b,2),O=x[0],j=x[1],w={};return"small"===f&&(w={maxWidth:75}),s(n.Fragment,{children:[m(Z,{size:"small",sx:w,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>c||n<l)&&(r=!0,y("Input is outside allowed boundaries.")),t(n),o(r),j(r)}(e)},value:r,error:i,label:p,helperText:d,inputProps:{inputMode:"numeric"},InputProps:{endAdornment:m(H,{position:"end",children:u})}}),m(ue,{alert:O,SetAlert:j,message:g})]})}function Ge(e){return e.toString()+" %"}function Be(){return m(p,{container:!0,sx:{display:"flex",flexGrow:1,justifyContent:"center",alignContent:"center"},children:m(N,{})})}function Ve(e){var r=e.url,t=e.SetState,n=e.SetMetaData,i=e.reload,o=e.SetReload;e.error;var c=e.SetError,u=a(),m=L(u,2),s=m[0],p=m[1],d=a(),f=L(d,2);f[0];var h=f[1],v=null;return t||(t=p,v=s),c||(c=h),i||(i=!1),l(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})}o&&o(!1)},[i]),v}function Ze(e){var r=e.children,t=e.matches,n=e.justify;return m(p,t?{sx:{display:"flex",justifyContent:n,alignItems:"center"},children:r}:{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:r})}function He(e){var r=e.listmode,t=e.setup,i=e.spec,o=e.SetSpec,a=e.SetFilter,l=e.routerActive,c=l?I():null,u=l?E():null;return m(n.Fragment,{children:m(p,{children:m(q,{value:i,exclusive:!0,color:"primary",onChange:function(e,t){null!==t&&(o(t),a&&a({}),l&&c.push(u+"?spec="+t+"&mode="+r))},size:"small",children:Object.keys(t).map(function(e){return m(J,{value:e,children:e},"spec_"+e)})})})})}function Ne(e){var r=e.availApps;return m(p,{children:s(de,{title:"Welcome to ZAC Apps",xs:12,lg:8,children:[m("p",{children:"Select an app to get started."}),m(p,{container:!0,sx:{display:"flex",flexWrap:"wrap",justifyContent:"center"},children:r.map(function(e){return s(K,{sx:{m:5,minWidth:250,display:"flex",flexDirection:"column"},variant:"outlined",component:S,href:e.path,children:[m("p",{children:m(Q,{src:e.icon,alt:e.name,height:100})}),m("p",{children:e.name})]},"button_"+e.path)})})]})})}var qe=X(Y)(function(e){var t=e.theme;return r(r({},"&.".concat($.head),{backgroundColor:t.palette.grey[300]}),"&.".concat($.body),{fontSize:14})});function Je(e){var r=e.url,t=e.reload,n=e.SetReload,i=a(),o=L(i,2),c=o[0],u=o[1],m=a(),s=L(m,2),p=s[0],d=s[1];return l(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),u(e)}),t&&n(!1)},[t]),{data:c,metadata:p}}function Qe(e){var r=e.children,t=ee(me.breakpoints.up("lg")),i=a(!1),o=L(i,2),l=o[0],c=o[1],u=function(e){return function(r){("keydown"!==r.type||"Tab"!==r.key&&"Shift"!==r.key)&&c(e)}};return s(n.Fragment,{children:[m(K,{variant:"outlined",onClick:u(!0),startIcon:m(ie,{fontSize:"inherit"}),children:"Search/Filter"}),m(re,{anchor:"left",open:l,onClose:u(!1),sx:{maxWidth:"350px"},children:m(k,{role:"presentation",width:t?"420px":"100%",children:s(te,{children:[m(ne,{sx:{justifyContent:"right"},children:m(W,{onClick:u(!1),children:m(oe,{})})}),m(R,{}),r]})})})]})}export{de as AppCard,ye as AppContext,Qe as AppDrawer,fe as AppGrid,Te as AppIcons,Le as AppMenu,Fe as AppRoot,be as AppShellProvider,Re as AppTable,me as AppTheme,Ue as AppWrapper,ze as DivTitle,ue as ErrorAlert,We as Footer,Ee as MenuButton,Ie as NextListMenu,Me as NumField,Ge as Percentage,Be as Progress,Ve as PublicFetch,Ze as RespGrid,He as SpecSwitch,Ne as Start,qe as TableHeadCell,xe as useAppContext,Je as useFetch};
|