@corva/dc-platform-shared 0.5.0-rc.0 → 0.6.0-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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"@babel/runtime/helpers/slicedToArray";import{useReducer as r,useEffect as t}from"react";import e from"classnames";import{MuiThemeProvider as i}from"@material-ui/core";import{MuiPickersUtilsProvider as m}from"@material-ui/pickers";import n from"@date-io/moment";import a from"moment";import{isPDFReportView as c}from"@corva/ui/CLI/hocs/utils";import{
|
|
1
|
+
import o from"@babel/runtime/helpers/slicedToArray";import{useReducer as r,useEffect as t}from"react";import e from"classnames";import{MuiThemeProvider as i}from"@material-ui/core";import{MuiPickersUtilsProvider as m}from"@material-ui/pickers";import n from"@date-io/moment";import a from"moment";import{isPDFReportView as c}from"@corva/ui/CLI/hocs/utils";import{LOCAL_STORAGE_APP_THEME_KEY as p}from"@corva/ui/CLI/hocs/constants";import{NotificationsContainer as s}from"@corva/ui/components";import{THEMES as l}from"@corva/ui/constants/theme";import{darkTheme as f,lightTheme as u}from"@corva/ui/config/theme";import{setThemeVariables as h}from"@corva/ui/utils/themeVariables";import{LOGIN_ROUTE_REG_EXP as d}from"../../constants/index.js";import v from"./components/AppBar/AppBar.js";import{AuthContext as A}from"../../context/auth.js";import g from"../../hocs/effects/useProvideAuth.js";import j from"./App.css.js";import{jsx as I,jsxs as C,Fragment as b}from"react/jsx-runtime";function x(x){var D,K=x.children,L=x.router,R=g(L),T=!d.test(L.location.pathname)&&!R.loading,B=r((function(o){return o+1}),0),N=o(B,2)[1],P=null!==(D=localStorage.getItem(p))&&void 0!==D?D:l.DARK,S=!T||!c&&P===l.DARK;t((function(){return h(S)}),[S]);return I(A.Provider,{value:R,children:I(i,{theme:S?f:u,children:I(m,{libInstance:a,utils:n,children:C(b,{children:[!T&&K,T&&C("div",{className:j.app,children:[I(s,{}),I(v,{toggleTheme:function(){localStorage.setItem(p,S?l.LIGHT:l.DARK),N()}}),I("div",{className:e(j.appContent,c&&j.pdfAppContent,!S&&j.lightAppContent),children:K})]})]})})})})}export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/slicedToArray";import{useState as o}from"react";import r from"prop-types";import{makeStyles as t,useTheme as a,AppBar as i,Toolbar as n,FormControlLabel as l,Checkbox as c,Tooltip as s,IconButton as p,Typography as m,Menu as u,MenuItem as d}from"@material-ui/core";import h from"@material-ui/icons/AccountCircle";import f from"@corva/ui/components/SwitchControl";import g
|
|
1
|
+
import e from"@babel/runtime/helpers/slicedToArray";import{useState as o}from"react";import r from"prop-types";import{makeStyles as t,useTheme as a,AppBar as i,Toolbar as n,FormControlLabel as l,Checkbox as c,Tooltip as s,IconButton as p,Typography as m,Menu as u,MenuItem as d}from"@material-ui/core";import h from"@material-ui/icons/AccountCircle";import f from"@corva/ui/components/SwitchControl";import{LOCAL_STORAGE_PDF_REPORT_VIEW_KEY as g}from"@corva/ui/CLI/hocs/constants";import{isPDFReportView as v}from"@corva/ui/CLI/hocs/utils";import C from"../../../../assets/DevCenterLogo.js";import{useAuth as b}from"../../../../context/auth.js";import{jsxs as B,jsx as w}from"react/jsx-runtime";var L=t((function(e){return{grow:{flexGrow:1},flex:{display:"flex"},appBar:{backgroundColor:"rgb(30, 31, 31)"},iconButtonRoot:{borderRadius:"unset"},userProfileIcon:{marginLeft:4},headerControl:{marginRight:32},formControlLabel:{fontSize:14}}}));function k(r){var t,k,A=r.toggleTheme,T=L(),x=b(),I=x.user,N=x.logout,_=a(),R=o(null),S=e(R,2),y=S[0],z=S[1],D=Boolean(y),O=function(){return z(null)},P="".concat(null==I||null===(t=I.first_name)||void 0===t?void 0:t[0]).concat(null==I||null===(k=I.last_name)||void 0===k?void 0:k[0]).toUpperCase();return B("div",{children:[w(i,{position:"static",className:T.appBar,children:B(n,{children:[w(C,{}),w("div",{className:T.grow}),w(l,{control:w(c,{"data-testid":"".concat("AppBar","_pdfReport"),checked:v,size:"small",onChange:function(e){localStorage.setItem(g,e.target.checked),window.location.reload()}}),label:"PDF report view",classes:{label:T.formControlLabel},className:T.headerControl}),!v&&w(s,{title:"Switch to light theme to tune your app for PDF reports",placement:"bottom",children:w("div",{children:w(f,{"data-testid":"".concat("AppBar","_themeSwitch"),className:T.headerControl,leftLabel:"Dark Theme",rightLabel:"Light Theme",onChange:A,checked:_.isLightTheme,size:"small",title:""})})}),w("div",{children:w(p,{edge:"end","aria-label":"account of current user","aria-controls":"app-bar-menu","aria-haspopup":"true",onClick:function(e){return z(e.currentTarget)},color:"inherit",className:T.iconButtonRoot,children:B("div",{className:T.flex,children:[w(m,{"data-testid":"".concat("AppBar","_userInitials"),children:P}),w(h,{className:T.userProfileIcon})]})})})]})}),w(u,{"data-testid":"".concat("AppBar","_userDropdown"),anchorEl:y,id:"app-bar-menu",keepMounted:!0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},open:D,onClose:O,children:w(d,{"data-testid":"".concat("AppBar","_signOutMenuItem"),onClick:function(){N(),O()},children:"Sign Out"})})]})}k.propTypes={toggleTheme:r.func.isRequired};export{k as default};
|
package/CLI/hocs/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import{DEFAULT_APP_SIZE as t}from"@corva/ui/constants/apps";
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import{DEFAULT_APP_SIZE as t}from"@corva/ui/constants/apps";function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function n(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?r(Object(o),!0).forEach((function(r){e(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function o(e){return JSON.parse(localStorage.getItem(e))||{}}function i(e,t){var r=o(e)||{};localStorage.setItem(e,JSON.stringify(n(n({},r),t)))}var c=function(e){var r,i,c,l,p=null!==(r=null==e||null===(i=e.application)||void 0===i||null===(c=i.ui)||void 0===c?void 0:c.initial_size)&&void 0!==r?r:t;return o(null==e||null===(l=e.application)||void 0===l?void 0:l.key).coordinates||n(n({},p),{},{x:0,y:0})};export{c as getAppCoordinates,o as getLocalAppData,i as updateLocalAppData};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as o from"@corva/ui";import{ProvidePermissions as r}from"@corva/ui/permissions";import"@corva/ui/styles/index.global.css.js";import"@corva/ui/styles/reactVirtualized.global.css.js";import"@corva/ui/styles/emojiMart.global.css.js";import"@corva/ui/styles/mapbox.global.css.js";import"@corva/ui/styles/lightbox.global.css.js";import"@corva/ui/styles/generatedThemesVariables.global.css.js";import"@corva/ui/styles/customScrollbars.global.css.js";import"@corva/ui/config/initGlobalDependencies";import t
|
|
1
|
+
import*as o from"@corva/ui";import{ProvidePermissions as r}from"@corva/ui/permissions";import"@corva/ui/styles/index.global.css.js";import"@corva/ui/styles/reactVirtualized.global.css.js";import"@corva/ui/styles/emojiMart.global.css.js";import"@corva/ui/styles/mapbox.global.css.js";import"@corva/ui/styles/lightbox.global.css.js";import"@corva/ui/styles/generatedThemesVariables.global.css.js";import"@corva/ui/styles/customScrollbars.global.css.js";import"@corva/ui/config/initGlobalDependencies";import{isPDFReportView as t}from"@corva/ui/CLI/hocs/utils";import s from"./withAppDataProviderHOC.js";import i from"./withCLIAppSettingsHOC.js";import a from"./withReactRouterHOC.js";import e from"./withGridLayoutHOC/withGridLayoutHOC.js";import m from"./withPDFLayoutHOC.js";import{withDevCenterRouterHOC as p}from"./withDevCenterRouterHOC.js";import{jsx as c}from"react/jsx-runtime";window["@corva/ui"]=o;var l=function(o){var l=o.component,n=o.settings,u=o.manifest,v=o.packageJson;return function(){var o=i(s({CLIAppComponent:l,CLIAppSettings:n,packageJson:v})),f=t?m(o):e(o),g=a(p(f));return c(r,{children:c(g,{manifest:u,dashboardProps:{}})})}};export{l as default};
|
package/package.json
CHANGED
package/CLI/hocs/constants.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var E="APP_THEME",P="PDF_REPORT_VIEW";export{E as LOCAL_STORAGE_APP_THEME_KEY,P as LOCAL_STORAGE_PDF_REPORT_VIEW_KEY};
|